From 1825d56ea8d73a3dd9a907ce4b5db096c745e807 Mon Sep 17 00:00:00 2001 From: Yggdroot Date: Tue, 3 Mar 2020 09:36:13 +0800 Subject: [PATCH] fix issue #293 No such group or event: OptionSet diff call s:ToggleOnDiff() --- after/plugin/indentLine.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 523b88f..03ef81a 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -391,7 +391,9 @@ augroup indentLine endif autocmd BufWinEnter * call s:IndentLinesDisable() | call s:LeadingSpaceDisable() | call s:Setup() autocmd FileType * call s:Disable() - autocmd OptionSet diff call s:ToggleOnDiff() + if exists("##OptionSet") + autocmd OptionSet diff call s:ToggleOnDiff() + endif autocmd VimEnter * noautocmd windo call s:DisableOnDiff() else autocmd BufWinEnter * call s:Setup() @@ -401,7 +403,9 @@ augroup indentLine autocmd BufUnload * let b:indentLine_enabled = 0 | let b:indentLine_leadingSpaceEnabled = 0 autocmd SourcePre $VIMRUNTIME/syntax/nosyntax.vim doautocmd indentLine BufUnload autocmd FileChangedShellPost * doautocmd indentLine BufUnload | call s:Setup() - autocmd OptionSet diff call s:ToggleOnDiff() + if exists("##OptionSet") + autocmd OptionSet diff call s:ToggleOnDiff() + endif autocmd VimEnter * noautocmd windo call s:DisableOnDiff() endif augroup END