input: Fix enter newline position incorrect by #901 change. (#905)

This commit is contained in:
Jason Lee 2025-05-27 17:25:54 +08:00 committed by GitHub
parent 0389608f59
commit 372c78fac6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1203,7 +1203,7 @@ impl InputState {
self.replace_text_in_range(None, "\n", window, cx);
// Move cursor to the start of the next line
let mut new_offset = self.next_boundary(self.cursor_offset()) - 1;
let mut new_offset = self.cursor_offset() - 1;
if is_eof {
new_offset += 1;
}