Home Download Buy Blog Forum Support

Dev Build 2105

Do you think indent guides should be enabled by default?

Yes
39
75%
No
13
25%
 
Total votes : 52

Re: Dev Build 2105

Postby digiduck on Thu Aug 25, 2011 6:55 pm

aparajita wrote:If you took a vote I'll bet most people would want better highlighting of matching pairs than indent guides.

Gotta admit that I agree with this. The simple underlining takes quite a bit of focus to find right now. Definitely not something you can passively acknowledge.
digiduck
 
Posts: 19
Joined: Mon Aug 08, 2011 1:27 pm

Re: Dev Build 2105

Postby digiduck on Thu Aug 25, 2011 6:55 pm

oats wrote:An annoyance with recent versions: when I hit ctrl-F to "Find", the find panel is toggled up or down. I would rather ctrl-F always brings the find panel to the front. If I want to dismiss the find panel, ESC always works, and that's what I usually do. (It's a handy key that dismisses whatever panel, not just find.)

+1
digiduck
 
Posts: 19
Joined: Mon Aug 08, 2011 1:27 pm

Re: Dev Build 2105

Postby Anomareh on Thu Aug 25, 2011 7:54 pm

ajpalkovic wrote:Additionally, as some people point out the active one shows up one tab higher than where they should. My screenshot shows that too.
I'm torn on this. On the one hand, I think it's smart to do that for normal statements. However, for lines that are indented, (like for loops, html tags) I hate it. Maybe you could use the grammar indent rules to determine if it should show the active guide one column higher or at the current column, if that makes sense. Like, if the indent rules say dont indent this line, then do what sublime does now. If the indent rules say indent the next line. then show the active guide at the beginning of the text, like the beginning of the for loop, not two spaces before the for loop.

Kinda hard to parse what you mean :s Maybe a picture? I think the expected behavior would be to check the character to the right of the guide, if it's whitespace or the end of the line show it, if it's anything else don't. Being able to see where lines that contain nothing but whitespace are indented to is really important, especially in languages like Python.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Dev Build 2105

Postby ajpalkovic on Thu Aug 25, 2011 8:04 pm

Anomareh wrote:
ajpalkovic wrote:Additionally, as some people point out the active one shows up one tab higher than where they should. My screenshot shows that too.
I'm torn on this. On the one hand, I think it's smart to do that for normal statements. However, for lines that are indented, (like for loops, html tags) I hate it. Maybe you could use the grammar indent rules to determine if it should show the active guide one column higher or at the current column, if that makes sense. Like, if the indent rules say dont indent this line, then do what sublime does now. If the indent rules say indent the next line. then show the active guide at the beginning of the text, like the beginning of the for loop, not two spaces before the for loop.

Kinda hard to parse what you mean :s Maybe a picture? I think the expected behavior would be to check the character to the right of the guide, if it's whitespace or the end of the line show it, if it's anything else don't. Being able to see where lines that contain nothing but whitespace are indented to is really important, especially in languages like Python.


Let's say I have this code:
Code: Select all
TAB TAB if(true) {
TAB TAB TAB doSomething();
TAB TAB }

Right now, if I click anywhere on line 0 or line 2, sublime shows an active indent guide to the right of the first tab.
If I click anywhere on line 1, sublime shows an active indent guide to the right of the second tab.

I suggest this:
If I click before the if on line 0, it shows an active indent guide at the tab closest to where I clicked.
If I click anywhere at or after the if, it shows an active indent guide to the right of the second tab. (This is because the grammar would say that line 0 changes the indent of the next line, so it shows the active indent guide at that line. The idea is the active indent guide runs from the 'i' to the '}')

If I click before doSomething, it shows an active indent guide at the tab closest to where I clicked.
If I clicked on or after doSomething, it shows an active indent guide to the right of the second tab. (This is what sublime does now. The idea is this line does not change the indent level, show show the active indent guide at the 'parent scope').
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Dev Build 2105

Postby ajpalkovic on Thu Aug 25, 2011 8:07 pm

And also, just so I don't come off wrong ... I am totally fine with continuing to use a plugin for active indent guides if you don't want to implement all of that functionality. (But I would love it if indent guides showed up when the text background color changes :))
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Dev Build 2105

Postby Anomareh on Thu Aug 25, 2011 9:52 pm

Ah I missed that you were talking about active guides. I thought you were talking about the guides themselves as right now a line that consists of nothing but whitespace the last guide is skipped which I find kind of counterintuitive.

On what you did say though, I agree with everything besides the last thing. Clicking on or after doSomething should make the guide to the right of the third tab active as that's the current indentation level. Seeing as the if only contains one line it's not very useful but once there's anything else in there I don't think it makes much sense to make the parent scope's guide active. If I wanted that guide to be active I'd move my cursor to be on a line at the indentation level.

Given the following, I don't think it'd make much sense or be desired to have the parent scope's guide active.

Image

You can always intuit the parent guide as it will always be the guide previous that of the active one, but as soon as the active guide isn't always the guide at the current indentation level this is no longer true.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Dev Build 2105

Postby ajpalkovic on Thu Aug 25, 2011 10:08 pm

In your screenshot, you have the cursor in an 'if'. I would have the active guide right next to the if too.
HOWEVER, if you moved the cursor to continue, I would keep the active guide next to the if, NOT next to continue.
Think about it a bit. When you have 'statements' in a 'block', those all line up, you would never see the active guide. However, if for the 'statements' in a block', you show the active guide for the 'block' (ie, one indent level higher), you would actually see it, and it might be more useable.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Dev Build 2105

Postby Anomareh on Thu Aug 25, 2011 10:15 pm

The for loop was my equivalent to your if. It just so happens it has other control statements in it rather than variable declarations. If you move the cursor to the end of the line after the first continue the active guide should be the same.

My point is you don't know what's going to be in the control statement. Sure there might not end up being an active guide at all but you're assuming control statements will consist of nothing more than a block of statements. I think it's more important to have the active guide always be a constant (aka always be at the current indentation level) rather than variable (aka sometimes the parent indentation level) as with one you can always intuit the parent whereas the other you can't.

Perhaps this illustrates my point more clearly:

Image

Making the active guide that of the if would be very odd behavior to me.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Dev Build 2105

Postby ajpalkovic on Fri Aug 26, 2011 5:53 am

sublimator wrote:Any code that's already formatted to be indented is pretty easy to parse visually for the current visible region.


I am currently working in a file with a 76 space indent. That's 38 tabs. I NEED active indent guides or good code folding.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Dev Build 2105

Postby bizoo on Fri Aug 26, 2011 6:39 am

sublimator wrote:It's totally not what I expected when people were talking about highlighting active indentation guides (I'd never tried the plugin, generally just use block select|move_ends commands directly rather than an intermediary step like a guide)

What's the 'block select' command ?
Couldn't reproduce it on my Python file.
Do you have a plugin or a non standard grammar file ?
bizoo
 
Posts: 880
Joined: Wed Dec 08, 2010 6:53 am
Location: Switzerland

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 18 guests