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

cd to repo root when in preview window on preview commit

Andrea Cedraro 11 лет назад
Родитель
Сommit
a868ee4c11
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      plug.vim

+ 5 - 5
plug.vim

@@ -1176,14 +1176,14 @@ function! s:preview_commit()
     return
   endif
 
-  execute 'cd '.s:esc(g:plugs[name].dir)
-  execute 'pedit '.sha
+  execute 'pedit' sha
   wincmd P
   setlocal filetype=git buftype=nofile nobuflisted
-  execute 'silent read !git show '.sha
-  normal! ggdd
-  wincmd p
+  execute 'cd' s:esc(g:plugs[name].dir)
+  execute 'silent read !git show' sha
   cd -
+  normal! gg"_dd
+  wincmd p
 endfunction
 
 function! s:section(flags)