@@ -965,19 +965,18 @@ fn goto_file_start(cx: &mut Context) {
965 if cx.count.is_some() {
965 if cx.count.is_some() {
966 goto_line(cx);
966 goto_line(cx);
968− push_jump(cx.editor);
969 let (view, doc) = current!(cx.editor);
968 let (view, doc) = current!(cx.editor);
970 let text = doc.text().slice(..);
969 let text = doc.text().slice(..);
971 let selection = doc
970 let selection = doc
972 .selection(view.id)
971 .selection(view.id)
974 .transform(|range| range.put_cursor(text, 0, doc.mode == Mode::Select));
973 .transform(|range| range.put_cursor(text, 0, doc.mode == Mode::Select));
974+ push_jump(view, doc);
975 doc.set_selection(view.id, selection);
975 doc.set_selection(view.id, selection);
979fn goto_file_end(cx: &mut Context) {
979fn goto_file_end(cx: &mut Context) {
980− push_jump(cx.editor);
981 let (view, doc) = current!(cx.editor);
980 let (view, doc) = current!(cx.editor);
982 let text = doc.text().slice(..);
981 let text = doc.text().slice(..);
983 let pos = doc.text().len_chars();
982 let pos = doc.text().len_chars();
@@ -985,6 +984,7 @@ fn goto_file_end(cx: &mut Context) {
985 .selection(view.id)
984 .selection(view.id)
987 .transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
986 .transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
987+ push_jump(view, doc);
988 doc.set_selection(view.id, selection);
988 doc.set_selection(view.id, selection);
@@ -2485,8 +2485,7 @@ fn try_restore_indent(doc: &mut Document, view_id: ViewId) {
2487// Store a jump on the jumplist.
2487// Store a jump on the jumplist.
2488−fn push_jump(editor: &mut Editor) {
2488+fn push_jump(view: &mut View, doc: &Document) {
2489− let (view, doc) = current!(editor);
2490 let jump = (doc.id(), doc.selection(view.id).clone());
2489 let jump = (doc.id(), doc.selection(view.id).clone());
2491 view.jumps.push(jump);
2490 view.jumps.push(jump);
@@ -2497,8 +2496,6 @@ fn goto_line(cx: &mut Context) {
2498fn goto_line_impl(editor: &mut Editor, count: Option<NonZeroUsize>) {
2497fn goto_line_impl(editor: &mut Editor, count: Option<NonZeroUsize>) {
2499 if let Some(count) = count {
2498 if let Some(count) = count {
2502 let (view, doc) = current!(editor);
2499 let (view, doc) = current!(editor);
2503 let max_line = if doc.text().line(doc.text().len_lines() - 1).len_chars() == 0 {
2500 let max_line = if doc.text().line(doc.text().len_lines() - 1).len_chars() == 0 {
2504 // If the last line is blank, don't jump to it.
2501 // If the last line is blank, don't jump to it.
@@ -2513,13 +2510,13 @@ fn goto_line_impl(editor: &mut Editor, count: Option<NonZeroUsize>) {
2513 .selection(view.id)
2510 .selection(view.id)
2514 .clone()
2511 .clone()
2515 .transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
2512 .transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
2514+ push_jump(view, doc);
2516 doc.set_selection(view.id, selection);
2515 doc.set_selection(view.id, selection);
2520fn goto_last_line(cx: &mut Context) {
2519fn goto_last_line(cx: &mut Context) {
2521− push_jump(cx.editor);
2523 let (view, doc) = current!(cx.editor);
2520 let (view, doc) = current!(cx.editor);
2524 let line_idx = if doc.text().line(doc.text().len_lines() - 1).len_chars() == 0 {
2521 let line_idx = if doc.text().line(doc.text().len_lines() - 1).len_chars() == 0 {
2525 // If the last line is blank, don't jump to it.
2522 // If the last line is blank, don't jump to it.
@@ -2533,6 +2530,8 @@ fn goto_last_line(cx: &mut Context) {
2533 .selection(view.id)
2530 .selection(view.id)
2534 .clone()
2531 .clone()
2535 .transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
2532 .transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
2534+ push_jump(view, doc);
2536 doc.set_selection(view.id, selection);
2535 doc.set_selection(view.id, selection);
@@ -2601,10 +2600,9 @@ fn exit_select_mode(cx: &mut Context) {
2603fn goto_pos(editor: &mut Editor, pos: usize) {
2602fn goto_pos(editor: &mut Editor, pos: usize) {
2606 let (view, doc) = current!(editor);
2603 let (view, doc) = current!(editor);
2605+ push_jump(view, doc);
2608 doc.set_selection(view.id, Selection::point(pos));
2606 doc.set_selection(view.id, Selection::point(pos));
2609 align_view(doc, view, Align::Center);
2607 align_view(doc, view, Align::Center);
@@ -3886,7 +3884,8 @@ fn jump_backward(cx: &mut Context) {
3888fn save_selection(cx: &mut Context) {
3886fn save_selection(cx: &mut Context) {
3889− push_jump(cx.editor);
3887+ let (view, doc) = current!(cx.editor);
3888+ push_jump(view, doc);
3890 cx.editor.set_status("Selection saved to jumplist");
3889 cx.editor.set_status("Selection saved to jumplist");