aboutsummaryrefslogtreecommitdiffstats
path: root/bundle
diff options
context:
space:
mode:
authorTeddy Wing2019-06-08 00:20:54 +0200
committerTeddy Wing2019-06-08 00:20:54 +0200
commit1f7b977e7568d0759131c5f91459661f3e030691 (patch)
tree361fc35b8ef51906aeb2a2f5ce9bfebc084055ac /bundle
parentd5efa59a2aab4d07e6ad16b510bee3077db64bf4 (diff)
downloaddotvim-1f7b977e7568d0759131c5f91459661f3e030691.tar.bz2
diff_corrections: Use better autocmds
Thanks to Christian Brabandt (https://vi.stackexchange.com/users/71/christian-brabandt) for describing better autocmds for detecting diff mode: https://vi.stackexchange.com/questions/12847/automatically-disable-cursorline-when-in-diff-mode/12852#12852 And for making the patch (https://github.com/vim/vim/commit/04f62f881c5743d2fdaf7324f6a715381f0d5fcf) that allows diff mode to be detected with the OptionSet event.
Diffstat (limited to 'bundle')
-rw-r--r--bundle/diff-corrections/plugin/diff_corrections.vim7
1 files changed, 6 insertions, 1 deletions
diff --git a/bundle/diff-corrections/plugin/diff_corrections.vim b/bundle/diff-corrections/plugin/diff_corrections.vim
index 2cf3abf..393d0f4 100644
--- a/bundle/diff-corrections/plugin/diff_corrections.vim
+++ b/bundle/diff-corrections/plugin/diff_corrections.vim
@@ -7,7 +7,12 @@ let g:loaded_diff_corrections = 1
augroup diff_corrections
autocmd!
- autocmd BufEnter * call diff_corrections#Run()
+ " 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()
+ else
+ autocmd BufEnter,FilterWritePost * call diff_corrections#Run()
+ endif
augroup END