Yggdroot / indentLine

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

indentLine not working within folds #340

Open neeerp opened 3 years ago

neeerp commented 3 years ago

I was having trouble getting the plugin working. I noticed that if I made a bunch of spaces in a new line in any file, I'd get indent guides, however spaces that were automatically created (e.g. auto indenting in a scope) was not working.

After commenting out various parts of my init.vim in/out, my issue turned out to be related to the foldmethod setting. I had it set to foldmethod=syntax, and this would cause indentLine to stop working properly (even though I had foldlevel=99 forcing my folds open by default, indentLine would still break).

From the looks of it, it looks like folds aren't compatible with indentLine (at least with the current nightly version of nvim)... I disabled all of my configs beside foldmethod=syntax and indentLine (no other plugins being loaded) and still encounter the problem. I managed to get indentLine to work by setting foldmethod=manual (which is the default setting), however creating any folds manually would also cause indentLine to not work within the fold.

For anyone reading this and applying my fix, make sure you're clearing your views folder to get rid of any saved folds if you are using views.

Originally posted by @neeerp in https://github.com/Yggdroot/indentLine/issues/59#issuecomment-753668386