Home Download Buy Blog Forum Support

Indent Guides

Re: Indent Guides

Postby ajpalkovic on Sat Aug 06, 2011 6:32 pm

Not really, you basically have to edit the theme.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Indent Guides

Postby ajpalkovic on Tue Aug 09, 2011 12:48 am

I updated mine with a couple changes. I merged Anomareh's changes, crudely disabled hiding indent guides in selections and changed it to use dicts instead of lists for cursor positions.

More importantly, for showing the active guide, it now uses the end of whitespace for the line instead of the cursor position. The idea is that if I type </div>, as I am typing, I still want the active indent guide to show up at the beginning of the line, not at the end of </div>, doesn't really make sense there.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Indent Guides

Postby Anomareh on Wed Aug 10, 2011 9:28 am

Alright, I got around to rewriting it.

https://gist.github.com/1136448

It's bug free as far as I can tell. I don't think it's possible to make it really friendly with large files past a timer which I personally find kind of meh. For it to get any better it probably just has to be implemented internally.

Quick run down of the options:

Code: Select all
'indent_guides_enabled': true
    Enables indent guides.

'indent_guides_max_file_characters': 524288
    The max file size a file is allowed to be and have indent guides.

'indent_guides_scope': 'comment'
    The scope name assigned to guides.

'indent_guides_active_scope': 'indent_guides_scope'
    The scope name assigned to active guides.
   
    [NOTE] To enable active guides you have to set this option. Active guides
           default to the same scope as inactive guides.

'indent_guides_hide_in_selection': true
    Indent guides will be hidden within selections.

'indent_guides_hide_on_line': true
    Indent guides will not be drawn on the current line.
   
    [NOTE] This only applies to empty selections.

'indent_guides_active_wrap_to_text': true
    If true, the active guide will always be the deepest guide on the cursor's line.
    If false, the active guide will be the guide closest to the left of the cursor.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Indent Guides

Postby pod on Wed Aug 24, 2011 2:27 pm

@Anomareh, working great for me! Thanks a lot!
pod
 
Posts: 37
Joined: Sun Nov 07, 2010 3:32 am

Re: Indent Guides

Postby Anomareh on Wed Aug 24, 2011 6:49 pm

@pod Great :]

Also, I just updated it (same link as before https://gist.github.com/1136448). Fixed a bug when interacting with the console and also added a check to disable the built-in guides if they're enabled alongside the plugin.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Indent Guides

Postby joaodrp on Wed Aug 24, 2011 9:22 pm

Anomareh wrote:@pod Great :]

Also, I just updated it (same link as before https://gist.github.com/1136448). Fixed a bug when interacting with the console and also added a check to disable the built-in guides if they're enabled alongside the plugin.


So, is this plugin already part of dev build 2104?

"Build 2104
Release Date: 24 August 2011
Added indentation guides. These may be disabled with the draw_indent_guides setting.
...
"
joaodrp
 
Posts: 31
Joined: Fri Jul 29, 2011 11:29 am

Re: Indent Guides

Postby joaodrp on Wed Aug 24, 2011 9:23 pm

Is this plugin already part of sublime in dev build 2104?

Because it tells this:

Build 2104
Release Date: 24 August 2011
Added indentation guides. These may be disabled with the draw_indent_guides setting.
joaodrp
 
Posts: 31
Joined: Fri Jul 29, 2011 11:29 am

Re: Indent Guides

Postby ajpalkovic on Wed Aug 24, 2011 9:49 pm

Partly yes. The active indent guides are not in 2104. If they aren't made into a native feature I'll just pull them out into a separate plugin.
ajpalkovic
 
Posts: 142
Joined: Fri Jun 10, 2011 10:21 pm

Re: Indent Guides

Postby Anomareh on Thu Aug 25, 2011 3:52 am

joaodrp wrote:Is this plugin already part of sublime in dev build 2104?

What ajpalkovic said.

The gist also has a few extra options the built-in guides don't have (active guides aside). Namely the ability to toggle whether they are shown in selections or on the current line. Also the built-in guides will not show the last guide on a line that contains nothing but whitespace, the gist will. For example, if a line consists of nothing but 4 tabs, the built-in guides will only draw 3 guides ignoring the last one where as the gist will draw 4.
Anomareh
 
Posts: 222
Joined: Thu Oct 01, 2009 7:32 pm

Re: Indent Guides

Postby skaet on Thu Aug 25, 2011 11:20 pm

Anomareh wrote:The gist also has a few extra options the built-in guides don't have (active guides aside). Namely the ability to toggle whether they are shown in selections or on the current line. Also the built-in guides will not show the last guide on a line that contains nothing but whitespace, the gist will. For example, if a line consists of nothing but 4 tabs, the built-in guides will only draw 3 guides ignoring the last one where as the gist will draw 4.

I find this functionality to be worth using the plugin over the default guides, thanks :)
skaet
 
Posts: 93
Joined: Thu Sep 16, 2010 3:37 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], Yahoo [Bot] and 11 guests