Skip to content

Fixing and extending Rstudioaddins #283

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
Nov 19, 2017

Conversation

lorenzwalthert
Copy link
Collaborator

Closes #282 and #281. Styling done "the bare way" instead of with style_text().

  • Case distinction R vs. Rmd easy for saved files (via extension).
  • If not saved, rstudioapi::getActiveDocumentContext() does not give the extension, so we try as if it was a .R file and if it does not work, we advise the user to save the file so the extension is known when styling is attempted the second time. Then, if it is neither .R nor .Rmd, we throw an error saying we don't support file types other than .R and .Rmd.

Make sure the selection overwritten with the styled expression is the initial region. If the styled expression is shorter than the initial expression (and the reference is the length of the new expression), it may happen that some of the old code will still be below the newly inserted expression.
@lorenzwalthert lorenzwalthert changed the title Rstudioaddin Fixing and extending Rstudioaddins Nov 19, 2017
@lorenzwalthert lorenzwalthert merged commit 5629250 into r-lib:master Nov 19, 2017
@lorenzwalthert lorenzwalthert deleted the rstudioaddin branch November 19, 2017 21:42
krlmlr added a commit that referenced this pull request Nov 27, 2017
- Adapt documentation (#290).
- Add roundtrip (#287).
- Fix AppVeyor builds.
- Fix token insertion / comment interaction (#279).
- Clarify labelling strategy (#285).
- Fixing and extending Rstudioaddins (#283).
- Fix eq assign parsing (#276).
- style_files -> vectorized style_file (#273).
- Refactoring (#270).
- Fix CI (#275).
- Fix covr (#274).
- Renaming files (#271).
- Handle styling of an unsaved active file (#243).
- Test R 3.1 and R 3.2 (#249).
- Allow empty {} without line break (#261).
- Wrap expr in expr before enclosing with curly braces (#263).
- Avoid checking for hard-coded dot (#262).
- Account for dependency renaming (utf8 changed to enc) (#264).
- Indention of function declaration and closing braces (#260).
- Only remove line break before closing with strict option (#252).
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