microsoft / RTVS

R Tools for Visual Studio.
MIT License
388 stars 118 forks source link

Editor: automatic formatting prevents insertion of new line using return key inside magrittr pipe statements #4339

Open mkoohafkan opened 5 years ago

mkoohafkan commented 5 years ago

Consider the following magrittr/dplyr pipe statement:

mtcars %>%                   # line 1
  filter(carb < 4) %>%       # line 2
  select(mpg, cyl)           # line 3 

When automatic formatting is turned on, hitting the return key when the cursor is placed at the beginning of line 2 does not create a new line. You must instead place the cursor on the end of line 1 and hit return there instead.

It's a minor annoyance, but one I run into constantly when constructing long or complex dplyr chains.