Re: Ctrl-Tab to go back to the most-recently-used buffer

From: mitchell <mforal.n....at.gmail.com>
Date: Wed, 13 May 2009 20:28:20 -0700 (PDT)

Hi,

> > ...Now, I need to implement a way to go back to the most-recently-used
> > buffer (in some editors, like Geany, this is what Ctrl-Tab does) --
> > basically, to have Ctrl-Tab switch to the previous buffer I was
> > editing -- just this, this is what I need.
>
> > I guess it can be done with code like "textadept.events.add_handler
> > ('buffer_switch', function() .. )" and in that function() I'd store
> > the previous (or current?) buffer being edited (in an environment
> > variable? or some global variable for scripts? -- do we have this?)
> > and then I'd set up a keystroke like Ctrl+Tab to switch to that
> > buffer...
>
> > -- Is this implementation the best?  And, if so, how can I store the
> > value of the previous (or current) buffer being edited?
>
> This would work. You can store a variable like 'previous_buffer' in
> the global table _G if you'd like.

Sorry, I forgot to add that the current buffer is always stored in the
global 'buffer' variable.

-Mitchell;

>
Received on Wed 13 May 2009 - 23:28:20 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:37:52 EST