From a868ee4c1121aed4e486c4a1945f036b1d247307 Mon Sep 17 00:00:00 2001 From: Andrea Cedraro Date: Tue, 2 Sep 2014 22:35:12 +0200 Subject: [PATCH] cd to repo root when in preview window on preview commit --- plug.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plug.vim b/plug.vim index 9fedcd8..eb15ead 100644 --- a/plug.vim +++ b/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)