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

From: Pedro Andres Aranda Gutierrez <paaguti.att.gmail.com>
Date: Sun, 28 May 2017 09:35:40 +0200

My solution is to include a binding for textadept.snippets._cancel_current()
in the map:

  _G.keys.latex = {
    ['esc'] = {
      ['cg'] = function() return textadept.snippets._cancel_current() end,
      ...

I use Ctrl-g because of my Emacs background :-P
Best, /PA

On 27 May 2017 at 12:43, Pedro Andres Aranda Gutierrez <paaguti.att.gmail.com>
wrote:

> Hey.
>
> I have checked with the latest HG and there is a CAVEAT... If you already
> use the ESC key in a nested map, it won't work.
>
> I know it sounds far fetched. However I'm convoluted enough to have such a
> thing :-P
>
> Best PA
>
> El 27 may. 2017 12:01 p. m., "cryo shock" <axteffekt.att.gmail.com> escribió:
>
>> Thanks from me as well Mitchell!
>>
>> 2017-05-27 11:29 GMT+02:00 Pedro Andres Aranda Gutierrez <
>> paaguti.att.gmail.com>:
>>
>>> Cool... Will check & report back
>>>
>>> El 27 may. 2017 6:11 a. m., "Mitchell" <m.att.foicica.com> escribió:
>>>
>>>> Hi,
>>>>
>>>> On Tue, 9 May 2017, Mitchell wrote:
>>>>
>>>> Hi Robert,
>>>>>
>>>>> On Sun, 7 May 2017, Robert Gieseke wrote:
>>>>>
>>>>> Am 07/05/17 um 14:42 schrieb Mitchell:
>>>>>>
>>>>>>> You might be very right about this. But imagine a user who inserts a
>>>>>>>> snippet and deletes it right-away because he's had another idea or
>>>>>>>> he
>>>>>>>> pasted the wrong snippet for example. I think this could be pretty
>>>>>>>> common,
>>>>>>>> If you delete the whole snippet, then again TA will jump to the
>>>>>>>> first line
>>>>>>>> and delete the first symbol.
>>>>>>>>
>>>>>>>
>>>>>>> I understand, and that is what "Tools -> Snippets -> Cancel Snippet"
>>>>>>> (Ctrl+Shift+K) is for. I will make a note to look into this though. I
>>>>>>> appreciate the details of your report.
>>>>>>>
>>>>>>
>>>>>> Maybe it would be possible to have the shortcut as `Esc` and even
>>>>>> indicate that one is in "Snipper-Insert" mode (in the status bar or by
>>>>>> changing the color of a margin or something)?
>>>>>>
>>>>>
>>>>> That is an interesting idea, at least with the "Esc" key. I will look
>>>>> into this. Thanks for the suggestion.
>>>>>
>>>>
>>>> I've committed a change[1] that binds the "Esc" key to "Cancel Snippet"
>>>> when a snippet is active. (If a snippet is not active, the usual Esc
>>>> behavior occurs.) I think snippet placeholders are indication enough that a
>>>> snippet is active. I don't think there is a need to update the statusbar or
>>>> change a margin color.
>>>>
>>>> Cheers,
>>>> Mitchell
>>>>
>>>> [1]: http://foicica.com/hg/textadept/rev/aba084a8520d
>>>> --
>>>> 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
-- 
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 Sun 28 May 2017 - 03:35:40 EDT

This archive was generated by hypermail 2.2.0 : Sun 28 May 2017 - 06:33:39 EDT