Topic: Toggle between 2 open buffers (1 of 5), Read 20 times
Conf: Hints, tips, shortcuts
From: Scott Lambert
Date: Wednesday, September 01, 2010 05:46 PM

On your TV remote, you probably have a button that allows you to toggle between the current channel and the previous channel regardless if they are adjacent or not.

Maybe a later version of Vedit, then what I am using, already has the ability to do this with buffers. If not, here is how to give Vedit that ability:

Either in your startup.vdm or ustartup.vdm, you need to add the following code to setup a buffer switch event macro:


reg_set(114,'
if(#108==0) {#108=1}
#108=#109
#109=buf_num
')


Afterwards, add the following to a keystroke:


[VISUAL EXIT]buf_switch(#108,event)


Now you can switch between two open buffers even if they are not sequential adjacent to one another (just like you can toggle between channels on your TV).

Reason, I need this feature is when working on Scribe, I have a macro that loads the resources.txt file into buffer 1 and then all the vdm files into buffers 2 to 18. So I need a way to quickly refer to the resources.txt file while working on a particular vdm file.

Scott

 


Topic: Toggle between 2 open buffers (2 of 5), Read 19 times
Conf: Hints, tips, shortcuts
From: Scott Lambert
Date: Wednesday, September 01, 2010 06:42 PM


For reason(s), that escape me, you have to switch buffers twice, before this setup works.

Oh bother...

Scott


On 9/1/2010 5:46:56 PM, Scott Lambert wrote:
>On your TV remote, you
>probably have a button that
>allows you to toggle between
>the current channel and the
>previous channel regardless if
>they are adjacent or not.
>
>Maybe a later version of
>Vedit, then what I am using,
>already has the ability to do
>this with buffers. If not,
>here is how to give Vedit that
>ability:
>
>Either in your startup.vdm or
>ustartup.vdm, you need to add
>the following code to setup a
>buffer switch event macro:
>
>
>reg_set(114,'
>if(#108==0) {#108=1}
>#108=#109
>#109=buf_num
>')
>
>
>Afterwards, add the following
>to a keystroke:
>
>
>[VISUAL
>EXIT]buf_switch(#108,event)
>
>
>Now you can switch between two
>open buffers even if they are
>not sequential adjacent to one
>another (just like you can
>toggle between channels on
>your TV).
>
>Reason, I need this feature is
>when working on Scribe, I have
>a macro that loads the
>resources.txt file into buffer
>1 and then all the vdm files
>into buffers 2 to 18. So I
>need a way to quickly refer to
>the resources.txt file while
>working on a particular vdm
>file.
>
>Scott

 


Topic: Re: Toggle between 2 open buffers (3 of 5), Read 22 times
Conf: Hints, tips, shortcuts
From: Christian Ziemski
Date: Thursday, September 02, 2010 12:02 PM

On 02.09.2010 00:38 vtech-tips Listmanager wrote:
> From: "Scott Lambert"
> For reason(s), that escape me, you have to switch buffers twice,
> before this setup works.

Because there is a little error in the if()
(you meant #109 there instead of #108 IMHO)

This way it is working from the first buffer switch on:

reg_set(114,'
if(#109==0) {#109=1}
#108=#109
#109=buf_num
')


Christian

 


Topic: Re: Toggle between 2 open buffers (4 of 5), Read 21 times
Conf: Hints, tips, shortcuts
From: Scott Lambert
Date: Thursday, September 02, 2010 12:38 PM


Thanks Christian. I knew it had to be something simple, but it just would not come to me yesterday. Don't know, not enough coffee (or too much)?

Scott

On 9/2/2010 12:02:29 PM, Christian Ziemski wrote:
>On 02.09.2010 00:38 vtech-tips
>Listmanager wrote:
>> From: "Scott Lambert"
>> For reason(s), that escape me, you have to switch buffers twice,
>> before this setup works.
>
>Because there is a little error in the
>if()
>(you meant #109 there instead of #108
>IMHO)
>
>This way it is working from the first
>buffer switch on:
>
>reg_set(114,'
>if(#109==0) {#109=1}
>#108=#109
>#109=buf_num
>')
>
>
>Christian

 


Topic: Toggle between 2 open buffers (5 of 5), Read 19 times
Conf: Hints, tips, shortcuts
From: Pauli Lindgren
Date: Saturday, September 04, 2010 09:00 AM

On 9/1/2010 5:46:56 PM, Scott Lambert wrote:
>On your TV remote, you
>probably have a button that
>allows you to toggle between
>the current channel and the
>previous channel regardless if
>they are adjacent or not.
>
>Maybe a later version of
>Vedit, then what I am using,
>already has the ability to do
>this with buffers. If not,
>here is how to give Vedit that
>ability:

There is no such feature in Vedit yet.
It has been requested for a long time.
That is, Back and Forward buttons that would work like those in web browsers, or like the Alt-Tab button in Windows.

It seems that this has been partially implemented in Vedit.
Looks like Vedit does keep the stack of recently used buffers. If you close a buffer, Vedit switches to whatever buffer was used before that.

I have used this functionality in my Snippets macro.
Before executing the snippet, the snippets window/buffer is closed, so Vedit switches to previous buffer to execute the snippet.

Hopefully, functions for back and forward will be implemented in Vedit soon (as macro command, toolbar buttons and keyboard shortcuts). In addition, it would be nice to have access to the buffer stack from macro language, e.g. like "Previous_Buffer(n)" (similar to Previous_Key).

--
Pauli