Bram Moolenaar wrote:
> David Kotchan wrote:
>
>
>> I've discovered a problem with Vim 7.2 when using the CursorMoved
>> autocommand under Windows. The problem is only evident when editing
>> files on a Windows share, rather than editing a file on the local
>> machine. (Presumably the same issue is occurring even when editing on
>> the local machine, but is only obvious when editing files on a Windows
>> share.)
>>
>> The problem does not occur under Vim 7.1, so I conclude something has
>> changed with how CursorMoved events are handled in Vim 7.2.
>>
>> Repro steps: I use the clever 'halfmove.vim' script created by Andy
>> Spencer, which uses the CursorMoved autocommand on each keystroke. My
>> problem can be easily repro'd: with the halfmove script in the \plugin
>> folder, simply use Vim 7.2 to edit a file on some remote share (eg. 'vim
>> \\FRED\barney.txt', barney.txt being some file on a remote machine named
>> FRED). Then hold down the 'j' or 'k' keys to scroll the text window. The
>> window scrolls very slowly and with fits and starts. In worst cases
>> scrolling is so slow that barney.txt cannot usefully be edited. Network
>> activity is also very high during the scrolling.
>>
>> Deleting the 'halfmove.vim' script from the \plugin folder, or
>> (alternately) commenting out the CursorMoved autocommand from that
>> script, cures the problem. Vim 7.2 then becomes as speedy as Vim 7.1.
>>
>> Since the issue does not occur for Vim 7.1, I'm sticking with Vim 7.1
>> for now (because I really like the functionality offered by the
>> halfmove.vim script, and I have to edit quite a few files on remote
>> shares). But evidently something significant has changed in how Vim 7.2
>> handles the CursorMoved event.
>>
>> Experiments show that the slowdown occurs even when CursorMoved is set
>> up to call an empty (no-op) function; that is, it's not the work being
>> done in the function that causes the slowdown, but the fact that
>> CursorMoved is calling a Vim function at all.
>>
>> I've experimented with several of the source code files for 7.2 in an
>> attempt to figure out why/where the issue is occurring, but so far
>> haven't found a solution. Can anyone offer any insight? What changes
>> were made in 7.2's handling of CursorMoved that might be causing this
>> problem?
>>
>> I've seen the issue under both Vista and WinXP. I'm using the console
>> mode version of Vim 7.2.
>>
>> Any help appreciated.
>>
>
> What is the autocommand being executed? Can you reproduce it with a
> very simple script?
>
> I guess it's caused by the file name being expanded into a full path.
> I need to know what you are doing to see if it can be avoided.
>
>
Here is a simple script that reproduces the problem. In fact, this *is*
the CursorMoved autocommand used in the script I referred to above
(halfmove.vim):
--------------------
function HM_Inc()
if (!exists("s:reset"))
let s:reset = 1
endif
let s:reset += 1
endfunction
autocmd CursorMoved * call HM_Inc()
--------------------
Thanks
--David
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---