Просмотр исходного кода

Merge pull request #34 from anishsane/master

Reuse the current tab if it contains a single new unmodified file.
Yegappan Lakshmanan 5 лет назад
Родитель
Сommit
dde423c562
1 измененных файлов с 7 добавлено и 3 удалено
  1. 7 3
      plugin/mru.vim

+ 7 - 3
plugin/mru.vim

@@ -316,9 +316,13 @@ func! s:MRU_Open_File_In_Tab(fname, esc_fname) abort
 	    " Goto the tab containing the file
 	    exe 'tabnext ' . i
 	else
-	    " Open a new tab as the last tab page
-	    tablast
-	    exe 'tabnew ' . a:esc_fname
+        if (winnr("$") == 1) && (bufname("") == "") && !&modified
+            exe 'e ' . a:esc_fname
+        else
+            " Open a new tab as the last tab page
+            tablast
+            exe 'tabnew ' . a:esc_fname
+        endif
 	endif
     endif