Re: Snippets bug

From: mitchell <mforal.n....at.gmail.com>
Date: Mon, 24 May 2010 16:56:41 -0700 (PDT)

Robert,

On May 21, 7:22 am, Robert <ro....at.web.de> wrote:
> I think there is a bug when leaving placeholders empty in snippets.
> With the built-in "key" snippet I get
> ...rt/bin/textadept_2.2/modules/textadept/lsnippets.lua:208: bad
> argument #2 to 'text_range' (start > end)
> when I leave the first placeholder empty (pressing tab again without
> typing anything).
> [''] = { %2(func)%3(, %4(arg)) }
>
> A possible fix could be something like
> -- l. 208 in lsnippets.lua
> -- local ph_text = buffer:text_range(snippet.ph_pos, caret)
> if caret > snippet.ph_pos then
>   local ph_text = buffer:text_range(snippet.ph_pos, caret)
> else
>   ph_text = ""
> end
>
> But I'm not sure, because
> snippets.test1 = '%1 = -%1-'
> works,
> but
> snippets.test2 = '%1 = %1'
> works only without my changes above, but only after pressing tab again
> the mirroring is done.

It's a bug in lua_interface.c. Fixed in hg (r578).

Mitchell

>
> Robert
>
> --
> You received this message because you are subscribed to the Google Groups "textadept" group.
> To post to this group, send email to textadept.at.googlegroups.com.
> To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/textadept?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "textadept" group.
To post to this group, send email to textadept.at.googlegroups.com.
To unsubscribe from this group, send email to textadept+unsubscribe.at.googlegroups.com.
For more options, visit this group at http://groups.google.com/group/textadept?hl=en.
Received on Mon 24 May 2010 - 19:56:41 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:46:25 EST