@@ -257,6 +257,7 @@ impl Command {
257257 goto_window_middle, "Goto window middle",
258258 goto_window_bottom, "Goto window bottom",
259259 goto_last_accessed_file, "Goto last accessed file",
260+ goto_last_modification, "Goto last modification",
260261 goto_line, "Goto line",
261262 goto_last_line, "Goto last line",
262263 goto_first_diag, "Goto first diagnostic",
@@ -3195,6 +3196,19 @@ fn goto_last_accessed_file(cx: &mut Context) {
31953196 }
31963197}
31973198
3199+fn goto_last_modification(cx: &mut Context) {
3200+ let (view, doc) = current!(cx.editor);
3201+ let pos = doc.history.get_mut().last_edit_pos();
3202+ let text = doc.text().slice(..);
3203+ if let Some(pos) = pos {
3204+ let selection = doc
3205+ .selection(view.id)
3206+ .clone()
3207+ .transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
3208+ doc.set_selection(view.id, selection);
3209+ }
3210+}
3211+
31983212fn select_mode(cx: &mut Context) {
31993213 let (view, doc) = current!(cx.editor);
32003214 let text = doc.text().slice(..);