Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added visual indentation line guides for text editors #38833

Conversation

EricEzaM
Copy link
Contributor

@EricEzaM EricEzaM commented May 18, 2020

I have found it a bit difficult to know exactly in which indentation 'context' I am in when working on code (especially long code blocks, sometimes spanning more than 1 "page"). This attempts to resolve that issue. I know you can draw tabs (and spaces) but it does not 100% solve the issue, and I find that drawing tabs makes too much visual clutter.

This give a solution found in most common IDE applications. There are editor settings for

  • On/off indent guides
  • On/off Highlight active indent guide
  • Colors

Where/when to draw lines is based on the 'folding' mechanism already in the editor.

My first time adding editor settings so please check I did it right :) Thanks

Showcase
Pyt7xW4JcJ

Before
godot windows tools 64_UZQPI83uSq

@EricEzaM EricEzaM changed the title Added visual indentation lines guides for text editors Added visual indentation line guides for text editors May 18, 2020
@EricEzaM EricEzaM force-pushed the text-editor-indentation-line-guides branch from dcd25cb to dc0c1f9 Compare May 18, 2020 22:59
@Calinou
Copy link
Member

Calinou commented May 25, 2020

For future reference, I attempted this in #20725 but it didn't work when scrolling.

In my PR, I used a more subtle color for indent guides (Color(0.5, 0.5, 0.5, 0.31)), which you could borrow in your PR as well. I think the current color is a bit too prominent, as indent guides are generally considered to be "secondary" information. That said, I like the idea of making the "current" indent level more contrasted (I'd still tone it down a bit).

@EricEzaM
Copy link
Contributor Author

@Calinou that's true, looking at this again a few days later, the colors are a bit too prominent.

@EricEzaM
Copy link
Contributor Author

This is probably better to be implemented at some point in the future, maybe 4.1, when the api for script/code/text editor is finalised.

Closing for now, and would submit as a separate PR in the future if I were still to implement.

@EricEzaM EricEzaM closed this Sep 11, 2020
@Calinou Calinou removed this from the 4.0 milestone Sep 11, 2020
@EricEzaM EricEzaM deleted the text-editor-indentation-line-guides branch October 5, 2021 12:22
@Calinou Calinou added this to the 4.0 milestone Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants