Skip to content

Distinguish code area from glyph area #3803

Closed

Description

@anseki

This is small issue for me.

Code folding is very great useful.
But it made margin between line numbers and first character in each line.
When I use "2 spaces indent", that margin looks like indent.
Now, I use editor.rulers setting includes 0 like [0, 100, 120] to indicate a start point of a line. But it is not pretty.

Is this issue solved by any theme?
I think that it is solved by just a little changing a color of the left side area of first character in each line.

Activity

  1. kumarharsh commented on Mar 8, 2016

    @kumarharsh
    Contributor

    +1. Not sure if this can be solved by theming. But if not, then definitely something the team should look at

  2. mattacosta commented on Mar 8, 2016

    @mattacosta
    Contributor

    Yeah I keep trying to double check that my code doesn't have extra spaces. It's mildly irritating. Before the text was close enough to the line numbers that it was obvious where the code area was.

  3. changed the title [-]Distinguish code area[/-] [+]Distinguish code area from glyph area[/+] on Mar 8, 2016
  4. aeschli commented on Mar 8, 2016

    @aeschli
    Contributor
  5. kumarharsh commented on Mar 8, 2016

    @kumarharsh
    Contributor

    Martin Aeschlimann (@aeschli) I'm working on a PR right now with minimal changes

  6. kumarharsh commented on Mar 8, 2016

    @kumarharsh
    Contributor

    Martin Aeschlimann (@aeschli) when I'm trying to commit my changes, the precommit hooks is showing this error:

    src\vs\workbench\browser\media\vs-dark-theme.css: Missing or bad copyright statement
    src\vs\workbench\browser\media\vs-theme.css: Missing or bad copyright statement
    
    Hygiene failed with 2 errors. Check 'build/gulpfile.hygiene.js'.
    

    I've not touched the copyright statements at all. Looking at the hygiene file, it seems that it'll throw that error when a copyright is present. How do I commit the file then? Do I have to remove the copyright?

  7. aeschli commented on Mar 8, 2016

    @aeschli
    Contributor

    I can't reproduce. I added a line vs-dark-theme.css, created a commit. Works.
    Make a change to the copyright statement, create a commit, Fails.

    Make sure you have also have no unstaged changes that modify the copyright.

  8. kumarharsh commented on Mar 8, 2016

    @kumarharsh
    Contributor

    OK, I found the bug. Are you testing on a non-Windows system?

    You're creating the copyright string like this:
    https://github.com/Microsoft/vscode/blob/master/build/gulpfile.hygiene.js#L93

    The parts are joined with a '\n', not a '\r\n' for windows. So, when the files are being read, the strings are not equal, even though they exist.

  9. kumarharsh commented on Mar 8, 2016

    @kumarharsh
    Contributor

    I've added a PR for fixing that hygiene check in #3834

  10. jeffmcaffer commented on Mar 8, 2016

    @jeffmcaffer

    would very much like this fixed. I'm forever moving left but ending up at the end of the previous line. Very disorienting. Thanks Kumar Harsh (@kumarharsh)

  11. bgashler1 commented on Mar 8, 2016

    @bgashler1
    Contributor

    Is this a problem only because the tab space size is small (e..g 2 spaces)? I've personally never had a problem with this, possibly because I'm using a larger tab space size.

    This is what it looks like to me while I'm hovering over the glyph area.
    screen shot 2016-03-08 at 11 45 54 am

  12. Tyriar commented on Mar 8, 2016

    @Tyriar
    Contributor

    I've had this problem as well, the gutter has fooled me into thinking it was an indent. Most other editors use a darker gutter to distinguish the two.

  13. 22 remaining items

  14. chrisdias commented on Mar 12, 2016

    @chrisdias
    Contributor

    Why do you think that is? What is different between Sublime and VSCode given option 4, with perhaps some tweaks? i would love to nail that down so that we can perhaps have a lighter weight experience in Code.

  15. jeffmcaffer commented on Mar 12, 2016

    @jeffmcaffer

    Daniel Imms (@Tyriar) I used the new version of VS Code for seconds and had the problem :-) It could well be like a new pair of glasses (its my day for analogies). Everything looks warped but after a week or two its all ok. Then again, is it good that people need to "get used to" their tools?
    As for sublime, I've not been using it so can't compare. Perhaps people who are used to Sublime don't have the problem.
    For me the problem was completely addressed by anseki's 0 column ruler suggestion.

  16. bgashler1 commented on Mar 12, 2016

    @bgashler1
    Contributor

    Jeff McAffer (@jeffmcaffer): what if we introduced a left-edge guide as very simple opt-in setting:

    {
        // Show the left-edge of the code editor
        "editor.leftEdgeGuide":true;
    }
    

    Would this alleviate your concerns?

    I'm concerned about adding this as a default for everyone, because it appears visually noisy for people who have never had a problem without it. Additionally, we could justify adding the Option 4 approach in by default.

  17. jeffmcaffer commented on Mar 12, 2016

    @jeffmcaffer

    Would that be the explicit version of adding a 0 ruler? A bit redundant but better discoverability and reduces the pressure on choice of default (if people can easily find and change the setting). I'm agnostic on Option 4. It would not bother me but would not likely address the issue for me. Certainly would give it a try if it was there.

  18. mattacosta commented on Mar 12, 2016

    @mattacosta
    Contributor

    I am highly skeptical of option 4. Its effectiveness would seem to decrease with the number of indented lines currently being shown.

    The core problem seems to be users not being able to tell where their whitespace is. It's solved in Sublime by its vertical indent guides (which is also visible in the screenshot above), and not by highlighting the line number. In my opinion, the best solutions for the issue are:

    1. Indent guides
      • Pros: Works no matter the number of indents.
      • Cons: Probably can't be implemented this close to release, also somewhat clutters the text area but could be turned on/off via options. Which may actually end up being a pro if this isn't a problem for those using 4-space indents, since they would see no change.
    2. Use a different gutter background color
      • Pros: Relatively simple to implement, better than a hard border (see below).
      • Cons: Only indicates where whitespace for the first column starts.
    3. VS-style folding lines
      • Pros: If you're going to put something in that's effectively like a border, it might as well also solve the "how much is this button going to collapse my text" question.
      • Cons: Only indicates where whitespace for the first column starts.
    4. Add a border to the gutter
      • Pros: Relatively simple to implement.
      • Cons: It's a border (see below).
    5. Set editor.renderWhitespace to true.
      • Just kidding. No one shows this. It does solve the core problem without a border though!

    * This assumes a strategy of "no color change or borders > color change > border" in order to limit the creation of perceived UI sections.

  19. anseki commented on Mar 12, 2016

    @anseki
    Author

    In my case:

    I'm using Sublime few years. I felt dissatisfied with undistinguishable indent.
    Then, I use draw_indent_guides and draw_white_space.

    s01

    "2 spaces indent" also might be the cause of this issue...

    I often look at another part of code without changing current line. Therefore I hope that the edge of code area (i.e. all lines) is indicated.
    I think that it is solved by just a little changing a background color of gutter. (no border line)

  20. anseki commented on Mar 12, 2016

    @anseki
    Author

    When I am writing a line, of course current line is here. But I know indent at here before the current line marker indicates it, because I made that indent just now.
    When I am reading a code that was written, I may lose indent, and current line may not be here.

  21. bgashler1 commented on Mar 15, 2016

    @bgashler1
    Contributor

    Thanks for everyone's feedback! It really helped us understand the underlying concerns.

    We will be addressing this issue most likely in our April release by introducing our own flavor of draw_indent_guides, which will remove the confusion about where an indent is, no matter what tab space size you use.

    Since we won't have time to get it in by March, a workaround is to use anseki's suggestion of having "editor.rulers": [0]. This will give you a left-hand reference. If you need more granularity, it may be helpful to also use "editor.renderWhitespace": true.

  22. removed this from the March 2016 milestone on Mar 29, 2016
  23. kuntau commented on Nov 4, 2016

    @kuntau

    Hi guys. Any idea which milestone this is on? I feel kind of silly backspacing over and over on the gutter edge thinking I might have accidental indent 😏

  24. bgashler1 commented on Nov 4, 2016

    @bgashler1
    Contributor

    Nizamuddin Sulieman (@kuntau) you can use a code ruler set at the far left zero position of the editable area. Add this snippet to your user settings "editor.rulers": [0]

    Also, you can turn on indent guides to help further by adding this to your user settings "editor.renderIndentGuides": true

    Hopefully these two things will help you out.

  25. kuntau commented on Nov 5, 2016

    @kuntau

    Brad Gashler (@bgashler1) that's what I did after reading this issues. That is kind of hackey solution, I'm looking for official solution as discussed above, just a bit contrast between the gutter and editor area as suggestion #3 would be nice

  26. alexdima commented on Nov 7, 2016

    @alexdima
    Member

    Nizamuddin Sulieman (@kuntau) Today there are the two ways described by Brad Gashler (@bgashler1) . I'm also looking into #14273 which will introduce a third way to workaround. We plan to make renderIndentGuides true out-of-the-box, but there is still a perf issue I wanna look into before doing that (some lookup in a tree is O(N) instead of O(H*log(N)).

  27. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

polishux

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions