press the down key to move to the end of the line (#52)

This commit is contained in:
reya
2025-05-30 12:14:51 +07:00
committed by GitHub
parent 63191c16bd
commit 7cc512331b
6 changed files with 52 additions and 42 deletions

View File

@@ -503,6 +503,13 @@ impl InputState {
return;
}
// Handle moving below the last line
if direction == 1 && new_line_index == 0 && new_sub_line > 0 && lines.len() == 1 {
// Move cursor to the end of the text
self.move_to(self.text.len(), window, cx);
return;
}
if new_sub_line < 0 {
if new_line_index > 0 {
new_line_index -= 1;