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

Feature request: Add rainbow for new empty line with auto indents #27

Open
Move2win opened this issue Jan 6, 2022 · 5 comments
Open

Comments

@Move2win
Copy link

Move2win commented Jan 6, 2022

Automatically add rainbow for new empty line who inherits an auto-indent param from the previous line.

Inked屏幕截图(751)_LI

@marcelwgn
Copy link
Owner

This is definitely a good idea. If you wish to contribute this feature, feel free to do so, I'm not sure when I will get to this.

@marcelwgn
Copy link
Owner

Could you share a document/example where this is the case? I found that Visual Studio inserts virtual indentation that is only render but does not exist in the actual text. If the line contains actual whitespaces or tabs, they should be colored correctly.

@Move2win
Copy link
Author

Move2win commented Nov 7, 2022

Could you share a document/example where this is the case?

In this case, the visual studio cursor gives an auto-indent after pressing enter, but IndentRainbow does not react to this.

image

I found that Visual Studio inserts virtual indentation that is only render but does not exist in the actual text.

This should be why IndentRaimbow does not react to auto-indent creation by pressing enter.
I found out that if I add a space at one of the ends of the auto-indent lines, the rainbow will appear even if I delete that space later, the rainbow will keep anyway.

Even that's the case. I found it very inconvenient to add and then delete space for every empty line to get them to show the rainbow.
It would be great if it could be improved.

@marcelwgn marcelwgn self-assigned this Apr 29, 2023
@szalapski
Copy link

szalapski commented Oct 18, 2023

I'd like to propose a "one step farther" variation: I'd like to see lines that are blank (only whitespace) should always show the same rainbow indent as the last previous non-whitespace line. For example, in move2win's screenshot above, lines 76-83 would all have the same rainbow colors as line 75, regardless of whether they are empty or have tabs or spaces.

I think it is okay to show these even though there are no space/tab characters "underneath" the proposed rainbow colors there because the goal of the extension is to show the structure of code, not to visualize space/tab characters.

@marcelwgn marcelwgn removed their assignment Oct 18, 2023
@marcelwgn
Copy link
Owner

This is definitely a good idea, however implementation is probably not that easy since we would now need to store the indentation of the last line. Doable but not as easy as other features that have been added throughout the years 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants