Skip to content

style_selection() should preserve trailing newline #519

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

Closed
hadley opened this issue Jun 14, 2019 · 1 comment · Fixed by #520
Closed

style_selection() should preserve trailing newline #519

hadley opened this issue Jun 14, 2019 · 1 comment · Fixed by #520

Comments

@hadley
Copy link
Member

hadley commented Jun 14, 2019

Given

```{r}
1+2
```

If I select 1+2 and then style the current selection, I get

```{r}
1+2```
@lorenzwalthert
Copy link
Collaborator

Thanks. I think the problem described only occurs when the whole line is selected with the Addin (see #520). However, I think that we should also get this case right since I imagine it's common to select code like this if one uses the Addin, so we should resolve this in #520.

Side note: For styling a whole .Rmd document, there is support via both styler::stlyle_file(...) and style_pkg(..., filetype = ".Rmd") as well as through the style active file Addin (I guess you knew this already, just for the record).

lorenzwalthert added a commit that referenced this issue Jun 16, 2019
- Make Addin for selection styling respecting line breaks in general (#519).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants