On 10-Aug-2010 14:22, John Beckett wrote:
>> Sometimes I paste some text into the Vim command line
>> (example: type ':echo ' then Ctrl-R a to paste register a).
>>
>> If I accidentally paste a large amount (kilobytes), I have to
>> wait a very long time (several minutes) while Vim struggles
>> to handle the text. Pressing Ctrl-C has no discernible effect.
> 
> Some investigating shows that removing the following call to
> redrawcmd() fixes the problem (this is not a solution, just
> a preliminary observation):
> 
> In function getcmdline() (file ex_getln.c line 1840) we find:
> 
>     /* Always redraw the whole command line to fix shaping and
>      * right-left typing.  Not efficient, but it works. */
>     redrawcmd();
> 
> Removing that redrawcmd() makes accidental pastes of 8000 bytes
> into the command line occur in a second or so. With an unpatched
> Vim, that same paste sometimes seem to complete in a minute, and
> sometimes seems to take forever (I killed it after several
> minutes).
> 
> I have set encoding=utf-8, and I think you need that for the
> above redrawcmd() to be executed.
> 
> While I should not be pasting junk into the command line, Vim
> should not effectively hang if I accidentally do.

There's no need to modify the source code to avoid the redraw; just turn off
Arabic shaping. There was a discussion about this on this list two years ago (I
was involved, that's why I remember ;-):
    http://tech.groups.yahoo.com/group/vimdev/message/51944
    http://tech.groups.yahoo.com/group/vimdev/message/51952

Because I don't need Arabic shaping, I have this in my .vimrc:

    " Avoid command-line redraw on every entered character by turning off Arabic
    " shaping (which is implemented poorly).
    if has('arabic')
        set noarabicshape
    endif

Of course, back then we had already reached the conclusion that to fix this
properly, the implementation should be improved. Seems that nobody has taken up
that challenge yet.

-- regards, ingo

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui