|
|
@ -257,6 +257,7 @@ impl Command {
|
|
|
|
goto_window_middle, "Goto window middle",
|
|
|
|
goto_window_middle, "Goto window middle",
|
|
|
|
goto_window_bottom, "Goto window bottom",
|
|
|
|
goto_window_bottom, "Goto window bottom",
|
|
|
|
goto_last_accessed_file, "Goto last accessed file",
|
|
|
|
goto_last_accessed_file, "Goto last accessed file",
|
|
|
|
|
|
|
|
goto_last_modification, "Goto last modification",
|
|
|
|
goto_line, "Goto line",
|
|
|
|
goto_line, "Goto line",
|
|
|
|
goto_last_line, "Goto last line",
|
|
|
|
goto_last_line, "Goto last line",
|
|
|
|
goto_first_diag, "Goto first diagnostic",
|
|
|
|
goto_first_diag, "Goto first diagnostic",
|
|
|
@ -3195,6 +3196,19 @@ fn goto_last_accessed_file(cx: &mut Context) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn goto_last_modification(cx: &mut Context) {
|
|
|
|
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
|
|
|
|
let pos = doc.history.get_mut().last_edit_pos();
|
|
|
|
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
|
|
|
|
if let Some(pos) = pos {
|
|
|
|
|
|
|
|
let selection = doc
|
|
|
|
|
|
|
|
.selection(view.id)
|
|
|
|
|
|
|
|
.clone()
|
|
|
|
|
|
|
|
.transform(|range| range.put_cursor(text, pos, doc.mode == Mode::Select));
|
|
|
|
|
|
|
|
doc.set_selection(view.id, selection);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn select_mode(cx: &mut Context) {
|
|
|
|
fn select_mode(cx: &mut Context) {
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let (view, doc) = current!(cx.editor);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|
let text = doc.text().slice(..);
|
|
|
|