mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user