On 5/27/15 5:26 AM, Ole Laursen wrote:
> 2015-05-26 22:43 GMT+02:00 Chet Ramey <[email protected]>:
>> I did a couple of things. I added an inline _rl_wcwidth function that
>> returns 1 for all printable ASCII characters and calls the system wcwidth
>> for the rest. That should help, though it doesn't do anything for
>> characters between 128 and 256.
>>
>> The second thing is this experimental patch to text.c that uses the
>> heuristic you suggested: it assumes that a call to rl_insert will be
>> followed by other calls to rl_insert and tries to read ahead in the
>> input stream as long as the character read maps to self-insert. I've
>> attached that for folks to experiment with.
>
> I tested it with "åååå " x 50000 (so 250k characters, but perhaps 450k
> bytes) and it takes about a second now compared to several minutes
> before. Awesome! Thanks!
Good. Ultimately, the solution is bracketed paste mode. The terminal
(or emulator), knowing whether or not a particular stream of characters
is the result of a paste, can indicate the boundaries of the set of
pasted text, and readline can treat it as a simple block of characters
to insert. Readline won't have to guess.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/
_______________________________________________
Bug-readline mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-readline