lkcampbell / brackets-indent-guides

A Brackets extension to show indent guides in the code editor
149 stars 34 forks source link

Show only one indent guide in hanging indent. #11

Closed tomek-he-him closed 10 years ago

tomek-he-him commented 10 years ago

This is a feature suggestion.

A picture is worth a thousand words. What we have at the moment: image

Looks prettier: image

We could detect whether the next line is a hanging indent by checking the number of indent tabs compared to the previous line. If the difference is more than +1 tab, this is a hanging indent – we can show only one guide.

lkcampbell commented 10 years ago

I can investigate making it an extension preference.

tomek-he-him commented 10 years ago

Thank you very much :)

lkcampbell commented 10 years ago

@tomekwi, I played with this a bit this week. I haven't been able to figure out how to grab the previous line indentation from within the CodeMirror overlay tokenizer. It doesn't have a good way to grab information outside of the context of the current line it is parsing. I posted a question on it at:

https://groups.google.com/forum/#!topic/codemirror/tqukojpq_8g

Let's see what they say.

lkcampbell commented 10 years ago

@tomekwi, I am closing this issue as a code challenge. It is a new issue category I created for issues and enhancements that I have unsuccessfully attempted to solve.

What this means is I am stuck and I am asking for help from the community. A link to this issue will go into the extension README.md file so that others can find it and offer ideas and solutions as well. I think this is a better solution than just leaving the issue open forever or closing it as wont fix.

If, at any point in the future, a good solution emerges, I will reopen and add this enhancement.

tomek-he-him commented 10 years ago

Thanks for taking your time, anyway.