Snippet names

From: Robert <ro....at.web.de>
Date: Fri, 26 Feb 2010 01:41:49 -0800 (PST)

Hi,

I was trying to have snippet names like
my-snippet, my:snippet
This does not work, because the function insert in modules/textadept/
lsnippets.lua
uses word_left_extend() to select the snippet name. This function
stops at ':', '-' etc.

As I workaround I inserted the following (around line 314)
buffer.word_chars = "" --remove chars that mark word endings
buffer:word_left_extend()
buffer:set_chars_default() --restore default

Is there an easier/better way to do this? Is there any reason why
snippets name like this shuldn't be allowed? If not, I think it would
be nice If this could be included in 2.1.
Of course, the snippet names have to be declared as follows
snippets.html = {
  ['a:test'] = "a test snippet",
  -- because the Lua short cut notation is not possible
  test = '...'
}

Thanks!
Robert
Received on Fri 26 Feb 2010 - 04:41:49 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:39:32 EST