Skip to content

Make Addin for selection styling respecting line breaks in general #520

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

Merged
merged 1 commit into from
Jun 16, 2019

Conversation

lorenzwalthert
Copy link
Collaborator

@lorenzwalthert lorenzwalthert commented Jun 16, 2019

Previously, the Addin did not support selecting the last line to style as a full line as shown below in the sense that it resulted in a line break removed and resulted in invalid R code.

Screen Shot 2019-06-16 at 13 36 20

resulted in

1 + 1 q

For the last line selected for styling, one had to select a finite col2 value to prevent this.
Screen Shot 2019-06-16 at 13 39 09
This resulted in the correct styling

1 + 1
q

This PR removes the constraint of having to select the code as in the second example (i.e. a non-finite col2 value is no longer needed) and closes #519.

@lorenzwalthert lorenzwalthert changed the title make addin for selection styling more generic Make Addin for selection styling more generic Jun 16, 2019
@lorenzwalthert lorenzwalthert changed the title Make Addin for selection styling more generic Make Addin for selection styling respecting line breaks in general Jun 16, 2019
@codecov-io
Copy link

codecov-io commented Jun 16, 2019

Codecov Report

Merging #520 into master will increase coverage by 0.05%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #520      +/-   ##
==========================================
+ Coverage   90.12%   90.18%   +0.05%     
==========================================
  Files          39       39              
  Lines        1732     1732              
==========================================
+ Hits         1561     1562       +1     
+ Misses        171      170       -1
Impacted Files Coverage Δ
R/addins.R 0% <0%> (ø) ⬆️
R/utils.R 88.88% <0%> (+5.55%) ⬆️

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 8a34853...bf827b0. Read the comment docs.

@lorenzwalthert lorenzwalthert merged commit 67225ed into r-lib:master Jun 16, 2019
@lorenzwalthert lorenzwalthert deleted the addin-select-style branch June 16, 2019 13:02
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.

style_selection() should preserve trailing newline
2 participants