Author Topic: <ctrl-~> when using one-file-per windows issue. (CAS-63927-T984)  (Read 2078 times)

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Hi All,

I thought I'd post this publicly to see what other though about this issue. I am liking the new MDI groups and am moving to one-file-per window to make full use of them. Mainly because they look so cool :)

Quote
0) Close all files.
1) Set up SE to use one file per window.
2) Open any .cpp file.
3) Split the window vertically.
4) Use <ctrl>-~ to open the corresponding .h file.
5) Use <ctrl>-~ to go back to the .cpp file.
6) The cursor goes to the .cpp file in the other window.

I would expect that <ctrl>-~ would cycle between files in the same MDI group.

I split the windows a lot and quite often have the same file open in different MDI groups. The example above is one example where SE doesn't behave how I would expect. I would expect that when SE wants to magically go to a file that it should always prefer the MDI group that currently has focus. Another example of this issue is that it is not possible to open the .h file in the MDI group which does not already have it. SE just goes to the already open .h file.

Cheers,
--
Greg.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4157
  • Hero Points: 294
Re: <ctrl-~> when using one-file-per windows issue. (CAS-63927-T984)
« Reply #1 on: June 26, 2013, 12:11:13 pm »
The window search order is configurable but not documented. It's a global setting but you could wrapper any command with any setting and  save and restore the setting.

We may add this to the GUI at some point. It has MANY options including an option for making SlickEdit act exactly like visual studio ('N' - option but Smart next window style must be set to "Smart next window").

Create a macro file with the code below in it. Then run the command that it defines to change the find window option.

#include "slick.sh"
_command void set_find_window_options_my_way()
{
   // This is the default setting
   //
   // Visable current tab Group, Visible current Mdi window
   // Visable Anywhere, current tab Group, current Mdi window, Anywhere
   //_default_option(VSOPTIONZ_DEFAULT_FIND_WINDOW_OPTIONS,"VG,VM,VA,G,M,A");

   //
   // This is probably what you want
   //
   // current tab Group first
   _default_option(VSOPTIONZ_DEFAULT_FIND_WINDOW_OPTIONS,"G,VG,VM,VA,M,A");

   // Indicate config changed so option gets saved
   _config_modify_flags(CFGMODIFY_OPTION);
}

Hope this helps. Usually, users want to view multiple files at once which is why the default settings are what they are.

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: <ctrl-~> when using one-file-per windows issue. (CAS-63927-T984)
« Reply #2 on: June 27, 2013, 05:54:11 am »
Thanks Clark,

I'll give this a go. I understand what you say about people wanting to view multiple files at once. But I think you also need to consider that people want to view different positions of the same file. I'm finding this difficult at the moment as SE seems to navigate back to the first window where the file was opened whenever it wants to do something smart.

In fact it seems to be impossible to open a file in another mdi group if its already in another group. For example if you have a file open in the LHS group and with the focus in the RHS group try to open the file to get another copy there SE just navigates back to the LHS group. I'm finding it hard to come to terms with this as it doesn't make much sense to me - is it really the desired behaviour?

I'll give those options a try.

Thanks!
--
Greg.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4157
  • Hero Points: 294
Re: <ctrl-~> when using one-file-per windows issue. (CAS-63927-T984)
« Reply #3 on: June 27, 2013, 11:53:18 am »
If you don't want SlickEdit to find windows outside the current tab group, make the find window options just a "G" and it will only look in the current tab group. This will cause SlickEdit to open an additional window for any file which does not have a window in the current tab group.

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: <ctrl-~> when using one-file-per windows issue. (CAS-63927-T984)
« Reply #4 on: June 27, 2013, 11:44:10 pm »
Hi!

With my extensive 2 second testing, "G" does seem to do the trick. I'll play with these more to tune SE to the way I want :). Maybe these options need to be more visible!

Thanks!
--
Greg.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4157
  • Hero Points: 294
Re: <ctrl-~> when using one-file-per windows issue. (CAS-63927-T984)
« Reply #5 on: June 27, 2013, 11:55:53 pm »
When I designed it I wasn't sure if anyone would need it. No other product has anything like it. We will eventually put this on the dialog under the edit windows section.

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: <ctrl-~> when using one-file-per windows issue. (CAS-63927-T984)
« Reply #6 on: June 28, 2013, 12:03:02 am »
Good job in thinking ahead to make it so configurable. Must make testing hell though! :)