🐛 Fix Ctrl+Home/End moving only to the paragraph edge (#12225)

This commit is contained in:
Elena Torró 2026-10-08 16:37:05 +02:00 committed by GitHub
parent 78d26243c7
commit 91b30d387f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -923,6 +923,11 @@ impl TextEditorState {
CursorDirection::LineAfter => {
text_helpers::move_cursor_down(&focus, paragraphs, text_content)
}
CursorDirection::LineStart if word_boundary => TextPositionWithAffinity::empty(),
CursorDirection::LineEnd if word_boundary => text_helpers::move_cursor_line_end(
&TextPositionWithAffinity::new_downstream_affinity(paragraphs.len() - 1, 0),
paragraphs,
),
CursorDirection::LineStart => text_helpers::move_cursor_line_start(&focus, paragraphs),
CursorDirection::LineEnd => text_helpers::move_cursor_line_end(&focus, paragraphs),
};