Sublime Forum

Indent Guides

#41

Not really, you basically have to edit the theme.

0 Likes

#42

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 , 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 , doesn’t really make sense there.

0 Likes

#43

Alright, I got around to rewriting it.

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]‘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.[/code]

0 Likes

#44

@Anomareh, working great for me! Thanks a lot!

0 Likes

#45

@pod Great :]

Also, I just updated it (same link as before 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.

0 Likes

#46

[quote=“Anomareh”]@pod Great :]

Also, I just updated it (same link as before 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.[/quote]

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.

"

0 Likes

#47

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.

0 Likes

#48

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.

0 Likes

#49

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.

0 Likes

#50

[quote=“Anomareh”]
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.[/quote]

I find this functionality to be worth using the plugin over the default guides, thanks :smile:

0 Likes

#51

No problem, glad someone else can make use of it :]

I also forgot to mention there is also the ability to make the active guide wrap to text. If it’s set to wrap, regardless of the cursor position on the line, the active guide will always be the guide furthest to the right on the line. If it’s set to not wrap, the guide closest to the left of the cursor will be the active guide.

0 Likes

#52

@Anomareh very cool, thank you again! Is it possible to make guide dotted?

0 Likes

#53

Currently not, the ability to draw dotted regions is exposed to the api. As soon as it’s added though I’ll be adding it the plugin.

0 Likes

#54

As anyone noticed a change since two builds ago? I’m currently on 2139 and at some point I was very satisfied with the built-in indent guides.
Now they somehow don’t follow the tab size properly, drawing 2 guides instead of 4 in the example below:
link.olivierlacan.com/BV0C

Here are the settings I’m currently using.

      "auto_indent": true,
      "font_face": "Inconsolata",
      "font_size": 17.0,
      "line_padding_bottom": 1,
      "line_padding_top": 1,
      "translate_tabs_to_spaces": true,
      "tab_size": 2,
      "use_tab_stops": true,
      "trim_trailing_white_space_on_save": true,
      "draw_indent_guides": true
0 Likes