Author Topic: Untitled/Unsaved files  (Read 815 times)

Tim Kemp

  • Senior Community Member
  • Posts: 514
  • Hero Points: 83
Re: Untitled/Unsaved files
« Reply #15 on: August 14, 2015, 12:39:42 am »
As long as it doesn't save the unnamed files on loss of focus you can name them anything unique.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4269
  • Hero Points: 311
Re: Untitled/Unsaved files
« Reply #16 on: August 14, 2015, 12:50:07 am »
If you had save files on lost focus on, it would. Keep in mind that if you haven't typed anything yet, the file wouldn't be modified.

The downside with this approach is that there is no way for SlickEdit to know when you no longer need the temp file.

With the other approach (keeping buf name blank), SlickEdit would delete the temp file when you set the name of the file (like save-as) or closed the file.
« Last Edit: August 14, 2015, 12:54:39 am by Clark »

Tim Kemp

  • Senior Community Member
  • Posts: 514
  • Hero Points: 83
Re: Untitled/Unsaved files
« Reply #17 on: August 14, 2015, 01:00:26 am »
I always have save on loss of focus on. I work with a lot of embedded IDEs and by setting them to automatically reload changed files I get an almost seamless editing experience.

Having temporary files get saved every time I switch over to the IDE would be bad.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4269
  • Hero Points: 311
Re: Untitled/Unsaved files
« Reply #18 on: August 14, 2015, 01:16:38 am »
I always have save on loss of focus on. I work with a lot of embedded IDEs and by setting them to automatically reload changed files I get an almost seamless editing experience.

Having temporary files get saved every time I switch over to the IDE would be bad.

Thanks for the feedback. I like to think through approaches carefully to determine which is best. I'm like the approach which doesn't have this issue and allows SlickEdit to know when to delete the temp file. It shouldn't be hard to implement.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4269
  • Hero Points: 311
Re: Untitled/Unsaved files
« Reply #19 on: August 14, 2015, 02:27:32 am »
Here's an interesting scenario to consider when dealing with saving unnamed files to temp files:

User exits slickedit with an unnamed file. SlickEdit writes data to temp file in known directory. The temp file along with the blank buffer name is stored in "vrestore.slk"

Now the user runs SlickEdit with a workspace (vs myworkspace.vpw) and exits. The unnamed file is not restored in this case. Now users exits SlickEdit which causes "vrestore.slk" to be overwritten. The user will have to remember that SlickEdit stored their unnamed file to a known directory (somewhere in the config space).

This isn't horrible but it isn't a perfect solution either.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4269
  • Hero Points: 311
Re: Untitled/Unsaved files
« Reply #20 on: August 26, 2015, 11:19:26 am »
  "I'd like autosave of unnamed buffers."

I like this idea.
Jim

Auto restore and auto save of unnamed buffers has been added to SlickEdit 2015 (not in beta yet). Optionally "save-all" is configured to save unnamed buffers to a temp file. When exiting SlickEdit, the "Save All" button on the List Modified dialog will optionally save unnamed buffers to a temp file.