Fix issue with new delete line implementation

This commit is contained in:
Darren Burns 2024-01-18 11:04:34 +00:00
parent 0d87caa2ea
commit 37db462a0b
No known key found for this signature in database
GPG key ID: B0939B45037DC345
2 changed files with 3 additions and 3 deletions

View file

@ -1730,7 +1730,7 @@ TextArea {
end_row -= 1
from_location = (start_row, 0)
to_location = (end_row + 1, end_column)
to_location = (end_row + 1, 0)
self.delete(from_location, to_location, maintain_selection_offset=False)
self.move_cursor_relative(columns=end_column, record_width=False)

View file

@ -219,8 +219,8 @@ async def test_delete_line_multiline_document(selection, expected_result):
await pilot.press("ctrl+x")
cursor_row, _ = text_area.cursor_location
assert text_area.selection == Selection.cursor((cursor_row, 0))
cursor_row, cursor_column = text_area.cursor_location
assert text_area.selection == Selection.cursor((cursor_row, cursor_column))
assert text_area.text == expected_result