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

[R] Add support for named code sections #2118

Merged
merged 2 commits into from
Oct 23, 2019

Conversation

deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Oct 7, 2019

[R] Add support for named code sections

The issue was filed at:
https://forum.sublimetext.com/t/r-named-sections-not-taken-by-sublime/46891

The function is described at:
https://support.rstudio.com/hc/en-us/articles/200484568-Code-Folding-and-Sections

Notes:

As all # in front of a section are scoped as punctuation. the same is done for normal comments to keep their look synced.

The issue was filed at:
https://forum.sublimetext.com/t/r-named-sections-not-taken-by-sublime/46891

The function is described at :
https://support.rstudio.com/hc/en-us/articles/200484568-Code-Folding-and-Sections

Notes:

As all `#` in front of a section are scoped as `punctuation.` the same
is done for normal comments to keep their look synced.
R/R.sublime-syntax Outdated Show resolved Hide resolved
1. Applies fix from review.
2. Modifies the rule in order not to scope the leading whitespace as `comment` to comply with the "behavior" of normal comments.
3. Extends test cases to ensure the end of line is part of comments.
@deathaxe
Copy link
Collaborator Author

@wbond: Resolved

@wbond wbond merged commit d43b3b7 into sublimehq:master Oct 23, 2019
@wbond
Copy link
Member

wbond commented Oct 23, 2019

Thanks!

@deathaxe deathaxe deleted the pr/r/add-codesections branch October 23, 2019 17:42
mitranim pushed a commit to mitranim/Packages that referenced this pull request Mar 25, 2022
* [R] Add support for named code sections

The issue was filed at:
https://forum.sublimetext.com/t/r-named-sections-not-taken-by-sublime/46891

The function is described at :
https://support.rstudio.com/hc/en-us/articles/200484568-Code-Folding-and-Sections

Notes:

As all `#` in front of a section are scoped as `punctuation.` the same
is done for normal comments to keep their look synced.
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.

2 participants