Support for bracketed paste mode (#567)

* Detecting bracketed paste, sending paste events

* Bracketed pasting support in TextInput

* Restore debugging conditional

* Handle pasting of text in text-input, improve scrolling

* Fix ordering of handling in parser for bracketed pastes

* Docstrings

* Add docstrings
This commit is contained in:
darrenburns
2022-06-08 16:42:59 +01:00
committed by GitHub
parent de22f9e653
commit fe151a7f25
9 changed files with 177 additions and 69 deletions

View File

@@ -136,21 +136,21 @@ def test_cursor_text_end_cursor_in_middle():
def test_insert_at_cursor_cursor_at_start():
editor = TextEditorBackend(CONTENT)
assert editor.insert_at_cursor("ABC")
assert editor.insert("ABC")
assert editor.content == "ABC" + CONTENT
assert editor.cursor_index == len("ABC")
def test_insert_at_cursor_cursor_in_middle():
start_cursor_index = 6
editor = TextEditorBackend(CONTENT, start_cursor_index)
assert editor.insert_at_cursor("ABC")
assert editor.insert("ABC")
assert editor.content == "Hello,ABC world!"
assert editor.cursor_index == start_cursor_index + len("ABC")
def test_insert_at_cursor_cursor_at_end():
editor = TextEditorBackend(CONTENT, len(CONTENT))
assert editor.insert_at_cursor("ABC")
assert editor.insert("ABC")
assert editor.content == CONTENT + "ABC"
assert editor.cursor_index == len(editor.content)