Author Topic: Limit Back() and Forward() toggle between 2 buffers only?  (Read 10162 times)

RobertH2

  • Community Member
  • Posts: 20
  • Hero Points: 1
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #15 on: April 17, 2015, 02:58:07 AM »
Hi Graeme,

One of my favorite quotes about programming (and life in general) is by Will Rogers. I'm paraphrasing a bit but it goes something like this:

"It's not what you don't know that gets you in trouble, it's what you know that ain't so."

What you said about split windows in your last reply got me to thinking. And indeed, when I have just a single window open/zoomed out, and going back and forth between buffers in that window, both the keystroke and mouse click works fine 100% of the time. Also when the windows are split, but the buffers are in the same window, it also works perfectly for both key and mouse click.

The discrepancy occurs when the buffers are in two different windows and I'm switching between them. Then I loose one mouse click for every 3 clicks consistently, although the keystroke, again works perfectly. So it is something in the code for switching windows, that causes the problem, not in my code. Could you try this on your system (switching buffers between windows) and see if it fails for you too? Thanks.

I was reluctant to try the "xretrace" code because of the warnings in the post about it being:
 "beta/ use at your own risk... should still be able to save your files and restart... interferes with color modified lines".
After all, I just want to skip back and forth between 2 buffers. And I want a solid editor, I don't want to be worried about crashes, losing work or other instabilities, especially with something as trivial as buffer switching.

----

Again the split windows problem, did not occur in my macro, but in the "goback_last_buffer()" macro in the GFilemanGoback.e file that you pointed me to. If I recall correctly, this is what happened:

   1. Split the window (2 windows now showing in SlickEdit)
   2. Arrange the windows so that Window1 contains File1.txt
   3. And Window2 contains File2.txt

I want to switch between Window1/File1.txt and Window2/File2.txt. When invoking the "goback_last_buffer()" macro in the GFilemanGoback.e file the following occurred:

   4. Window1/File1.txt turned into Window1/File1.txt:1
   5. Window2 now contains 2 tabs (instead of 1) with Window2/File1.txt:2 and Windows2/File2.txt

So now there are now 2 instances of File1.txt, one in each window, with a ":" and an instance number after the file name extension.

   6. Switching between File1.txt and File2.txt now occurs in Window2 between File1.txt:2 and File2.txt.

I wanted switching to happen across windows between the two files. Not to create a separate file instance, and then switch between files in the same window, which is what happened with the "goback_last_buffer()" macro.

Hope this makes sense. BTW there were more files/buffers/tabs in each window when this happened, if that makes any difference.

And again this is for your information, if you wanted to investigate, don't do it for me, I'm happy with what I have.

Thanks again for your help Graeme.


Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #16 on: April 17, 2015, 12:58:07 PM »
The discrepancy occurs when the buffers are in two different windows and I'm switching between them. Then I loose one mouse click for every 3 clicks consistently, although the keystroke, again works perfectly. So it is something in the code for switching windows, that causes the problem, not in my code. Could you try this on your system (switching buffers between windows) and see if it fails for you too? Thanks.


Hi, yes I can reproduce this.  It's caused by the fact that when you click the mouse in a window that doesn't currently have the focus, the focus moves to that window and the mouse click is otherwise ignored.

Don't blame you for not wanting to use xretrace, though it's not beta any more but it's definitely use at your own risk.  I wish SlickEdit Incorporated would take it over and ship it as part of the product.

Thanks for the info about goback_last_buffer, I'll check into it tomorrow.  I hardly ever have two windows open, though when V19 becomes stable enough for me to take to work I might use that more.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6877
  • Hero Points: 530
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #17 on: April 17, 2015, 01:42:59 PM »
There is a "Place cursor on focus click" which defaults to "off" (Tools>Options>Editing>Editing Windows). Maybe turning it on would help.

It sound like you're not in "One file per window mode". If that's the case the above suggestion won't help. It would require some changes in the forward() and back() functions that would be quite a change (not hard to implement though). These commands are simply doing what "edit" would do.
« Last Edit: April 17, 2015, 01:54:22 PM by Clark »

RobertH2

  • Community Member
  • Posts: 20
  • Hero Points: 1
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #18 on: April 17, 2015, 02:35:05 PM »
@Clark

Thanks for responding. I am in "One file per window mode" and your suggestion worked! Thanks a lot!

About "One file per window mode" what exactly does that mean? I have a bunch of file tabs open in each window, all with different files, and I can also add file instances in additional tabs.


@Graeme

Thanks for confirming this. As you can see by Clarks response, his suggestion fixed it.

I use the split windows a lot, but I have a large 32" monitor with 2560 x 1440 resolution so it's easy to do, and it works really nicely on version 19. In fact the whole windowing is SlickEdit is great, very seamless and intuotive. Thanks again for your help...

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6877
  • Hero Points: 530
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #19 on: April 17, 2015, 04:20:22 PM »
Tools>Options>Editing>Editor Windows>Files per window set to "One file per window".

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #20 on: April 17, 2015, 07:04:45 PM »
@Clark
About "One file per window mode" what exactly does that mean?
Tools>Options>Editing>Editor Windows>Files per window set to "One file per window".
I think RH2 was asking what the conceptual meaning of "One file per window" is.  I'd like to know that, too.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6877
  • Hero Points: 530
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #21 on: April 17, 2015, 09:48:47 PM »
"One file per window" means when a new buffer is created a new edit window is created to put it in. For example, if you run the command "e *.cpp" in one file per window mode, it will create an edit window for each of those files. Each edit window is represented by a document tab. Now that SlickEdit has document tabs, it might be more understandable if the settings were "One document tab per file" and "Multiple files share document tab". Historically though, SlickEdit didn't have document tabs.

I use "Multiple files share window" mode. When I edit new files, I don't get new edit windows/document tabs.

The mode you choose is a very personal question. Usually users choose an emulation which selects this option for them.

Phil Barila

  • Senior Community Member
  • Posts: 745
  • Hero Points: 61
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #22 on: April 18, 2015, 12:46:32 AM »
OK, thanks.  I'm very much a Windows/MDI sort, so the "Multiple files share document tab" idea, while conceptually understandable, would drive me out of my mind, unless I was using a full-screen editor.  I like the current implementation, where I can have as many tab groups as I want.  I've had up to 6 across, spread over multiple monitors, when I was doing some wide-ranging refactoring.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #23 on: April 18, 2015, 09:18:17 AM »
RobertH2

Fixing goback_last_buffer to work with multiple windows isn't worth doing when your code works just fine so I've posted your macro in my "goback through buffers" thread.  Hope you don't mind.
https://community.slickedit.com/index.php/topic,9597.0.html

My xretrace macro seems ok with multiple windows so I'm gonna update it to let me step through visited buffers, which it can almost do already.

RobertH2

  • Community Member
  • Posts: 20
  • Hero Points: 1
Re: Limit Back() and Forward() toggle between 2 buffers only?
« Reply #24 on: April 18, 2015, 10:42:57 AM »
Sure Graeme, no problem, glad the macro can be useful...