Fix column calculation to match status line

pull/13440/head
Daniel Bowring 2025-04-30 01:06:04 +10:00
parent 0263b7e1f1
commit 25149ccb9c
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -3847,7 +3847,7 @@ fn goto_column_impl(cx: &mut Context, movement: Movement) {
let line = range.cursor_line(text); let line = range.cursor_line(text);
let line_start = text.line_to_char(line); let line_start = text.line_to_char(line);
let line_end = line_end_char_index(&text, line); let line_end = line_end_char_index(&text, line);
let pos = graphemes::prev_grapheme_boundary(text, line_start + count).min(line_end); let pos = graphemes::nth_next_grapheme_boundary(text, line_start, count - 1).min(line_end);
range.put_cursor(text, pos, movement == Movement::Extend) range.put_cursor(text, pos, movement == Movement::Extend)
}); });
doc.set_selection(view.id, selection); doc.set_selection(view.id, selection);