From d8ff20204e052b3ae29314bb13b8ec02d8c2debb Mon Sep 17 00:00:00 2001 From: Fernando Ramos Date: Mon, 26 Dec 2022 17:18:25 +0100 Subject: [PATCH] Set a buffer variable to signal we are in diff mode --- plugin/dirdiff.vim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugin/dirdiff.vim b/plugin/dirdiff.vim index 2389f7a..dc603e0 100644 --- a/plugin/dirdiff.vim +++ b/plugin/dirdiff.vim @@ -234,6 +234,7 @@ function! 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 @@ -530,17 +531,20 @@ function! DirDiffOpen() if s:LastMode == 2 call Drop(previousFileA) silent exec "edit ".s:FilenameA + let b:dirdiff = 1 diffthis silent exec "bd ".bufnr(previousFileA) call 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 Drop(previousFile) silent exec "edit ".s:FilenameB + let b:dirdiff = 1 silent exec "bd ".bufnr(previousFile) diffthis @@ -550,9 +554,11 @@ function! 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