mirror of
https://github.com/Yggdroot/indentLine.git
synced 2025-12-06 20:24:28 +08:00
Fix indendLine doesn't work with 'syntax' option change
This commit is contained in:
@@ -157,6 +157,11 @@ function! s:Setup()
|
||||
call s:InitColor()
|
||||
endif
|
||||
|
||||
call s:EnableFeature()
|
||||
endfunction
|
||||
|
||||
"{{{1 function! s:EnableFeature()
|
||||
function! s:EnableFeature() abort
|
||||
if g:indentLine_enabled
|
||||
call s:IndentLinesEnable()
|
||||
endif
|
||||
@@ -199,7 +204,8 @@ endfunction
|
||||
augroup indentLine
|
||||
autocmd!
|
||||
autocmd BufWinEnter * call <SID>Setup()
|
||||
autocmd BufRead,BufNewFile,ColorScheme,Syntax * call <SID>InitColor()
|
||||
autocmd Syntax * unlet! b:indentLine_enabled | call <SID>EnableFeature()
|
||||
autocmd BufRead,BufNewFile,ColorScheme * call <SID>InitColor()
|
||||
autocmd BufUnload * unlet! b:indentLine_enabled
|
||||
augroup END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user