diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index fa9e7cc..8a838e0 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -118,13 +118,16 @@ function! s:ResetConcealOption() endif endfunction +function! s:CheckDiff() + if &diff + call s:IndentLinesDisable() + call s:LeadingSpaceDisable() + endif +endfunction + "{{{1 function! s:IndentLinesEnable() function! s:IndentLinesEnable() if g:indentLine_newVersion - if &diff - return - endif - if exists("b:indentLine_enabled") && b:indentLine_enabled == 0 return endif @@ -293,10 +296,6 @@ endfunction "{{{1 function! s:LeadingSpaceEnable() function! s:LeadingSpaceEnable() if g:indentLine_newVersion - if &diff - return - endif - if exists("b:indentLine_leadingSpaceEnabled") && b:indentLine_leadingSpaceEnabled == 0 return endif @@ -380,6 +379,8 @@ augroup indentLine endif autocmd BufWinEnter * call IndentLinesDisable() | call LeadingSpaceDisable() | call Setup() autocmd FileType * call Disable() + autocmd OptionSet diff call IndentLinesDisable() | call s:LeadingSpaceDisable() + autocmd VimEnter * noautocmd windo call s:CheckDiff() else autocmd BufWinEnter * call Setup() autocmd User * if exists("b:indentLine_enabled") || exists("b:indentLine_leadingSpaceEnabled") | @@ -388,6 +389,8 @@ 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 Setup() + autocmd OptionSet diff call IndentLinesDisable() | call s:LeadingSpaceDisable() + autocmd VimEnter * noautocmd windo call s:CheckDiff() endif augroup END