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

From: Andy Lima <andysky....at.gmail.com>
Date: Thu, 14 May 2009 04:37:21 +0100

> This would work. You can store a variable like 'previous_buffer' in
> the global table _G if you'd like.

Ok, but how do I get the current buffer index? ..In order to later switch to
it with "view:goto_buffer(previous_buffer_index, true)"..

On Thu, May 14, 2009 at 4:24 AM, mitchell <mforal.n....at.gmail.com> wrote:

>
> 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.
>
> -Mitchell;
> >
>
Received on Wed 13 May 2009 - 23:37:21 EDT

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