Skip to content

Fix indention #142

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 4 commits into from
Aug 22, 2017
Merged

Fix indention #142

merged 4 commits into from
Aug 22, 2017

Conversation

lorenzwalthert
Copy link
Collaborator

Closes #141

@lorenzwalthert lorenzwalthert requested a review from krlmlr August 21, 2017 15:27
R/modify_pd.R Outdated
before_first_break <- which(pd$lag_newlines > 0)[1] - 1
if (is.na(before_first_break)) return(FALSE)
!any(pd$multi_line[opening:before_first_break])
!any(pd$multi_line[potential_trigger:before_first_break])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seq2()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.

R/modify_pd.R Outdated
needs_indention <- needs_indention(pd, potential_triggers)
trigger <- potential_triggers[needs_indention][1]
if (is.na(trigger)) return(numeric(0))
start <- trigger + 1
stop <- npd - ifelse(indent_last, 0, 1)
which(between(seq_len(npd), start, stop))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could seq2() work here, too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True.

@codecov
Copy link

codecov bot commented Aug 21, 2017

Codecov Report

Merging #142 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #142      +/-   ##
==========================================
+ Coverage   87.44%   87.48%   +0.03%     
==========================================
  Files          19       19              
  Lines         741      743       +2     
==========================================
+ Hits          648      650       +2     
  Misses         93       93
Impacted Files Coverage Δ
R/modify_pd.R 92.68% <100%> (+0.37%) ⬆️

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 c58ea29...42c214d. Read the comment docs.

@lorenzwalthert lorenzwalthert merged commit cc2f40c into r-lib:master Aug 22, 2017
krlmlr added a commit that referenced this pull request Aug 24, 2017
- Vignette on customizing styler (#145).
- No line break after `switch()` and friends (#152).
- Remove flat relicts completely (#151).
- Don't reindent function calls and break line correctly for multi-line calls (#149).
- Set space between "=" and "," (#150).
- Make R CMD Check perfect (#148).
- Adding tests for exception handling with invalid parse data (#139).
- Fix indention by checking for all potential triggers (#142).
- Fix un-indention (#135).
- Support wide characters (#130).
- No spaces around :, :: and :::.
- Redesigning the API (#123).
- Solve eq_sub indention in general (#125).
- Minor refactorings.
- Re-indent token-dependent (#119).
- Supporting more indention patterns.
- Allow raw indention.
- Definitively fixing eol issue with comments.
- Infrastructure.
- Flattening out the parse table.
- New rule: no space after ! -> !!! for tidyeval.
- Fix spacing around '{'.
- Don't drop tokens! Fixes #101.
- EOL spaces in empty comments (and in general) (#98).
- mal-indention in conditional statement due to wrong specification of indent_without_paren) (#95).
- Complicated indentions based on arithmetic and special operators (#96).
- indention interaction on with assignment operator and other operators (#97).
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