Author Topic: Why does close-all not save buffer positions?  (Read 2765 times)

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Why does close-all not save buffer positions?
« on: April 01, 2008, 08:03:00 pm »
Hi,

How come close-all (via _close_all2()) calls close_buffer() and close_window() with saveBufferPos false?

I use close-all quite often, but would prefer it to remember the buffer positions. I'd like to know if there's a good reason for it not to.

Regards

John Hurst
Wellington, New Zealand

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2290
  • Hero Points: 128
Re: Why does close-all not save buffer positions?
« Reply #1 on: April 03, 2008, 06:56:53 pm »
Hi,

How come close-all (via _close_all2()) calls close_buffer() and close_window() with saveBufferPos false?

I use close-all quite often, but would prefer it to remember the buffer positions. I'd like to know if there's a good reason for it not to.

Regards

John Hurst
Wellington, New Zealand


We could not come up with one so far, so I checked in a change for 13.0.1.

jbhurst

  • Senior Community Member
  • Posts: 405
  • Hero Points: 33
Re: Why does close-all not save buffer positions?
« Reply #2 on: April 03, 2008, 08:34:51 pm »
Cool, thanks Dan.

I'm using a modified wkspace.e in the meantime. I wrote this command:

Code: [Select]
_command void jh_close_all_but_current() name_info(',') {
  _str current_buffer = p_buf_name;
  close_all();
  edit(current_buffer, EDIT_RESTOREPOS);
}

It doesn't work very well if close-all doesn't remember the cursor position in the current buffer! (I bet there's a cleaner way to do this, but I bet it would take more code too.)

John Hurst
Wellington, New Zealand