Re: TAB instead of Ctrl-I

From: Vyacheslav Egorov <v.e.ego....at.gmail.com>
Date: Thu, 12 Feb 2009 11:31:20 +0600

In theory it should be fine, however I think you'll lose the indent
functionality normally associated with the Tab key.

Thanks.
I was adding it to key_commands.lua, but it seems that right place is
key_commands_std.lua.

As for the indenting functionality, I was able to work around it with the
following dirty patch.

--- orig/lsnippets.lua Fri Jan 30 23:36:16 2009
+++ lsnippets.lua Thu Feb 12 11:30:14 2009
@@ -178,7 +178,8 @@
     buffer:end_undo_action()
   end

- next()
+ -- treat default nil return value as true
+ return next() == nil
 end

 ---
@@ -186,7 +187,7 @@
 -- transform the entered text at all appropriate mirrors before moving on
to
 -- the next placeholder or tab stop.
 function next()
- if not snippet.index then return end
+ if not snippet.index then return false end
   local buffer = buffer
   local s_start, s_end, s_text = snippet_info()
   if not s_text then cancel_current() return end

--
e.v.e
On Thu, Feb 12, 2009 at 8:53 AM, mitchell <mforal.n....at.gmail.com> wrote:
>
> Hi,
>
> > It seems that just adding
> > keys['\t'] = { m_snippets.insert           }
> > instead of
> > keys.ci    = { m_snippets.insert           }
> > is not enough.
> >
> > Any ideas?
>
> In theory it should be fine, however I think you'll lose the indent
> functionality normally associated with the Tab key.
>
> I tried having snippets use Tab a couple years ago in SciTE-tools, but
> I couldn't get it working 100% of the time. It's been Ctrl+I ever
> since.
>
> Feel free to submit patches!
>
> -Mitchell;
> >
>
Received on Thu 12 Feb 2009 - 00:31:20 EST

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