Author Topic: Newbie question: Setting path display  (Read 18513 times)

iman

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Newbie question: Setting path display
« on: December 26, 2006, 03:26:16 PM »
The file paths used on my project are very long. I like to set up Slickedit so that I can see 2 files side by side. The problem is that the path names are so long that I cannot see the actual filenames in the top pane of each window. All I see is the beginning of the path (which is the same for each file). I would like to just see the filename with no path.

Is there a way to tell Slickedit to display only the filename and not the full path + filename?

Thanks,

Bob

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Newbie question: Setting path display
« Reply #1 on: December 27, 2006, 10:26:33 PM »
Try putting this in a macro file and loading it:
Code: [Select]
void _switchbuf_p_caption()
{
   if (_no_child_windows()) {
      return;
   }
   p_DocumentName=strip_filename(_mdi.p_child.p_buf_name,'P');
}

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Newbie question: Setting path display
« Reply #2 on: December 27, 2006, 10:41:38 PM »
Try putting this in a macro file and loading it:
Code: [Select]
void _switchbuf_p_caption()
{
   if (_no_child_windows()) {
      return;
   }
   p_DocumentName=strip_filename(_mdi.p_child.p_buf_name,'P');
}

This doesn't work for me.  I suspect it's not a good idea coz p_DocumentName is a property set by Slick and shouldn't be changed unless you have inside info that it's ok to change it.  Nice try if it works   :)   I tried setting p_caption of the mdi child window but (like toolbars) I think this can only be set on Window creation and can't be changed. 

This problem is really a slickedit bug coz the title bar ought to shrink the filename as it does in other places - however it might be harder to determine the amount of space in the title bar.

Graeme

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Newbie question: Setting path display
« Reply #3 on: December 27, 2006, 10:43:46 PM »

Quote
This doesn't work for me.

oops, it does work - forgot to load the macro!
I still have reservations about whether it's a good idea though ?

Graeme

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Re: Newbie question: Setting path display
« Reply #4 on: December 29, 2006, 01:16:24 PM »

I still have reservations about whether it's a good idea though ?

FWIW, I have this note (for the function shown above) in my macro file:
Code: [Select]
// From SlickEdit Tech support

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Newbie question: Setting path display
« Reply #5 on: December 29, 2006, 09:49:13 PM »

I still have reservations about whether it's a good idea though ?

FWIW, I have this note (for the function shown above) in my macro file:
Code: [Select]
// From SlickEdit Tech support

ok, cool.  After I wrote the above comment I looked up p_DocumentName in the help which seemed to indicate it would be reasonably harmless to change it - I guess the shortened name might turn up in places where you would want to see the full path.  A possibility is to add the path to the end and use set-var on the cmd line to change def_titlebar_extra_width according to screen space.  On my machine, the title bars get refreshed by switching away from and back to SE.


Code: [Select]
int def_titlebar_extra_width = 350;

void _switchbuf_p_caption()
{
   if (_no_child_windows()) {
      return;
   }
   p_DocumentName=strip_filename(_mdi.p_child.p_buf_name,'P') :+ '  ' :+
      _mdi.p_child._ShrinkFilename(strip_filename(_mdi.p_child.p_buf_name,'N'), def_titlebar_extra_width);
}

Graeme

iman

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Newbie question: Setting path display
« Reply #6 on: January 04, 2007, 03:45:55 PM »
I tried the macro that you suggested. It don't work. It also crashed my SlickEdit program. When the program starts up it comes up with the following error message:

Stack trace written to file: C:\DOCUME~1\rweiman\LOCALS~1\Temp\vsstack
 Control -mdi referenced but does not exist
smallpath.ex 46 _switchbuf_p_caption(,W,<empty>,-1)   p_window_id: 36   p_object: OI_FORM   p_name:
files.ex 8236 call_list(_switchbuf_,,W,<empty>,-1)   p_window_id: 36   p_object: OI_FORM   p_name:
stdprocs.ex 12067 switch_buffer(,W,<empty>,-1)   p_window_id: 36   p_object: OI_FORM   p_name:
stdprocs.ex 11815 _on_got_focus()   p_window_id: 36   p_object: OI_FORM   p_name:

The program will not run. It will not respond to any commands. I have to use Task Manager to close it.

mgweeks

  • Community Member
  • Posts: 24
  • Hero Points: 1
Re: Newbie question: Setting path display
« Reply #7 on: January 04, 2007, 05:36:03 PM »
Just as a curiosity, the default title bars on my version of SE (11.0.2 Linux) show the full file path but they are right aligned so that I can see the filename without any problem. The tabs show just the file name and show the full path when I hover over them. Perhaps it's a difference between Windows and Linux versions of SE (or I am totally misunderstanding the original question :)). I know this does nothing to resolve the original question by wanderer so please excuse me if it offends.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Newbie question: Setting path display
« Reply #8 on: January 04, 2007, 08:45:33 PM »
I tried the macro that you suggested. It don't work. It also crashed my SlickEdit program. When the program starts up it comes up with the following error message:

Stack trace written to file: C:\DOCUME~1\rweiman\LOCALS~1\Temp\vsstack
 Control -mdi referenced but does not exist
smallpath.ex 46 _switchbuf_p_caption(,W,<empty>,-1)   p_window_id: 36   p_object: OI_FORM   p_name:
files.ex 8236 call_list(_switchbuf_,,W,<empty>,-1)   p_window_id: 36   p_object: OI_FORM   p_name:
stdprocs.ex 12067 switch_buffer(,W,<empty>,-1)   p_window_id: 36   p_object: OI_FORM   p_name:
stdprocs.ex 11815 _on_got_focus()   p_window_id: 36   p_object: OI_FORM   p_name:

The program will not run. It will not respond to any commands. I have to use Task Manager to close it.


First of all, make a backup of your slick config folder.

To get SE working again, find the macro file where you put the macro e.g. vusrmacs.e and rename it to hide-vusrmacs.e or something.  Delete the corresponding ex file - e.g. delete vusrmacs.ex.  Now try running slick.  If it still crashes, shutdown slick, then delete the file vslick.sta in your config folder and run slick.  It should run without crashing now.

What version of slick are you using?  Does slick crash at startup with the macro that Wanderer posted or just with the one I posted?  I use slick V11.0.2 with no hotfixes and slick starts up ok with the above macro loaded  - though if I have split windows it gets the window layout messed up.

Does slick crash just at startup?  - i.e. if you get slick running, then load the above macro, do the title bars show the info you want without crashing and the crash only comes at startup?

Graeme

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Newbie question: Setting path display
« Reply #9 on: January 04, 2007, 09:46:47 PM »
Just as a curiosity, the default title bars on my version of SE (11.0.2 Linux) show the full file path but they are right aligned so that I can see the filename without any problem. The tabs show just the file name and show the full path when I hover over them. Perhaps it's a difference between Windows and Linux versions of SE (or I am totally misunderstanding the original question :)). I know this does nothing to resolve the original question by wanderer so please excuse me if it offends.


Maybe whatever window manager Slick uses on Linux provides a right alignment option and Windows doesn't.

Graeme

iman

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Newbie question: Setting path display
« Reply #10 on: January 05, 2007, 06:36:53 PM »
I had originally tried Wanderers macro. I tried Graeme's version and it does the same thing. I am using the latest version of SlickEdit without any updates.

On Starting up Slickedit it displays the previous stack trace message. On top of that is a Window that says "Slick - C error, control -mdi referenced but does not exist. File = smallpath.ex offset - 46"

If I click OK. I have the Stack Window message. If I close that, then the Slick - C error comes back"

Last time I reinstalled Slickedit to get it working. I will try your instructions instead

SlickEdit Support

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 384
  • Hero Points: 29
Re: Newbie question: Setting path display
« Reply #11 on: January 05, 2007, 07:06:03 PM »
Remember folks, that if you've loaded a macro that doesn't seem to be working so well, you can unload it via Macro-->Unload Module and try again.  If you have a module called my_caption.e, you will see it in this dialog.

With the above macro, you will see some peculiarities with your File Tabs, as well as places like the Diff dialog that has a button (B} that allows you to Diff files from the buffers.  We pull that file and path info into the Path's for diffing and you will see that it is not an acceptable path.

Bob, we are looking for ways to make this easier for the user, more configurable, and stable.

Best,
SlickEdit Support

iman

  • Junior Community Member
  • Posts: 4
  • Hero Points: 0
Re: Newbie question: Setting path display
« Reply #12 on: January 05, 2007, 07:45:55 PM »
Of Course, the Macro Unload does not help in my case at all. I cannot execute ANY commands in slickedit. The error windows have the focus and will not release it. Closing the error windows causes them to immediately reopen.

I can not do a Macro Unload

SlickEdit Support

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 384
  • Hero Points: 29
Re: Newbie question: Setting path display
« Reply #13 on: January 05, 2007, 08:35:40 PM »
Hi Bob,

It's a knucklebuster, but try "Ctrl+Shift+Alt+F2".  This will allow you to escape out of most macros/something like this.  SlickEdit will pop another Slick-C stack telling you which macro you were in and you may be able to close out of the existing stack window(s).

Another option, and one that will get you back in business, is to revert to a default configuration.

To reset your configuration, do the following:
1) Exit out of SlickEdit
2) RENAME the top level config directory.  Something like this for Win:
C:\Documents and Settings\YOUR_USERNAME\My Documents\My SlickEdit Config\
-  or this for *nix: 
/home/username/.slickedit---this RENAMED dir will be your backup.
3) Restart SlickEdit (a new configuration will be created, putting you back into an out-of-box state).

If this gets you back where you want, but you have some config info that you want back like color coding and keybindings, let us know and we'll post a short note on how to load those files from your old config dir, hence the reason to NOT delete it.

Best,
SlickEdit Support

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Newbie question: Setting path display
« Reply #14 on: January 05, 2007, 10:26:47 PM »
Another option, and one that will get you back in business, is to revert to a default configuration.

To reset your configuration, do the following:
1) Exit out of SlickEdit
2) RENAME the top level config directory.  Something like this for Win:
C:\Documents and Settings\YOUR_USERNAME\My Documents\My SlickEdit Config\
-  or this for *nix: 
/home/username/.slickedit---this RENAMED dir will be your backup.
3) Restart SlickEdit (a new configuration will be created, putting you back into an out-of-box state).

If this gets you back where you want, but you have some config info that you want back like color coding and keybindings, let us know and we'll post a short note on how to load those files from your old config dir, hence the reason to NOT delete it.

Best,
SlickEdit Support

So what is the difference between starting a new config directory and deleting vslick.sta ?

Graeme