Re: [code] Feature request: snippet._insert should allow replacing the selection

From: Pedro Andres Aranda Gutierrez <paaguti.att.gmail.com>
Date: Mon, 3 Apr 2017 06:22:07 +0200

Hi,

thanks for confirming :-) BTW, all started with my own LaTEX module for
TextAdept long ago. I retook it after I saw how to bind keys to snippets...
I have seen this effect on some of my LaTEX snippets since then... It's a
bit more convoluted, but I think that once this behaviour is under control.
the other unexpected quirks will be easier to fix/understand.

Best

/PA

On 3 April 2017 at 02:56, cryo shock <axteffekt.att.gmail.com> wrote:

> He is right:
>
> When you use %<selected_text> on a single or multiple *words*, then the
> selected text gets enclosed by the surrounding code of the snippet.
> When you use %<selected_text> on a *whole line*, then the highlighted
> text gets duplicated; it gets enclosed and the selected text stays before
> the pasted snippet too.
>
> 2017-04-02 18:14 GMT+02:00 Pedro Andres Aranda Gutierrez <
> paaguti.att.gmail.com>:
>
>> PD, line 7 is also wrong!
>>
>> On 2 April 2017 at 18:12, Pedro Andres Aranda Gutierrez <
>> paaguti.att.gmail.com> wrote:
>>
>>> Hi Mitchell
>>>
>>> lots of confusion with the snippets and %<selected_text>. I think have
>>> figured out what puzzles me (see attached screenshot to follow).
>>>
>>> So left is the ini.file right is a text file. Lines 1, 2, 3 and 10 are
>>> what happens if I apply any of the snippets to a line that is completely
>>> selected: selected text is kept and result of snippet is appended at end
>>> of line. This behaviour is unexpected and cause of my woes.
>>>
>>> Lines 4,5,6 and 7 are the correct behaviour of the first snippet and
>>> that only happens when we select a line partially (a word, or a couple of
>>> words from a line.
>>>
>>> Textadept 9.3 on OSX (stock version)
>>>
>>> Best, /PA
>>> [image: Inline images 1]
>>>
>>> On 2 April 2017 at 17:36, Mitchell <m.att.foicica.com> wrote:
>>>
>>>> Hi Pedro,
>>>>
>>>> On Sun, 2 Apr 2017, Pedro Andres Aranda Gutierrez wrote:
>>>>
>>>> Hi folks,
>>>>>
>>>>> don't know if this is too difficult, but I think it is somehow not a
>>>>> moonshot. If I have a snippet like
>>>>> '\\%1(ac){%<selected_text>%2}%0'
>>>>> in a LaTEX mode, what I'm actually intending is to insert an acronym or
>>>>> convert the selected text into a new acronym. Converting IMHO means
>>>>> replacing the selection with the text resulting from applying the
>>>>> snippet...
>>>>>
>>>>
>>>> Would you please give an example of input and then an example of the
>>>> expected output? I cannot visualize what you are suggesting. Thank you.
>>>>
>>>> Cheers,
>>>> Mitchell
>>>> --
>>>> 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.
>>>>
>>>>
>>>
>>>
>>> --
>>> Fragen sind nicht da um beantwortet zu werden,
>>> Fragen sind da um gestellet zu werden
>>> Georg Kreisler
>>>
>>
>>
>>
>> --
>> Fragen sind nicht da um beantwortet zu werden,
>> Fragen sind da um gestellet zu werden
>> Georg Kreisler
>>
>
>

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellet zu werden
Georg Kreisler

-- 
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.
imagen.png
Received on Mon 03 Apr 2017 - 00:22:07 EDT

This archive was generated by hypermail 2.2.0 : Mon 03 Apr 2017 - 06:26:21 EDT