Yggdroot / indentLine

A vim plugin to display the indention levels with thin vertical lines
MIT License
4.13k stars 227 forks source link

indentLine should not override conceallevel/concealcurson for exclusions #372

Open rcasta74 opened 2 years ago

rcasta74 commented 2 years ago

When the plugin is disabled with g:indentLine_enabled=0, conceallevel and concealcurson values are not changed, while using g:indentLine_fileTypeExclude or g:indentLine_bufTypeExclude to disable it only for some buffers, conceallevel and concealcurson values are changed by the plugin. I have used gina.vim for test; when using this plugin by its own, running the command :Gina log opens a new buffer with

  filetype=gina-log
  buftype=nofile

and the conceallevel and concealcurson values are set in this way:

  concealcursor=nvic
        Last set from ~/.vim/autoload/vital/_gina/Vim/Buffer/ANSI.vim line 72
  conceallevel=3
        Last set from ~/.vim/autoload/vital/_gina/Vim/Buffer/ANSI.vim line 72

Using it together with indentLine plugin, runing the command :Gina log, the conceallevel and concealcurson values are set in this way:

  concealcursor=inc
        Last set from ~/.vim/after/plugin/indentLine.vim line 104
  conceallevel=2
        Last set from ~/.vim/after/plugin/indentLine.vim line 105

so the values are overriden by the plugin as expected. If I disable the plugin with let g:indentLine_enabled=0, I get:

  concealcursor=nvic
        Last set from ~/.vim/autoload/vital/_gina/Vim/Buffer/ANSI.vim line 72
  conceallevel=3
        Last set from ~/.vim/autoload/vital/_gina/Vim/Buffer/ANSI.vim line 72

so the value are no more overriden. If I try to disable the plugin for only gina-log with let g:indentLine_fileTypeExclude=['gina-log'] or with let g:indentLine_bufTypeExclude=['nofile'] I get instead:

  concealcursor=inc
        Last set from ~/.vim/after/plugin/indentLine.vim line 113
  conceallevel=2
        Last set from ~/.vim/after/plugin/indentLine.vim line 116

I would expect that with g:indentLine_fileTypeExclude and g:indentLine_bufTypeExclude the plugin behave in the same way as g:indentLine_enabled=0 but only for specific buffers.