aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2023-12-08 22:08:41 +0100
committerTeddy Wing2023-12-09 00:20:40 +0100
commit0e40dbd6cd88228127eaec0e50290236bf573644 (patch)
tree5da9ac8c9b1610a57d6a120ad3b700eebaee04ee
parentd30df22ff2c949d4b6445b0f4a091d8005301656 (diff)
downloaddotvim-0e40dbd6cd88228127eaec0e50290236bf573644.tar.bz2
diff-corrections: Apply diff corrections on BufEnter
Ensure that diff corrections are applied in a `vimdiff` context, where we haven't run `:diffthis` manually.
-rw-r--r--bundle/diff-corrections/plugin/diff_corrections.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/bundle/diff-corrections/plugin/diff_corrections.vim b/bundle/diff-corrections/plugin/diff_corrections.vim
index 393d0f4..410a55b 100644
--- a/bundle/diff-corrections/plugin/diff_corrections.vim
+++ b/bundle/diff-corrections/plugin/diff_corrections.vim
@@ -10,6 +10,11 @@ augroup diff_corrections
" https://vi.stackexchange.com/questions/12847/automatically-disable-cursorline-when-in-diff-mode/12852#12852
if has('patch-8.0.0736')
autocmd OptionSet diff call diff_corrections#Run()
+
+ " OptionSet only catches cases where we explicitly enter diff mode.
+ " This covers cases where the buffer is already in diff mode, as from
+ " vimdiff.
+ autocmd BufEnter * call diff_corrections#Run()
else
autocmd BufEnter,FilterWritePost * call diff_corrections#Run()
endif