From 0e40dbd6cd88228127eaec0e50290236bf573644 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 8 Dec 2023 22:08:41 +0100 Subject: diff-corrections: Apply diff corrections on BufEnter Ensure that diff corrections are applied in a `vimdiff` context, where we haven't run `:diffthis` manually. --- bundle/diff-corrections/plugin/diff_corrections.vim | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bundle') 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 -- cgit v1.2.3