Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support first indent level #12

Closed
gbrlsnchs opened this issue Apr 27, 2020 · 9 comments
Closed

Support first indent level #12

gbrlsnchs opened this issue Apr 27, 2020 · 9 comments

Comments

@gbrlsnchs
Copy link

First of all, thanks for this awesome plugin.

It would be nice if this plugin could show an indent guide for the first indent level (just like when g:indentLine_showFirstIndentLevel is truthy in https://github.com/Yggdroot/indentLine). I'm not used with EOL chars, so without them there's a blank space for the first indent level.

The indent guide for the first level can be disabled for files that are indented using spaces, but for ones with tabs, which use listchars, there's no way to remove the first indent level.

@lukas-reineke
Copy link
Owner

I want to support this.

This can't be done with virtual text, because the linebreak counts as a character and you can't display virtual text over characters.

In theory its easy to do with conceal, but there is a bug in Vim that breaks conceal on empty lines. vim/vim#4854
I'll add it as soon as the bug is fixed.

@gbrlsnchs
Copy link
Author

No problem, thanks nonetheless! Actually, I'm kinda linking to use the return char for EOL... so no worries!

@ratheesh
Copy link

vim/vim#4854 which corresponds to vim patch 8.2.1058 is now merged to neovim mainline (sha1: 34291eba80fd2c07cbb3e6310d684e4ac3594fc4)

Can you please implement the indentation line in blank lines when you find the time?

@lukas-reineke
Copy link
Owner

The bug was fixed, but in a way that now does not allow conceal over line endings at all.
https://github.com/vim/vim/blob/fc838d6cb0f22c77a6ee2befd034b593e1c5ea06/src/drawline.c#L1338-L1342

Which means there is still no way to implement this. Sorry.

@lukas-reineke
Copy link
Owner

with the merge of neovim/neovim#13952 this plugin can now handle all the indent lines, blank or not

and as an extra bonus, first level indent is now finally supported as well. It's just on now, not sure if I should add an option to turn it off 🤔

I think we can finally close this issue

@kristijanhusak
Copy link

@lukas-reineke I think it's a good idea to allow disabling first level indent lines.

@akinsho
Copy link

akinsho commented Feb 22, 2021

Yes please that would be good currently I'm seeing indentation markers in completely blank lines.

Screen Shot 2021-02-22 at 17 09 06

@lukas-reineke
Copy link
Owner

👍 I'll add an option

@lukas-reineke
Copy link
Owner

I added g:indent_blankline_show_first_indent_level
And also removed indentation on empty lines that are not part of any indentation, like akinsho's example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants