indent-blankline.nvim
indent-blankline.nvim copied to clipboard
Support irregular indentation
When using indent guides for Haskell code -- see the image.
The only non-default settings here are g:indent_blankline_char
, g:indent_blankline_buftype_exclude
and g:indent_blankline_show_trailing_blankline_indent = v:false
.
I believe this happens because this plugin simply places an indentation guide every &shiftwidth
columns. But, as the image shows, this is not enough for typical Haskell indentation, since it can start at basically any column.
Perhaps we could look into placing the indent guide on the first non-whitespace column above? Or maybe somehow use tree-sitter to try to solve this? (note: using g:indent_blankline_use_treesitter = 1
didn't solve this, as I understand all it does is highlight the current indentation level).
Originally posted by @dccsillag in https://github.com/lukas-reineke/indent-blankline.nvim/issues/153#issuecomment-893943554
I made this a new issue.
It's an interesting problem. I believe it could be solvable, but it's not easy.
Maybe it's worth documenting another instance of this problem (again exemplified in Haskell code): multiple indent guides where there should only be one.
do you have examples from other editors how it should look like?
I have an idea in my head on how it should look like, but I feel like I've also seen some editor out there do it properly. I'll look for it.
Update: Just found https://github.com/DarthFennec/highlight-indent-guides, which implements this stuff in Emacs, and looks correct (for Lisp code, which suffers from the same issues as Haskell).
Obviously, show current context indent works well, could fully use treesitter implement all feature of this plugin?
Are there any plans to implement this feature?
It is on the list of things I want to do in the next version. But I have much less time these days, I don't know when I'll work on it.
Supported in version 3