Author Topic: calling save-window-config hangs slickedit  (Read 1277 times)

Graeme

  • Senior Community Member
  • Posts: 2477
  • Hero Points: 325
calling save-window-config hangs slickedit
« on: October 18, 2014, 11:59:16 am »
I have some macros xsave-session and xsave_session_plus_toolbars that call save_window_config to save session data.  The call to save_window_config hangs and I have to kill slick with task manager.  The _workspace_save_state function in wkspace.e does exactly the same thing and presumably doesn't crash.

Later...  I've discovered that if the fourth argument in the call to save_window_config has an embedded space in the path, the call hangs. i.e. if I change
#define SESSION_FOLDER_NAME 'SlickEdit Sessions'
to
#define SESSION_FOLDER_NAME 'SlickEditSessions'
the code works.
I don't mind removing the embedded space but I'm wondering whether the _workspace_save_state function will have a problem with embedded spaces too.


Code: [Select]
static int workspace_save_session(_str filename, boolean proj_only)
{
   if (filename == '')
      return 1;

   // toolbarSaveExpansion();   // another day
   int state_view_id = 0;
   int orig_view_id = _create_temp_view(state_view_id);
   p_window_id = orig_view_id;
   save_window_config(proj_only, state_view_id, false, strip_filename(filename, 'N'));
   p_window_id = orig_view_id;
   int status = _ini_put_section(filename, "State", state_view_id);
   if (status) {
      clear_message();
   }
   return status;
}

Graeme

  • Senior Community Member
  • Posts: 2477
  • Hero Points: 325
Re: calling save-window-config hangs slickedit
« Reply #1 on: October 19, 2014, 12:34:08 am »
Slick doesn't seem to have any problems with having spaces in the path of a workspace pathname so I don't know what I'm doing wrong.

Graeme

  • Senior Community Member
  • Posts: 2477
  • Hero Points: 325
Re: calling save-window-config hangs slickedit
« Reply #2 on: October 19, 2014, 10:31:00 am »
I've withdrawn the save-session functions from my posted macro because it seems slickedit has save_named_state and load_named_state

http://community.slickedit.com/index.php/topic,9389.msg45212.html#msg45212