Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mdequeljoe
Copy link
Contributor

This pr proposes the addition of colored brackets in order to help distinguish between scopes.

This is done by adding the entry: bracket to default_style whereby one can set the list of colouring functions to be used to color brackets.

An internal function color_brackets is added such that brackets are colored consecutively by the scope level according to the color sequence passed in via bracket. The following brackets are considered:

[[ [ ] ( ) { }

Note that the counterpart of [[ is two ] characters instead of ]] as this bracket would be parsed as an 'LBB' token (or as a 'SYMBOL_FUNCTION_CALL' and thus not passed on to color_brackets)
Some more details are provided in the documentation.

@gaborcsardi
Copy link
Member

Love this! I am in the middle of something, but will look at it later today. Thanks much!

@codecov-io
Copy link

codecov-io commented Apr 1, 2019

Codecov Report

Merging #8 into master will increase coverage by 3.5%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master       #8     +/-   ##
=========================================
+ Coverage   83.47%   86.98%   +3.5%     
=========================================
  Files           5        6      +1     
  Lines         115      146     +31     
=========================================
+ Hits           96      127     +31     
  Misses         19       19
Impacted Files Coverage Δ
R/highlight.R 100% <100%> (ø) ⬆️
R/brackets.R 100% <100%> (ø)
R/style.R 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0e04fe...dcdca0c. Read the comment docs.

@gaborcsardi
Copy link
Member

Sorry, it took "a bit" longer in the end. :( I think this is great! Can you please add a bullet point to the NEWS, with your GH username and the PR id? Then I'll be most happy to merge it.

Thanks again!

@gaborcsardi
Copy link
Member

You know what, don't worry about it, I'll do it....

Thanks again!

@gaborcsardi gaborcsardi merged commit 17d8a4b into r-lib:master May 14, 2019
@gaborcsardi
Copy link
Member

How could I live without this? I love this feature already.

@mdequeljoe
Copy link
Contributor Author

great thanks!!

@mdequeljoe mdequeljoe deleted the brackets branch May 14, 2019 13:17
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

Successfully merging this pull request may close these issues.

3 participants