Home Download Buy Blog Forum Support

Indentation guides don't extend all the way down

Indentation guides don't extend all the way down

Postby bigcakelover on Wed Nov 02, 2011 4:53 pm

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.

Image

Is there a way I could resolve this myself?

Thanks
Last edited by bigcakelover on Wed Nov 02, 2011 8:07 pm, edited 1 time in total.
bigcakelover
 
Posts: 6
Joined: Wed Nov 02, 2011 4:18 pm

Re: Indentation guides don't extend all the way down

Postby C0D312 on Wed Nov 02, 2011 7:18 pm

That is by design...
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Indentation guides don't extend all the way down

Postby bigcakelover on Wed Nov 02, 2011 8:06 pm

C0D312 wrote:That is by design...

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).

Image
bigcakelover
 
Posts: 6
Joined: Wed Nov 02, 2011 4:18 pm

Re: Indentation guides don't extend all the way down

Postby spadgos on Thu Nov 03, 2011 9:18 am

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.

Code: Select all
        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.
spadgos
 
Posts: 121
Joined: Thu Oct 06, 2011 12:49 am

Re: Indentation guides don't extend all the way down

Postby bigcakelover on Fri Nov 04, 2011 4:22 am

spadgos wrote: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.

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
bigcakelover
 
Posts: 6
Joined: Wed Nov 02, 2011 4:18 pm

Re: Indentation guides don't extend all the way down

Postby olivierlacan on Fri Jan 06, 2012 4:58 pm

This is definitely something that should be toggled. There are many languages, even without curly braces, that could benefits from having nesting indicators lower.
olivierlacan
 
Posts: 4
Joined: Thu Nov 03, 2011 1:07 pm


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot] and 17 guests