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

From: Robert Gieseke <rob.g.att.web.de>
Date: Thu, 23 Mar 2017 22:12:08 +0100

Hallo Sebastian,

Am 23/03/17 um 19:09 schrieb cryo shock:
> Guten Tag Robert ;),
>
[...]
> Now that we've already begun, may I ask another question? I would like
> to add documentation to the snippets. I assume that simply putting a
> third dash before "-- emphasize text that is highlighted" won't do the
> trick. When you comment the documentation with -- or --- then the text
> doesn't pop up in the snippet menu (what I totally agree with). But what
> I imagine is:
> When you open the snippet context menu, you have a third section after
> "Trigger" and "Snippet Text" like "Comment" or "Documentation".
>
> Is this somehow achievable without using additional software?

I don't fully understand your idea but you can have a look at the
_select function in `modules/textadept/snippets.lua`. It fills the
`ui.dialog.filteredlist` with the available snippets.

You could simply create a table with your trigger, snippets and
(additional) documentation. This could be part of your ConTeXt module,
so you just create a table with the snippet entries and documentation
you want.

Let us know if you need a more concrete example, maybe trying some of
the examples in the `ui.dialogs` documentation is a good start.

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 Thu 23 Mar 2017 - 17:12:08 EDT

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