On snippet failure, tab key is ignored

Bug #418062 reported by Michael Henry
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
UltiSnips
Fix Released
High
Unassigned

Bug Description

When SuperTab is not present, UltiSnips suppresses the <tab> key on snippet expansion failures. This prevents the user from using the <tab> key for indentation.

A patch which corrects this behavior may be found here:
https://code.launchpad.net/~drmikehenry/ultisnips/tab-failure

The patch is also attached for convenience.

Note that the test.py file has an additional hack to retry tests up to twice before reporting a failure. This is required on my system to get the out-of-the-box tests to complete reliably. I've tried adjusting sleeptime in several ways, including doing time.sleep(sleeptime + 0.10) in the type() function to globally increase the sleep time, but I still get occasional errors and the tests run extremely slowly. So far, having a couple of retries has made the tests reliable for me. Since each test starts execution cleanly, it seems reasonable to me to allow any single passing run of a test to indicate overall success, given how strongly timing influences test success.

Note that the patch doesn't fix the problem for arbitrary mappings of g:UltiSnipsExpandTrigger; only the <tab> key is detected and passed through. This is because I don't know how to generically convert :map-style strings like "<tab>" into feedkeys()-style strings like "\<tab>" (with the backslash-escape). But given the importance of the <tab> key and the fact that <tab> is the default trigger, it seems worthy of a special-case solution.

Michael Henry

Related branches

Revision history for this message
Michael Henry (drmikehenry) wrote :
Revision history for this message
SirVer (sirver) wrote :

Hi. I fully agree; your patch was applied and you have been added to the contributor list. Keep em coming ;)

Changed in ultisnips:
importance: Undecided → High
status: New → Fix Released
Revision history for this message
Ovidiu Visan (visan-ovidiu) wrote :

still not fixed, i am experiencing this behaviour

Revision history for this message
SirVer (sirver) wrote :

#3: This is a completely unhelpful comment. Please provide complete steps to reproduce your problem like key presses to do or a screencast that shows the problem. Also your installed plugins and vimrc.

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.