Sublime Forum

Indentation guides don't extend all the way down

#1

I’ve noticed that the line indentation guides don’t extend all the way down to the bottom of their respective code blocks if there are blank lines at the bottom of those blocks.

Here’s an image. See the last lines are missing the dots of the guides?

EDIT: This happens even if there are tabs or spaces on the “empty” last line. The lines in the screenshot below are indented with tabs.

Is there a way I could resolve this myself?

Thanks

0 Likes

Line Indent Guides Not Extending To Full Block
#2

That is by design…

0 Likes

#3

Why would you want the indentation guide to stop before the end of the code block? That doesn’t make sense.

The only situation I could see that making sense would be if there are no characters on the last line.

However, even if you insert a tab or spaces on to the otherwise empty last line, the indentation guide still does not show.

This is in contrast to the behaviour seen in, for example, Notepad2.exe, whose indentation guides extend all the way to the bottom as long as there is some content on the line (such as a tab character).

I suspect Sublime only renders an indentation guide on last lines with visible characters, but there must be a way of making it render if the line has a tab or a space character.

See a comparison of Notepad2 and Sublime for what I mean. It makes sense for me for the guide to extend all the way down the entire block of code (all the way to the block’s closing brace).

0 Likes

#4

Just talking off the top of my head, but perhaps it’s an issue for languages which don’t use brackets for blocks, eg: python.

        if not isClass:
            if not re.match('$_]?(?:set|add)[A-Z_]', name):
                retType = '[type]'
                if re.match('$_]?(?:is|has)[A-Z_]', name):
                    retType = 'Boolean'
                out.append("@return {${%d:%s}}" % (tabIndex.next(), retType))

        return out

That second last, empty line isn’t really part of the initial if-statement.

0 Likes

#5

Ah, of course!

So is there a way this could be modified so the user can choose between the default “guides until empty line” or a new “guides all the way down” mode? Even point me in the right direction if I can modify this myself somehow.

Thanks

0 Likes

#6

This is definitely something that should be toggled. There are many languages, even without curly braces, that could benefits from having nesting indicators lower.

0 Likes