You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think in order to keep the API consistent, the behaviour of the Addins to style a highlighted region and styling an active file should be the same with regard to unsaved changes, so I suggest to use rstudioapi throughout. The other question is whether the styled file should be saved or not. I think if we use rstudioapi, and the file contains unsaved changes, this won't be the case.
I think we could also use a global option on which we make saving after styling conditional. I implemented that in strcode. See R/zzz.R and how the option is remembered.
Activity
Handle styling of an unsaved active file
lorenzwalthert commentedon Oct 13, 2017
I think in order to keep the API consistent, the behaviour of the Addins to style a highlighted region and styling an active file should be the same with regard to unsaved changes, so I suggest to use
rstudioapithroughout. The other question is whether the styled file should be saved or not. I think if we userstudioapi, and the file contains unsaved changes, this won't be the case.lorenzwalthert commentedon Oct 13, 2017
Reference: https://github.com/krlmlr/styler/pull/243/files#r144474981
lorenzwalthert commentedon Oct 13, 2017
I think we could also use a global option on which we make saving after styling conditional. I implemented that in
strcode. See R/zzz.R and how the option is remembered.Handle styling of an unsaved active file