From af91253d7147ece97caf4c0ee4810f93e82c01b2 Mon Sep 17 00:00:00 2001 From: Alexander Buddenbrock Date: Wed, 19 Apr 2017 17:58:29 +0200 Subject: [PATCH 1/4] 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. --- after/plugin/indentLine.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 0ff965e..3a6e9e4 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -204,10 +204,11 @@ augroup indentLine \ call Setup() | \ endif - autocmd BufRead,BufNewFile,ColorScheme,Syntax * call InitColor() + autocmd BufRead,BufNewFile,ColorScheme * call InitColor() 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 Syntax * doautocmd indentLine BufUnload | call Setup() augroup END "{{{1 commands From 273ad7b93fb2e1cf516d6d54eb0feb8c92a9c2af Mon Sep 17 00:00:00 2001 From: Augusto Melo Date: Wed, 19 Apr 2017 23:12:42 -0300 Subject: [PATCH 2/4] Fixed set conceal options (#186) * Fixed set conceal options This change was necessary because the let &l:concealcursor and &l:conceallevel when set locally will set it to the entire window (vim documentation), so it need to be reset every time the buffer changes. * Re-added BufWinEnter BufEnter runs before processing the modeline, so to process the modelines as well the BufWinEnter is necessary. --- after/plugin/indentLine.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 3a6e9e4..5af4525 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -139,6 +139,8 @@ endfunction "{{{1 function! s:Setup() function! s:Setup() if index(g:indentLine_fileTypeExclude, &filetype) isnot -1 + let &l:concealcursor = "" + let &l:conceallevel = "0" return endif @@ -198,7 +200,7 @@ endfunction "{{{1 augroup indentLine augroup indentLine autocmd! - autocmd BufWinEnter * call Setup() + autocmd BufWinEnter,BufEnter * call Setup() autocmd User * if exists("b:indentLine_enabled") && b:indentLine_enabled || \ exists("b:indentLine_leadingSpaceEnabled") && b:indentLine_leadingSpaceEnabled | \ call Setup() | From 0587c56835ae106edeffbeec6a63e8f5b1b68d2c Mon Sep 17 00:00:00 2001 From: Yggdroot Date: Wed, 26 Apr 2017 16:25:57 +0800 Subject: [PATCH 3/4] Revert "Fixed set conceal options (#186)" This reverts commit 273ad7b93fb2e1cf516d6d54eb0feb8c92a9c2af. --- after/plugin/indentLine.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/after/plugin/indentLine.vim b/after/plugin/indentLine.vim index 5af4525..3a6e9e4 100644 --- a/after/plugin/indentLine.vim +++ b/after/plugin/indentLine.vim @@ -139,8 +139,6 @@ endfunction "{{{1 function! s:Setup() function! s:Setup() if index(g:indentLine_fileTypeExclude, &filetype) isnot -1 - let &l:concealcursor = "" - let &l:conceallevel = "0" return endif @@ -200,7 +198,7 @@ endfunction "{{{1 augroup indentLine augroup indentLine autocmd! - autocmd BufWinEnter,BufEnter * call Setup() + autocmd BufWinEnter * call Setup() autocmd User * if exists("b:indentLine_enabled") && b:indentLine_enabled || \ exists("b:indentLine_leadingSpaceEnabled") && b:indentLine_leadingSpaceEnabled | \ call Setup() | From cc9f3184bd2f367667d6df685b691d9c50aa7746 Mon Sep 17 00:00:00 2001 From: Jonne Ransijn Date: Sun, 30 Apr 2017 02:01:53 +0200 Subject: [PATCH 4/4] In accordance with #179 Would close #179 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33c5f0c..3bd4d2c 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ See the [VIM Reference Manual](http://vimdoc.sourceforge.net/htmldoc/version7.ht **Disable by default** ``` -let g:indentLine_enabled = 0 +let g:indentLine_loaded = 1 ``` ### Commands