Re: [textadept] Re: using ctags

From: Robert <ro....at.web.de>
Date: Tue, 24 Aug 2010 17:48:55 +0200

On Fri, Aug 20, 2010 at 12:44 AM, Olzvoi <olz....at.gmail.com> wrote:
> that helped, thanks mitchel. here is a revised and usable version. but
> i have some more questions to optimize/clean the code - is there
> already implemented functions or easier ways for following tasks:
>
>  * switching the buffer in a view, when you have a buffer object
> (table) - not the index for the buffer. i have done:
> "view:goto_buffer(buffer_index(my_buffer), true)", buffer_index() is
> my local function.
>  * finding the first view or all views containing a given buffer, i
> have done get_view_with_buffer(b) function, see the code.
>  * finding the buffer with given filename, my local function
> get_buffer_with_filename(f).
>
> olzvoi
>

Don't know about any easier ways, but it might be worth creating a
"utils" module one day.

I tried this out and worked well, after I figured out that I need
"exuberant ctags".
Experimenting a bit with I thought it would be nice not to be able to
switch to the
"tag buffer" in the "code view" so I changed the ctrl-tab short cuts:

keys['c\t'] = { function()
                  local buffer = buffer
                  if buffer._type == panel.b_type then
                    return true
                  else
                    if _BUFFERS[buffer_index(buffer)+1]._type ==
panel.b_type then
                      view:goto_buffer(2, false)
                    else
                      view:goto_buffer(1, false)
                    end
                  end
                end
                }
keys['cs\t'] = { function()
                  local buffer = buffer
                  if buffer._type == panel.b_type then
                    return true
                  else
                    if _BUFFERS[buffer_index(buffer)-1]._type ==
panel.b_type then
                      view:goto_buffer(-2, false)
                    else
                      view:goto_buffer(-1, false)
                    end
                  end
                end
                }

This is not perfect yet, but maybe you can use it.

Robert
Received on Tue 24 Aug 2010 - 11:48:55 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:51:02 EST