editR icon indicating copy to clipboard operation
editR copied to clipboard

Save on exit

Open restonslacker opened this issue 10 years ago • 2 comments

It would be nice if there was a way to save the file you just edited after closing editR. It's common among word processors to warn the user that they are about to close a file with unsaved changes. i don't think that's easy to do with a shiny app, but my suggestion would be an implementation something like this:

  • write changes to a temp file as the user is making edits (maybe this is done already for the preview rendering)
  • after the runApp() call exits in the editR() function, prompt the user to save changes to the file if the temp file and the master file differ.
    • optionally add arguments to editR(file, saveOnExit) where save on exit would be a boolean that forces a behavior and skips the user prompt.

restonslacker avatar Jun 16 '15 13:06 restonslacker

@restonslacker This would be a nice addition indeed. I am swamped with work at the moment, but I'll get to it as soon as I can free up some time.

sjmgarnier avatar Jun 16 '15 15:06 sjmgarnier

totally understood. I am too (and a new baby), otherwise i would have sent a PR.

restonslacker avatar Jun 16 '15 16:06 restonslacker