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

From: cryo shock <axteffekt.att.gmail.com>
Date: Thu, 23 Mar 2017 19:22:55 +0100

There is another thing I should mention to be complete:

when a snippet looks like this (the way initially described):

snippets.context['emph'] = '{\\em %0<selected_text>}'

then snippets work as expecten when you paste them over highlighted text.
BUT when you use the very same snippet without highlighted text, then the
cursor jumps to the end of the snippet, and not like expected to the %0
placeholder. So what I had to to is: add a second placeholder to the
snippet:

snippets.context['emph'] = '{\\em %0%1<selected_text>}'

But I am sure that this will lead to undesired results with snippets that
contain multiple placeholders...

-- 
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 - 14:22:55 EDT

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