mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-19 18:47:29 -07:00
parent
d5e9f91c7b
commit
93ffcb36de
7
plug.vim
7
plug.vim
@ -2288,7 +2288,12 @@ function! s:preview_commit()
|
|||||||
wincmd P
|
wincmd P
|
||||||
endif
|
endif
|
||||||
setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
|
setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
|
||||||
execute 'silent %!cd' s:shellesc(g:plugs[name].dir) '&& git show --no-color --pretty=medium' sha
|
try
|
||||||
|
let [sh, shrd] = s:chsh(1)
|
||||||
|
execute 'silent %!cd' s:shellesc(g:plugs[name].dir) '&& git show --no-color --pretty=medium' sha
|
||||||
|
finally
|
||||||
|
let [&shell, &shellredir] = [sh, shrd]
|
||||||
|
endtry
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
nnoremap <silent> <buffer> q :q<cr>
|
nnoremap <silent> <buffer> q :q<cr>
|
||||||
wincmd p
|
wincmd p
|
||||||
|
@ -414,6 +414,27 @@ Execute (Test g:plug_pwindow):
|
|||||||
normal q
|
normal q
|
||||||
unlet g:plug_pwindow
|
unlet g:plug_pwindow
|
||||||
|
|
||||||
|
Execute (#572 - Commit preview should work with non-POSIX-compliant &shell):
|
||||||
|
" Invalid shell
|
||||||
|
let shell = &shell
|
||||||
|
set shell=shellfish
|
||||||
|
|
||||||
|
try
|
||||||
|
" Preview commit should still work
|
||||||
|
PlugDiff
|
||||||
|
execute "normal ]]jo"
|
||||||
|
wincmd P
|
||||||
|
Log getline(1, '$')
|
||||||
|
Assert getline(1) =~ 'commit', 'Preview window is empty'
|
||||||
|
AssertEqual 'shellfish', &shell
|
||||||
|
finally
|
||||||
|
" Restore &shell
|
||||||
|
let &shell = shell
|
||||||
|
unlet shell
|
||||||
|
pclose
|
||||||
|
q
|
||||||
|
endtry
|
||||||
|
|
||||||
Execute (Reuse Plug window in another tab):
|
Execute (Reuse Plug window in another tab):
|
||||||
let tabnr = tabpagenr()
|
let tabnr = tabpagenr()
|
||||||
PlugDiff
|
PlugDiff
|
||||||
|
Loading…
Reference in New Issue
Block a user