Skip to content

formatR 1.9

Compare
Choose a tag to compare
@yihui yihui released this 14 Apr 15:33
· 43 commits to master since this release

NEW FEATURES

  • Lines will be wrapped after operators %>%, %T%, %$%, and %<>% now (thanks, @g4challenge #54, @jzelner #62, @edlee123 #68).

  • The argument width.cutoff of tidy_source() used to be the lower bound of line widths. Now if you pass a number wrapped in I(), it will be treated as the uppper bound, e.g., tidy_source(width.cutoff = I(60)). However, please note that the upper bound cannot always be respected, e.g., when the code contains an extremely long string, there is no way to break it into shorter lines automatically (thanks, @krivit @pablo14, #71).

  • The value of the argument width.cutoff can be specified in the global option formatR.width now. By default, the value is still taken from the global option width like before.

BUG FIXES

  • When the text in the clipboard on macOS does not have a final EOL, tidy_source() fails to read the last line (thanks, @edlee123, #54).