Skip to content

Commit

Permalink
FIX: Use correct diffed windows on :VCSVimDiff
Browse files Browse the repository at this point in the history
Depending on the window layout (i.e. any other existing windows) and the split mode for :VCSVimDiff, :wincmd w/W may not go to the right second diff partner. Use :wincmd p (previous window) instead; this ensures that the right window is used.
  • Loading branch information
inkarkat committed May 4, 2015
1 parent c0d2701 commit f300f84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/vcscommand.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,7 @@ function! s:VCSVimDiff(...)

" This could have been invoked on a VCS result buffer, not the
" original buffer.
wincmd W
wincmd p
execute 'buffer' originalBuffer
" Store info for later original buffer restore
let t:vcsCommandVimDiffRestoreCmd =
Expand All @@ -1076,7 +1076,7 @@ function! s:VCSVimDiff(...)
endif
let t:vcsCommandVimDiffRestoreCmd .= '|if &foldmethod==''manual''|execute ''normal! zE''|endif'
diffthis
wincmd w
wincmd p
else
" Adding a window to an existing vimdiff
let t:vcsCommandVimDiffScratchList += [resultBuffer]
Expand Down

0 comments on commit f300f84

Please sign in to comment.