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

Do not guide indentions below length x #72

Open
ghost opened this issue Apr 24, 2014 · 4 comments
Open

Do not guide indentions below length x #72

ghost opened this issue Apr 24, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 24, 2014

Sometimes I have code that is just a few lines long so it would be nice to have the option to set a minimal indention-length.

E.g.:

class ClassExample
  def example
    return 0
  end
  def example2
    puts ex
    puts 0
    puts test
  end
end

example and example2 are extremely short an guided indentions don't look nice - also they're distracting.

This may looks similar to Issue #39, but it isn't - though that would be nice too.

@NewAlexandria
Copy link

You mean this isn't just using this setting?

let g:indent_guides_start_level = 3

@ghost
Copy link
Author

ghost commented Apr 24, 2014

No, that setting would define that guiding starts at the third tab (sticking to your example).
I'll make my point clearer:

Think of the dashes as the highlighning:

class ClassExample
- def example
- - return 0
- end
- def example2
- - puts ex
- - puts 0
- - puts test
- end
- def example3
- - puts some more
- - puts 1+1
- - puts some
- - puts some
- - puts some
- - puts some
- end
end

This is how it looks like currently, but I suggested a setting, e.g.
g:indent_guides_start_minlines =
If we set this to 5 it would look like this:

class ClassExample
- def example
-   return 0
- end
- def example2
-   puts ex
-   puts 0
-   puts test
- end
- def example3
- - puts some more
- - puts 1+1
- - puts some
- - puts some
- - puts some
- - puts some
- end
end

Since the number of lines to be highlighted have to more or equal to 5 - example and example2 don't meet this requirement, example3 (since it is six lines long) does and thus get's guided.

@NewAlexandria
Copy link

oh. That's more clear. and somewhat interesting.

My first thought is to be against it because it's inconsistent.

If you want to make the change, I cannot recommend much with my vimscript-fu at this time. The change you want (count lines, act after some init var number of lines) probably goes here

@spikegrobstein
Copy link

I'd love this feature, personally, but would have it set to a value of 2 for myself. more than 2 lines, I'd want hilighted.

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

2 participants