nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] should Verbatim Input do what it says or what it does?


From: Benno Schulenberg
Subject: Re: [Nano-devel] should Verbatim Input do what it says or what it does?
Date: Mon, 27 Jun 2016 18:12:03 +0200

David Ramsey wrote:
> Benno Schulenberg wrote:
> > Currently, when using Verbatim Input (M-V) for inserting keystrokes
> > undecoded into the text buffer, what happens is that nano will take
> > *all* keystrokes in the input buffer and insert them verbatim into the
> > text.
> 
> The reason I originally implemented it this way is because of timing
> issues when dealing with escape sequences (which can be of arbitrary
> length,

Arbitrary length?  Surely they won't be tens or hundreds of bytes
long?  But... even if this were so, surely the codes that come after
the initial escapes (one or two or three) will all be in the printable
ascii range (0x21 - 0x7e), right?  So verbatim input could just insert
the initial 0x1b bytes and leave the rest as if they were normal
characters getting typed?

> and can overlap between different terminal types, which is why
> that section in winio.c is so heavily commented and strewn with
> hardcoded values).  And using verbatim input to see what escape
> sequences keys generate (if ncurses keystroke mapping isn't working) is
> useful sometimes.

That will work with the above method.

> If there's a way around the escape sequence stuff, the behavior should
> probably be fixed to insert only one keystroke.

Okay.

>  However, the original
> behavior of reading all keystrokes could be moved elsewhere, as it might
> be useful for implementing blacketed paste mode, which someone else
> already opened a bug for:
> 
> http://savannah.gnu.org/bugs/?40060

Bracketed paste mode...  That would have to work entirely differently;
it would have to treat reading from the input as if inserting from a file.
Currently, when you paste something with the mouse, each character is made
room for, inserted, and the undo item is updated.  Lots of overhead.  And
when undoing the paste, each line is undone separately.  The entire paste
should be undone as a whole, like an inserted file...

Anyway, entirely different matter.  :)

Benno

-- 
http://www.fastmail.com - Send your email first class




reply via email to

[Prev in Thread] Current Thread [Next in Thread]