Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Spacing and highlight-based indentLine #361

Open
savchenko opened this issue Aug 24, 2021 · 2 comments
Open

Spacing and highlight-based indentLine #361

savchenko opened this issue Aug 24, 2021 · 2 comments

Comments

@savchenko
Copy link

Consider the following example:

image

  1. First indent from the left is expected.
  2. Second might be desirable by some.
  3. All others are redundant.

Is it possible to avoid drawing indents if:

  1. Spacing between lines if less than N.
  2. The rest of the line has Comment highlight-group applied to it.

Both options can be independent from each other.

@Yggdroot
Copy link
Owner

g:indentLine_indentLevel *g:indentLine_indentLevel*
Specify how much indent level do you want to use for
indentLine. Most program will not has bigger indent level than
10.
Default value is 10.

@savchenko
Copy link
Author

@Yggdroot , I've read the doc and tried the proposed parameter, but don't see how it is applicable here.

g:indentLine_indentLevel allows to limit number of indent lines drawn counting from the leftmost one.

Consider this valid case where everything is looking well:

image

And now with the different comment style:

image

If I would limit g:indentLine_indentLevel to 3, things will look better for this specific section only:

image

But what about rest of the code? Say we introduce a nested_var:

image

This illustrates why allowing to limit by the spacing between the lines is useful.
Additional check "if line contains only spaces and Comment highlight group" will help as well.

Makes sense? :)

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

No branches or pull requests

2 participants