indent-guide-improved icon indicating copy to clipboard operation
indent-guide-improved copied to clipboard

display only 1 guide (the active one)

Open ax1 opened this issue 8 years ago • 3 comments

This is a suggestion:

Add another gif in the https://atom.io/packages/indent-guide-improved displaying only 1 guide (1 vertical line) instead of all guides.

When a file contains a lot of indentation, it is visually nicer to display just one guide than a crowded set of guides. I think people who like clean code will appreciate this. No code modification is required (a checkbox in the settings would also be perfect for people not to change their atom stylesheet!).

This is an example that works well with javascript files. The key is width:0px.

.indent-guide-improved {
  width:0px;
  &.indent-guide-stack {
    &.indent-guide-active {
      background-color: rgba(255, 255, 255, 0.2);
      width:1px;
      margin-left: 3px;
    }
  }
}

ax1 avatar Sep 17 '16 09:09 ax1

Thanks a lot for this! It's almost perfect for me. The project I'm working on has indent size set to 4 and your styling is really helpful. However, because indentation is not 2, the guides show in the middle of the element tags instead of at the start of it. I think it's because Atom reads indent in sets of 2 but if there's anyway of styling this as well that would be perfect. Cheers!

fonziemedia avatar Oct 23 '16 21:10 fonziemedia

@fonziemedia: for 4 spaces (python, etc) you may play with the margin-left property.

This should work fine:

margin-left: -1em;

ax1 avatar Oct 28 '16 12:10 ax1

Perfect! Thanks a lot for your help!

fonziemedia avatar Oct 28 '16 12:10 fonziemedia