@@ -254,9 +254,10 @@ impl Command {
254
254
goto_file_end, "Goto file end" ,
255
255
goto_reference, "Goto references" ,
256
256
goto_window_top, "Goto window top" ,
257
- goto_window_middle , "Goto window middle " ,
257
+ goto_window_center , "Goto window center " ,
258
258
goto_window_bottom, "Goto window bottom" ,
259
259
goto_last_accessed_file, "Goto last accessed file" ,
260
+ goto_last_modified_file, "Goto last modified file" ,
260
261
goto_line, "Goto line" ,
261
262
goto_last_line, "Goto last line" ,
262
263
goto_first_diag, "Goto first diagnostic" ,
@@ -610,7 +611,7 @@ fn goto_window_top(cx: &mut Context) {
610
611
goto_window ( cx, Align :: Top )
611
612
}
612
613
613
- fn goto_window_middle ( cx : & mut Context ) {
614
+ fn goto_window_center ( cx : & mut Context ) {
614
615
goto_window ( cx, Align :: Center )
615
616
}
616
617
@@ -3195,6 +3196,20 @@ fn goto_last_accessed_file(cx: &mut Context) {
3195
3196
}
3196
3197
}
3197
3198
3199
+ fn goto_last_modified_file ( cx : & mut Context ) {
3200
+ let view = view ! ( cx. editor) ;
3201
+ let alternate_file = view
3202
+ . last_modified_docs
3203
+ . into_iter ( )
3204
+ . flatten ( )
3205
+ . find ( |& id| id != view. doc ) ;
3206
+ if let Some ( alt) = alternate_file {
3207
+ cx. editor . switch ( alt, Action :: Replace ) ;
3208
+ } else {
3209
+ cx. editor . set_error ( "no last modified buffer" . to_owned ( ) )
3210
+ }
3211
+ }
3212
+
3198
3213
fn select_mode ( cx : & mut Context ) {
3199
3214
let ( view, doc) = current ! ( cx. editor) ;
3200
3215
let text = doc. text ( ) . slice ( ..) ;
0 commit comments