Re: [code] [textadept] [ncurses] bug: extra quotes on paste

From: Rena <hyperhacker.att.gmail.com>
Date: Wed, 17 Oct 2012 22:03:28 -0500

On 2012-10-17 10:14 PM, "Mitchell" <m.att.foicica.com> wrote:
>
> On Wed, 17 Oct 2012, Rena wrote:
>
>> On 2012-10-17 3:01 PM, "Robert" <rob.g.att.web.de> wrote:
>>>
>>>
>>> Hi Mitchell.
>>> On Wed, Oct 17, 2012 at 8:38 PM, Mitchell <m.att.foicica.com> wrote:
>>>>
>>>> On Wed, 17 Oct 2012, Robert wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> when pasting something quoted, like
>>>>> "test" into textadept-ncurses I get
>>>>> "test""".
>>>>> Tested on gnome-terminal.
>>>>
>>>>
>>>>
>>>> Since this does not happen when the internal clipboard ta uses has
>>
>> quotes in
>>>>
>>>> it, this problem seems to be due to the way terminals "paste" data from
>>
>> an
>>>>
>>>> external source (e.g. clipboard). It looks like text is "typed" into
the
>>>> terminal, which can trigger 'char_added' events. I don't think there is
>>
>> a
>>>>
>>>> way to detect such a "paste".
>>>
>>> Here is the same problem with emacs:
>>>
>>
http://stackoverflow.com/questions/8033862/emacs-in-terminal-creates-fake-events-on-insert
>>>
>>>
>>>> The only option seems to be to simply turn off
>>>> _M.textadept.editing.AUTOPAIR and _M.textadept.editing.AUTOINDENT, but
>>
>> this
>>>>
>>>> is probably not desirable.
>>>>
>>> Trying to detect triple quotes or double parens after an autopairing
>>> might be an option.
>>>
>>> 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.
>>>
>>
>> Can you detect the keypress before the actual paste and adjust settings
as
>> needed?
>
>
> I don't think so since the terminal emulator handles the key shortcut to
"paste". ta only sees a character at a time and cannot distinguish if it's
being entered by the user or the "paste". If Emacs and Vim need workarounds
for this then ta probably does too.
>
> 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.
>

Yeah, was hoping it'd still signal the app somehow... I guess another
option is to detect extremely fast (and probably near constant rate)
typing, that hopefully is too fast for the most skilled typists to trigger
by accident.

-- 
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 Wed 17 Oct 2012 - 23:03:28 EDT

This archive was generated by hypermail 2.2.0 : Thu 18 Oct 2012 - 06:30:24 EDT