Skip to content

Option to autosave when editor loses focus, overwriting original document #5263

Closed

Description

@howthebodyworks

Related, although kind of opposite 😉 : #4511

It would be nice to have the option for the editor to save files automatically when the editor loses focus.

I am aware mine might not be a universal preference, but I suspect it is a common one in this era of version control systems and good undo support.

These has been requested before by RStudio users .
It is a standard option in VS Code.

Personally, I have no place in my workflow for pressing Ctrl+S to save and it doesn't give me any extra features that I can see, just something else to remember. What is it for, apart from being an extra step between your code ebing in the editor and being on the filesystem? But it is the code on filesystem that my build scripts access, and which is managed safely and securely by git, (or dropbox or owncloud etc). the code in the editor is invisble except to RStudio. In the worse case this can be pathological, leading to different results running an editor buffer and running a file on disk. Does save provide some extra functionality? AFAICT saving being separate to editing must a legacy from some era of slow hard drives, or possibly for the benefit of word processor users who don't have the nice modern affordances of text editor users like diffs and version control and such. But even they have track changes mode these days.

I frequently lose edits because I am no longer accustomed to having to compulsively save and then git doesn't pick up the changes I made and those are not available to me when I switch machines because I didn't click on RStudio and press Ctrl+Alt+S. I would very much like to have the option to disable this unnecessary failure mode.

I am aware that RStudio already autosaves documents in its own quirky temp backup system, which is great, but not what I am after here. I'd simply like to have the option to have file editor reflect the content of files on disk always and automatically.

Ideally this would be integrated with @sergiouribe's request to be able to not autosave at all, i.e. have the option for both?

Activity

  1. gtritchie commented on Aug 20, 2019

    @gtritchie
    Member

    I use the various JetBrain’s IDEs with their autosave behavior and am quite fond of it (though was reluctant at first). Agree it would be a nice option in RStudio.

  2. danmackinlay commented on Aug 28, 2019

    @danmackinlay

    To recycle some internet wisdom, the fact that the manual save icon is a floppy disk indicates that manual saving itself dates from the era of floppy disks when saving took a loooong time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions