Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a buffer variable to signal we are in diff mode #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plugin/dirdiff.vim
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ function! <SID>DirDiff(srcA, srcB)
return
endif
silent exe "edit ".s:FilenameDiffWindow
let b:dirdiff = 1
echo "Defining [A] and [B] ... "
" We then do a substitution on the directory path
" We need to do substitution of the the LONGER string first, otherwise
Expand Down Expand Up @@ -530,17 +531,20 @@ function! <SID>DirDiffOpen()
if s:LastMode == 2
call <SID>Drop(previousFileA)
silent exec "edit ".s:FilenameA
let b:dirdiff = 1
diffthis
silent exec "bd ".bufnr(previousFileA)

call <SID>Drop(previousFileB)
silent exec "edit ".s:FilenameB
let b:dirdiff = 1
diffthis
silent exec "bd ".bufnr(previousFileB)
else
let previousFile = (s:LastMode == "A") ? previousFileA : previousFileB
call <SID>Drop(previousFile)
silent exec "edit ".s:FilenameB
let b:dirdiff = 1
silent exec "bd ".bufnr(previousFile)
diffthis

Expand All @@ -550,9 +554,11 @@ function! <SID>DirDiffOpen()
else
"Open the diff windows
silent exec "split ".s:FilenameB
let b:dirdiff = 1

" To ensure that A is on the left and B on the right, splitright must be off
silent exec "leftabove vert diffsplit ".s:FilenameA
let b:dirdiff = 1
endif

" Go back to the diff window
Expand Down