@@ -238,11 +238,13 @@ pub fn move_next_word_end(cx: &mut Context) {
240pub fn move_file_start(cx: &mut Context) {
240pub fn move_file_start(cx: &mut Context) {
241 let doc = cx.doc();
242 let doc = cx.doc();
242 doc.set_selection(Selection::point(0));
243 doc.set_selection(Selection::point(0));
245pub fn move_file_end(cx: &mut Context) {
246pub fn move_file_end(cx: &mut Context) {
246 let doc = cx.doc();
248 let doc = cx.doc();
247 let text = doc.text();
249 let text = doc.text();
248 let last_line = text.line_to_char(text.len_lines().saturating_sub(2));
250 let last_line = text.line_to_char(text.len_lines().saturating_sub(2));
@@ -1027,9 +1029,21 @@ pub fn normal_mode(cx: &mut Context) {
1032+// Store a jump on the jumplist.
1033+fn push_jump(cx: &mut Context) {
1035+ let doc = cx.doc();
1036+ (doc.id(), doc.selection().clone())
1038+ cx.view().jumps.push(jump);
1030pub fn goto_mode(cx: &mut Context) {
1041pub fn goto_mode(cx: &mut Context) {
1031 let count = cx.count;
1042 let count = cx.count;
1032 if count > 1 {
1044 if count > 1 {
1033 // TODO: can't go to line 1 since we can't distinguish between g and 1g, g gets converted
1047 // TODO: can't go to line 1 since we can't distinguish between g and 1g, g gets converted
1034 // to 1g
1048 // to 1g
1035 let doc = cx.doc();
1049 let doc = cx.doc();
@@ -1069,6 +1083,8 @@ pub fn exit_select_mode(cx: &mut Context) {
1069fn _goto(cx: &mut Context, locations: Vec<lsp::Location>) {
1083fn _goto(cx: &mut Context, locations: Vec<lsp::Location>) {
1070 use helix_view::editor::Action;
1084 use helix_view::editor::Action;
1072 fn jump_to(editor: &mut Editor, location: &lsp::Location, action: Action) {
1088 fn jump_to(editor: &mut Editor, location: &lsp::Location, action: Action) {
1073 let id = editor
1089 let id = editor
1074 .open(PathBuf::from(location.uri.path()), action)
1090 .open(PathBuf::from(location.uri.path()), action)