Immediately pressing <Esc>O screws up some snippets

Bug #1083094 reported by David Barnett
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UltiSnips
Confirmed
Medium
Unassigned

Bug Description

Steps to reproduce:
1. Open vim with blank .py file
2. Enter insert mode and type "class<Tab>"
3. Press "<Esc><Shift-O>"

Some extra triple-quotes and some other garbage appears as soon as you type "<Shift-O>".

There are similar problems with rwprop and slotclass.

Revision history for this message
SirVer (sirver) wrote :

Cannot reproduce this. Likely because I have a SSD HD and everything is too fast for me.

There is little chance to fix this either way. Vim calls CursorMoved whenever it feels like it, but we need to rely on it being called *often*. Your bug likely describes a situation where it is not often enough and ultisnips gets confused about cursor movement and editing commands you might have made.

Changed in ultisnips:
status: New → Incomplete
Revision history for this message
David Barnett (mu-mind) wrote :

Are you sure that's the cause? I tried it again waiting several minutes after hitting <Tab> and again after hitting <Esc>. Is the CursorMoved something that has to happen after I hit <Shift-O> but before vim adds the blank line?

Just to clarify, my exact steps to reproduce are to run "gvim foo.py" and then type:
    aclass<Tab><Esc><Shift-O>
And what I see after that is:
    class MyClass(object)
        """Docstring for MyClass """

        def __init__(self): """ """ """
            .__init__(self)

            """@todo: to be defined """

It may be something that only affects certain versions of vim or what-have-you. But then, I reproduced it on both Ubuntu 12.04 and 12.10.

Revision history for this message
SirVer (sirver) wrote :

You are right. I can reproduce this unfortunate behavior. It is likely a misguess in the heuristic that guesses what edits have happened since the cursor moved the last time.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.