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
Enhancement: Colour matched parenthesis/braces #1888
Comments
As someone who uses RStudio to teach data science, this feature would be super useful. (As someone who sometimes codes for too long in one sitting, it would be good too.) |
Indents are supposed to solve this, but they don't really. Agreed, would be most welcome |
This would be a huge improvement when programming shiny apps. I always get crazy with so many brackets |
Totally want this asap. However meanwhile - RStudio does rock in other ways. |
The difference this makes to my coding experience is profound. When I flip back to RStudio I have a genuine low grade stress associated with matching parens that I don't have in my regular editor. I think some people find this less of a big deal than others. I've always struggled with counting repeated characters in a sequence. To the point where I see this as in the 'Accessibility' class of features. Bring forth the rainbow! |
This would be soooooo helpful! I spend so much time putting in carriage returns and indentation when I copy/paste code, trying to sort out what matches what. This would help soooo much! |
This would be amazingly helpful. I really have to strain sometimes to see where I am in a nest. Great for teaching purposes too |
After seeing @MilesMcBain 's video where he has matching colour parentheses...I need this in my life! |
We need this, super useful to the point I sometimes debug R in visual studio code |
I agree with this suggestion |
This would be so useful in Shiny apps in particular. No matter how much I try to make complex parts of code their own functions, I quickly end up with three nested functions each with a pair of brackets and curly braces. Can get very confusing quickly, e.g.:
Have I ended the brackets for the for loop, if statement renderTable and server function? Pretty hard to tell. Rstudio already knows which brackets match so presumably this wouldn't be that difficult to implement? Or is there a way to do it already with themes? |
On behalf of dylsexic programmers everywhere, I give this an up vote. I'd give it 10 if I could. No, 100. Well, I don't know how many I would give it, but a lot. |
Adding accessibility label, this feature could be helpful with cognitive overload. |
+1 to the nth power!. |
I'm crushed that it still isn't solved. It's an absolute must have not only on mondays. If it's a tough issue (seen it only in payware so far, e. g. WinEdt) I'm not above begging, groveling, and bootlicking. Pleeease? |
Quite disappointing that nearly 2.5 years later this still hasn’t been resolved. We need this. |
@adamconroy Fantastic! Any idea when the next stable release (or whichever one will have this feature) will be? |
@adamconroy I just installed RStudio Desktop 1.3.959. Its released May 22 2020. Could not find any option about this feature. |
This is a 1.4 feature as indicated by the milestone in the sidebar. |
For anyone who wants to try this out, we have daily builds here: Feedback would be very welcome on our community forum! https://community.rstudio.com/c/rstudio-ide |
Another thing that would help with this issue is if the matching bracket highlight color was much, much more visible. It doesn't seem to be something that can be set in a theme. They should both become bold and the matching one should also get perhaps an underline and a background color like red or green or something other than a light grey: |
@jzadra This looks like a separate (though related) issue. Could you file an enhancement request for it so that we can track it separately? Thanks! |
It appears that the rainbow parens are ignoring the rsTheme setting |
It is fantastic that you are implementing rainbow brackets. I've installed daily build 1.4.714 and have the following feedback: While I love the rainbow, it actually isn't very functional to have the brackets change in rainbow order because adjacent brackets are similarly colored (it's hard to tell red from orange and orange from yellow). It would be better if the appeared in order of colors on opposite sides of the color wheel as those are the most distinct from each other, ie red, green, orange, blue, yellow, purple, etc: Also, while the colors are helpful when there are nested brackets, they detract from legibility when they are needed for non-nested brackets because the pink is quite pale. When there is no nesting, I'd suggest leaving them the default color of the theme might be more legible. |
We've changed the colors a few times based on feedback, in fact I was doing opposite sides of the color wheel in the initial implementation until I got a bevy of feedback wanting the more predictable ROYGIV ordering. I hope that we can eventually have in-app theme customization but until then I think the standard answer will have to be suggesting to the users to customize their theme to their liking. This can be done easily using the |
I can't try the dev version on this machine, but from this comment I take it that the colors are changing sequentially: the first pair of parentheses are blue, the second green, then yellow, etc:
This is definitely an improvement over no rainbow braces, but I second the preference for having the rainbow dependent on depth: the first parentheses are blue, the parentheses within the first are purple, but the next parentheses (not within the first or second) are blue again:
This is very useful since it allows for an at-a-glance identification of the depth one's working in, which is even useful to identify bugs caused by unmatched braces. "Hey, why is this depth-1 parenthesis green and not blue?... Oh, duh, I forgot to close the parentheses up here!" |
I've tried updating my .rstheme as follows, but am not seeing any changes. Have I done this correctly?
|
I'm still unable to get the .rsTheme to work, any suggestions? |
@jzadra can you I'm not sure why it's not respecting your rsTheme settings. |
Ah, that was simple. Your example and my code was All working now. |
Ah sorry about giving you the wrong info earlier, I was recalling from memory late at night and made a mistake. Enjoy your preferred colors! |
I'd like to suggest that the color level for parenthesis/braces/brackets be independent of each other. IE currently the print parens will be the second color level because the brackets took the first level. I think it would be more useful to have each type start at the first level independent of being nested within other types.
|
To help out those working this out for themselves, here is a the default editor theme (textmate) that has been modified with the code for custom colours for rainbow parentheses (at the end) to download - click [Download Zip]. Then you can dump it wherever your .rsTheme files are stored (on my computer Go to town if you don't like the colours by googling html colour picker and substituting in to the theme file your preferred colour (#xxxxxx). It might be possible to suck the theme directly from my gist with something like Edit: |
I've tried to modify a dark theme for using rainbow parenthesis. First it didn't work since the editor_dark tags overwrite my color settings in .ace_paren_color_x. I had to use !important to make it work. The problem seems that editor_dark has ace_paren_color_x settings and is applied AFTER the theme settings. Is this a bug which should be reported and fixed or do you just have to know (where from?!) that for dark themes you have to set the rainbow color tags !imporant? Cheers, Martin |
Thanks, I also needed the !important. Definitely a bug here |
@Fuechsl Can you open a new issue for it? Then we can determine whether this is a bug we should fix, a possible enhancement, or expected behavior. Thanks! |
Ok but l am on Holiday until aug 8, if you need it before, you have to open it yourself.
Cheers, Martin
… Am 28.07.2021 um 14:07 schrieb Ron Blum ***@***.***>:
@Fuechsl Can you open a new issue for it? Then we can determine whether this is a bug we should fix, a possible enhancement, or expected behavior. Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I opened one there @Fuechsl , thanks for the solution |
In order to enhance the visual parsing of deeply nested parenthesis and braces it could be beneficial to colour code pairs in different colours (cycling through a palette of, say, 6 different colours).
This is akin to the colour highlighting done in formulas in Excel and is also something that has been implemented in the VIM plugin Rainbow Parentheses and in several Visual Studio Code plugin, e.g. Visafora
The text was updated successfully, but these errors were encountered: