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

Merge pull request #60 from justfalter/fix-last-tab-syntax

Backward-compatible fix for invalid tab range bug
jlanzarotta 8 лет назад
Родитель
Сommit
e57b6ded06
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      plugin/bufexplorer.vim

+ 6 - 1
plugin/bufexplorer.vim

@@ -826,7 +826,12 @@ function! s:SelectBuffer(...)
             " Was the tab found?
             if tabNbr == 0
                 " _bufNbr is not opened in any tabs. Open a new tab with the selected buffer in it.
-                execute "999tab split +buffer" . _bufNbr
+                if v:version > 704 || ( v:version == 704 && has('patch2237') )
+                  " new syntax for last tab as of 7.4.2237
+                  execute "$tab split +buffer" . _bufNbr
+                else
+                  execute "999tab split +buffer" . _bufNbr
+                endif
                 " Workaround for the issue mentioned in UpdateTabBufData
                 call s:UpdateTabBufData(_bufNbr)
             else