Ultisnips + Supertab breaks expandtab in filetype=html, eruby

Bug #1094788 reported by Steve McKinney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UltiSnips
Fix Committed
Undecided
Unassigned

Bug Description

Your input (keystroke for keystroke):
<tab>

The expected output:
<tab> expands to 2 spaces.

The actual output:
<tab> jumps to down several lines or does nothing at all.

Details:
* I ONLY observe this behavior in html and eruby files, although I haven't done an exhaustive search.
* Disabling either UltiSnips OR Supertab resolves this issue.
* Output of :set ts? et? sts? sw?
  tabstop=2
  expandtab
  softtabstop=2
  shiftwidth=2

The output of :py import sys; print sys.version:
2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]

Additional vim plugins that might interfere:
Supertab

description: updated
Revision history for this message
SirVer (sirver) wrote :

Maybe a duplicate of bug 1084974. Please check and report back.

Generally, Supertab seems to do some magic that moves the cursor which confuses the heck out of Ultisnips. The bug is in supertab though - it should disable autocommands before moving the cursor.

Revision history for this message
Steve McKinney (poorlilrichboy) wrote :

Using the settings from bug #1084974 didn't resolve this issue for me.

   set completeopt=menu,longest
   let g:SuperTabDefaultCompletionType = 'context'
   let g:SuperTabCompletionContexts = ['s:ContextText', 's:ContextDiscover']
   let g:SuperTabLongestHighlight=1
   let g:SuperTabLongestEnhanced=1

I'll open a ticket at ervandew/supertab, but I think it's still a possibility that this could be an issue with UltiSnips, this only appeared after I moved from SnipMate. The author of SuperTab seems to be very responsive about maintaining compatibility with SnipMate, it's possible that he'll feel the same about UltiSnips.

Thanks.

Revision history for this message
Steve McKinney (poorlilrichboy) wrote :
Revision history for this message
SirVer (sirver) wrote :

Not a duplicate then. I will try to reproduce this soonish.

Revision history for this message
Steve McKinney (poorlilrichboy) wrote :

It appears vim-sparkup is the issue. Once I added vim-sparkup to the minimal `.vimrc` the issues reappeared.

```
set nocompatible
set tabstop=2 expandtab softtabstop=2 shiftwidth=2

set rtp+=/Users/smckinney/.vim/bundle/supertab
set rtp+=/Users/smckinney/.vim/bundle/ultisnips
set rtp+=/Users/smckinney/.vim/bundle/vim-sparkup

syntax on
filetype plugin indent on
```

Output of `:verbose imap <tab>`:

```
i <Tab> * <C-R>=UltiSnips_ExpandSnippet()<CR>
Last set from ~/.vimfiles/vim/bundle/ultisnips/plugin/UltiSnips.vim
```

Revision history for this message
Eric Van Dewoestine (ervandew) wrote :

Updating ultisnips to use supertab's plug mappings seems to resolve the issue (patch attached).

Revision history for this message
SirVer (sirver) wrote :

Thanks, that seems to be a reasonable fix and will only break with very old versions of SuperTab. I applied your patch and added you to the list of contributors, Eric.

Changed in ultisnips:
status: New → Fix Committed
milestone: none → 2.3
Revision history for this message
Steve McKinney (poorlilrichboy) wrote :

+1 Thanks all!

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.