lkcampbell / brackets-indent-guides

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

Empty lines do not display indent guides #16

Closed lkcampbell closed 10 years ago

lkcampbell commented 10 years ago

OS: Mac OSX Mavericks

Brackets Version: Release 0.44 development build 0.44.0-0 (master 27e6c5abb)

Extension Version: 1.3.1

Repro Steps:

  1. Create a text file that contains blank lines.
  2. Enable the indent guides

Observed Results: gapless-observed

Expected Results (from Sublime Text): gapless-expected

Other Notes: This is by design. Empty lines have no indentation, so they have no indent guides. Regardless, enough people have requested this behavior that I am trying to figure out how to include it as an Extension Preference.

CodeMirror mode overlays have a couple limitations that make these "gapless" indent guides difficult to implement. To start, although there is a way to add styles to empty lines, there are no DOM elements to stylize in the empty line. Also, the tokenizer function in the overlay mode only retains the context of a single line of characters at a time but "gapless" indent guides need to know the indentation level of the line just previous to the current line in order to draw the correct number of guides.

lkcampbell commented 10 years ago

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.