Skip to content
This repository was archived by the owner on Jul 29, 2023. It is now read-only.

Commit af91253

Browse files
committed
Fix indent lines after using ownsyntax
Vim resets the syntax highlighting when the 'ownsyntax' command is used. This also triggers a new Syntax event, but indentLine did not reapply its syntax rules because indentLine_enabled is still set. Now we explicitly unset indentLine_enabled and call Setup again to ensure everything is working again.
1 parent 942fea0 commit af91253

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

after/plugin/indentLine.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@ augroup indentLine
204204
\ call <SID>Setup() |
205205
\ endif
206206

207-
autocmd BufRead,BufNewFile,ColorScheme,Syntax * call <SID>InitColor()
207+
autocmd BufRead,BufNewFile,ColorScheme * call <SID>InitColor()
208208
autocmd BufUnload * let b:indentLine_enabled = 0 | let b:indentLine_leadingSpaceEnabled = 0
209209
autocmd SourcePre $VIMRUNTIME/syntax/nosyntax.vim doautocmd indentLine BufUnload
210210
autocmd FileChangedShellPost * doautocmd indentLine BufUnload | call <SID>Setup()
211+
autocmd Syntax * doautocmd indentLine BufUnload | call <SID>Setup()
211212
augroup END
212213

213214
"{{{1 commands

0 commit comments

Comments
 (0)