From 7ccc4993f4814f72106de4882d00614fdc67ba13 Mon Sep 17 00:00:00 2001 From: Jan Hrastnik Date: Mon, 5 Oct 2020 15:47:15 +0200 Subject: [PATCH] added ge command --- helix-view/src/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-view/src/commands.rs b/helix-view/src/commands.rs index 630845207..43c27cb4f 100644 --- a/helix-view/src/commands.rs +++ b/helix-view/src/commands.rs @@ -127,7 +127,7 @@ pub fn move_file_start(view: &mut View, _count: usize) { pub fn move_file_end(view: &mut View, _count: usize) { // TODO: use a transaction let text = &view.state.doc; - let last_line = text.char_to_line(text.len_lines().checked_sub(1).unwrap()); + let last_line = text.line_to_char(text.len_lines().checked_sub(1).unwrap()); view.state.selection = Selection::single(last_line, last_line); view.state.mode = Mode::Normal;