Re: snapopen

From: morchel <morc....at.hotmail.com>
Date: Wed, 25 Aug 2010 06:32:41 -0700 (PDT)

Not all buffers have a filename, so that should get checked, e.g.:

keys.cao = { function ()
  if buffer.filename then
    _m.textadept.snapopen.open({ buffer.filename:match('(.+)[/\\]') })
  end
end }

Regards, Martin

On 4 Aug., 10:00, Robert <ro....at.web.de> wrote:
> On Wed, Aug 4, 2010 at 1:42 AM, phayz <russelldicken....at.gmail.com> wrote:
> > On Jun 30, 1:22 pm, mitchell <c....at.caladbolg.net> wrote:
> >>Snapopenfor ta:http://caladbolg.net/textadeptwiki/index.php?n=Main.Snapopen
>
> >> Kind of like:http://www.upperbound.net/snap-open/
>
> >> Currently I set `_m.textadept.snapopen.PATHS = { 'path/to/rails/app' }` for Rails work. It gets the job done.
>
> >> mitchell
>
> > Us usual I have to ask...how do you "activate" the snap open
> > functionality? Does it need to be bound to a keypress?
>
> > Regards,
>
> > Russell Dickenson
>
> I have this in my init.lua:
>
> require 'textadept.snapopen'
>
> keys.ct.t = { _m.textadept.snapopen.open, { _HOME } }
> keys.ct.u = { _m.textadept.snapopen.open, { _USERHOME } }
> -- current directory
> keys.cao = { function ()
>   local buffer = buffer
>   _m.textadept.snapopen.open({ buffer.filename:match('(.+)/') })
> end }
>
> The exclusive flag in the open function isn't checked for, I think. I
> added a hardcoded check for ".hg" directories in the add_directory
> function. (But if you don't use version control you probably don't
> need this.)
>
> I added these examples to the wiki, whose sidepane got spammed while
> everyone was on summer vacation. As it doesn't show up in the recent
> changes I don't know how to fix it.
>
Received on Wed 25 Aug 2010 - 09:32:41 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:49:35 EST