Recent Posts

Pages: [1] 2 3 ... 10
1
SlickEdit® / Re: pop-bookmark switching splitter windows
« Last post by Graeme on January 20, 2018, 11:32:01 pm »
Forgot to mention, if you turn off "one file per window" - tools -> options -> editing -> editor windows  -  the problem might go away, I'm not sure.  It seems a bit erratic.
2
SlickEdit® / Re: pop-bookmark switching splitter windows
« Last post by Graeme on January 20, 2018, 11:27:52 pm »
I've written some code that lets you save and restore the active editor windows and line numbers for the document groups in the current window.  So you could set up two views into the same buffer in two different windows, then call save_win_list.  To restore, call restore_win_list.  It took a lot of trial and error and it might not be exactly what you want but you can probably change it or ask slickedit support for help, since you have maintenance and support.  e.g. currently if one of the edit windows has been closed before you run the restore, it doesn't get re-opened.
You might be able to add a wrapper around pop-bookmark that can figure out whether you need to adjust the active windows and line numbers if pop-bookmark has done the wrong thing.  You could also generalize it so that there is one "win_list" array for every buffer.

You can also use the slickedit functions save-named-state and load-named-state to save/ restore an edit session.


Code: [Select]
#include "slick.sh"

#pragma option(strictsemicolons,on)
#pragma option(strict,on)
#pragma option(autodecl,off)
#pragma option(strictparens,on)


static int GetEditorCtlWid(int wid)
{
   int editorctl_wid = wid._MDIGetActiveMDIChild();
   if ( editorctl_wid != null && _iswindow_valid(editorctl_wid) && editorctl_wid._isEditorCtl()) {
      return editorctl_wid;
   }
   if (_no_child_windows())
      return -1;

   return _mdi.p_child;
}

struct x1 {
   int wid;
   _str buf_name;
   int xp_line;
   int xp_col;
};

static x1 win_list[];

_command void save_win_list()
{
   int mx = 16;
   int wid1 = p_window_id;
   x1 xx1;
   int nxw;
   win_list._makeempty();
   int first = GetEditorCtlWid(p_window_id);
   if ( first <= 0 ) {
      p_window_id = wid1;
      p_window_id._set_focus();
      return;
   }
   p_window_id = first;
   while ( --mx ) {
      if ( !_iswindow_valid(p_window_id) || !p_window_id._isEditorCtl() ) {
         //say('vvv');
         p_window_id = wid1;
         p_window_id._set_focus();
         return;
      }
      p_window_id._set_focus();
      xx1.wid = p_window_id;
      xx1.buf_name = p_buf_name;
      xx1.xp_line = p_line;
      xx1.xp_col = p_col;
      win_list[win_list._length()] = xx1;
      //say(mx :+ ' z ' :+ p_buf_name :+ ' ' :+ win_list._length());
      next_tab_group();
      nxw = GetEditorCtlWid(p_window_id);
      if ( nxw <= 0 ) {
         p_window_id = wid1;
         p_window_id._set_focus();
         return;
      }
      p_window_id = nxw;
      if ( p_window_id == first ) {
         //say(mx :+ ' ' :+ p_buf_name);
         p_window_id = wid1;
         p_window_id._set_focus();
         return;
      }
   }
   p_window_id = wid1;
   p_window_id._set_focus();
}


_command void restore_win_list()
{
   int wid1 = p_window_id;
   int kk;
   if ( win_list._length() == 0 ) {
      //say('yyy');
      return;
   }
   for ( kk = 0; kk < win_list._length(); ++kk  ) {
      if ( !_iswindow_valid(win_list[kk].wid) || !win_list[kk].wid._isEditorCtl() ) {
         return;
      }
      //say('rrr' :+ ' ' :+ win_list[kk].buf_name);
      p_window_id = win_list[kk].wid;
      p_window_id._set_focus();
      edit(win_list[kk].buf_name);
      p_line = win_list[kk].xp_line;
      p_col = win_list[kk].xp_col;
      center_line();
   }
   p_window_id = win_list[0].wid;
   edit(win_list[0].buf_name);
}

3
SlickEdit® / Re: Slickedit holding file open
« Last post by Clark on January 20, 2018, 12:51:07 pm »
You can increase the load partial file size or force SlickEdit to always load the entire file (not recommended for huge files). The default is 8 megabytes (Tools>File Options>Load, Load Partially when files larger than (KB)).

If you are having a problem with SlickEdit holding onto the file after closing, please indicate your emulation and the precise steps to reproduce.
4
SlickEdit® / Re: Using as C source editor is there a matching braces in same color
« Last post by jaysami on January 20, 2018, 06:49:29 am »
Could you please tell me how to turn it on.

Thanks.
5
SlickEdit® / Re: shell heredoc wrong color coding
« Last post by Clark on January 20, 2018, 01:10:31 am »
Reproduced. This will be fixed in 22.0.2 which will be available in 2-3 weeks (not hot fixable). Thanks for reporting this.
6
SlickEdit® / Re: pop-bookmark switching splitter windows
« Last post by microvu on January 19, 2018, 11:28:02 pm »
Thanks for the work on this, especially since it was difficult for you to reproduce. If there were a setting that fixed it I'd be thrilled, but it sounds like it's not been thought about before.
I do have maintenance so that's not an issue. I agree this might not be easy to fix, but it happens often for me so it's worth trying. I delved into SlickC many years ago but this might be more than I want to take on.
Best Regards,
Guy
7
SlickEdit® / Re: pop-bookmark switching splitter windows
« Last post by Graeme on January 19, 2018, 11:07:47 pm »
ok, after a zillion attempts I finally got it to go wrong on slick 22.0.0 with a new empty config.  I'm not familiar with a window closing after push-tag pop-bookmark so I turned off "automatically close visited files" but I still couldn't repro.  I eventually got a scenario to repro by having the second copy of the other window already visible/ active in the second window when push-tag is used in the first window.  It seems that pop-bookmark and go-to bookmark prefer the visible copy of the file to go to which isn't what you want in this case. 

You should report it to SlickEdit (just refer them to this thread) - I'm not sure how you do that if you don't have maintenance and support.

I'm not sure it's easily fixable. push-bookmark would probably have to record the window-id or maybe the system needs to keep track of which window a buffer was last active in.

8
SlickEdit® / Slickedit holding file open
« Last post by brettacook on January 19, 2018, 09:44:25 pm »
I opened file 'axf.out' in slickedit.  I then, on the command line, tried to do 'echo hi > axf.out', and got the error message "The process cannot access the file because it is being used by another process.".  When I use process explorer to find out what process is holding the file open, it is 'vs.exe'.

EDIT:  It still holds it open even after I close the file in SlickEdit.
9
SlickEdit® / Re: Nested struct type...
« Last post by Dennis on January 19, 2018, 06:45:59 pm »
ANSI-C doesn't recognize classes, templates, basically everything C++.  Also, ANSI-C handles scoping for nested structs by ANSI-C rules, not C++ rules.

If your code is straight C, and not clean enough to just be parsed as if it were C++, like the Linux kernel headers, then you want to use the ANSI-C document mode for those files.

Most other things are the same with respect to syntax expansion and smart editing and tagging.
10
SlickEdit® / Re: Nested struct type...
« Last post by joecar on January 19, 2018, 06:40:37 pm »
What are the differences between the document modes "C/C++" and "ANSI-C".

Since the source code I'm working on uses GCC and GCC extensions, am I losing anything by setting the mode to ANSI-C...?
Pages: [1] 2 3 ... 10