Sublime Forum

Indentation marker doesn't appear on empty lines at end of braces

#1

New to Sublime and enjoying it, but having a minor but distracting visual glitch: indentation markers don’t appear on whitespace-only lines, but ONLY on the final lines between the last non-whitespace character in a block and its closing brace!

It’s easier to see than it is to explain:
(I’m uploading the two screenshots in a single image since that’s all I’m allowed as a new user.)

In the first screenshot:
Notice that the leftmost column of indentation markers doesn’t continue all the way to the curly brace at the bottom – I promise that those empty lines also contain tabs just like the ones around console.log, and yes I’ve already set trim_automatic_white_space to false.

In the second screenshot:
To confirm what I’m saying: the ONLY difference in this second screenshot is a single keystroke to make that ‘q’ — suddenly all the untouched whitespace-only lines ABOVE the ‘q’ have their indentation markers.

Is this a setting I can change, or is it a bug?

1 Like

#2

Can not be changed and is intended behavior because some languages (like Python) are purely indentation based and expanding the guides to the line where a new character with the same indentation appears would be nonsense.

That does not mean it would be impossible to add the other way as a feature in the future however.

0 Likes

#3

I want to be clear, though: that indentation is ALREADY present on the ‘empty’ lines! I’m not asking for it to infer indentation, just to reflect the indentation in the file.

(In hindsight, I should’ve had visible whitespace in the original screenshots)

I’m guessing the current behavior emerged from the assumption that users would be using trim_automatic_white_space and so the indentation has to be inferred across whitespace-only (i.e. potentially empty) lines; is there really no option to do the simpler job of just reflecting the literal indentation of individual lines?

Thinking about it, I guess what I’m describing is just visible whitespace for tabs, without also seeing it for spaces; is there any way to pick which whitespaces render? (And/or, pick which character or color is used to visualize each type of whitespace?)

Thanks

1 Like

#4

Oh, I see.

In that case, why does having whitespaces shown not solve it for you? Do you only want to see leading/trailing whitespaces?

Eclipse has a pretty neat dialog for this:

0 Likes

#5

It’s just that I don’t want whitespaces shown for space characters (and I’d prefer the subtler vertical stroke that the indentation visualization uses over the horizontal stroke that the whitespace visualization uses, while we’re at it).

Eclipse’s dialog does look like what I’d want, yeah. I was hoping Sublime could do it since it seems to generally run much snappier, but it’s not the end of the world if it can’t; I just thought I’d ask and make sure there isn’t just a setting I’d overlooked somewhere.

Thanks!

1 Like