Re: [code] [textadept] Is there a way to enclose text in Snippets?

From: Robert Gieseke <rob.g.att.web.de>
Date: Fri, 24 Mar 2017 08:21:24 +0100

Am 24/03/17 um 02:59 schrieb cryo shock:
> I noticed some other things about pasting snippets as well:
[snip]

Maybe Mitchell has more to say on the %0 ...

>
> Now to the "Comment" column in the snippet context menu:
[..]
> I'd like to add a third column so that the menu looks like this:
>
> Trigger | Snippet Text | Comment

[..]
I wouldn't start with trying to modify the original `_select` function,
maybe it's easier with something like:

keys.ck = function()
  local items = {
    'bf', snippets.bf, "Bold",
    'em', snippets.em, "Emphasize"
  }
  local button, i = ui.dialogs.filteredlist{
    title = _L['Select Snippet'], columns = {_L['Trigger'], _L['Snippet
Text'], 'Doc'},
    items = items, width = CURSES and ui.size[1] - 2 or nil
  }
  if button == 1 and i then textadept.snippets._insert(items[i * 3 - 1]) end
end

Cheers,
Robert

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Fri 24 Mar 2017 - 03:21:24 EDT

This archive was generated by hypermail 2.2.0 : Fri 24 Mar 2017 - 06:54:33 EDT