VIM hangs at 100% CPU for 10 seconds

Bug #1242298 reported by Thanassis Tsiodras on 2013-10-20
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

After defining a rather lengthy typescript snippet (attached in the bug report), I noticed the following behavior:

$ vim a.ts
<then cursor down 15-20 times, so selection area is grown, and in the end, type 'v'>

VIM will stay stuck at 100% CPU for 10 seconds.
'u'ndoing will also take another 10 seconds.

The ultisnips commit I am currently at:
(I used pathogen to add it to my bundles)

:py import sys; print sys.version:
2.7.5 (default, Sep 6 2013, 09:59:46)
[GCC 4.8.1 20130725 (prerelease)]

Thanassis Tsiodras (ttsiodras) wrote :
Thanassis Tsiodras (ttsiodras) wrote :

I case it is relevant: I am also using the typescript plugin ( and am doing all this under Arch Linux, with vim version:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 3 2013 20:01:21)
Included patches: 1-16
Compiled by Arch Linux
Huge version with GTK2 GUI.

SirVer (sirver) wrote :

The problem you see is with big snippets. UltiSnips takes track of changes to the buffer by diff'ing it to the previous version and guessing what kind of modifications the user might have done. The diffing algorithm is O(n^3) and is run on any cursor move - this can become quite expensive. Unfortunately, I know of no other reliable way to get the set of changes out of Vim - there is no way to access the undo history for example, and it would probably also not be enough.

Changed in ultisnips:
status: New → Incomplete
Launchpad Janitor (janitor) wrote :

[Expired for UltiSnips because there has been no activity for 60 days.]

Changed in ultisnips:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments