ervandew / supertab

Perform all your vim insert mode completions with Tab
3.17k stars 216 forks source link

For reasons, I'd really like to reverse the argument order in SuperTabChain #198

Closed shmup closed 6 years ago

shmup commented 6 years ago

It would be wonderful if I could:

   autocmd FileType *
      \ if &omnifunc != '' |
      \   call SuperTabChain("<c-p>", &omnifunc) |
      \ endif

I want to follow the rules of c-p and if nothing is found, then go ahead and use omni-completion. I like the rule order of c-p.

Is this a major pain or does it fit into your existing implementation fairly easily? Ideally it's like "check response from this thing, if empty, try this other thing", and the order wouldn't matter. It's not that way right now, as far as I can tell.

shmup commented 6 years ago

After not being lazy I see I'd have to handle it here. The simple approach is me forking and just reversing the lookup order and result check technique.

https://github.com/ervandew/supertab/blob/master/plugin/supertab.vim#L944-L959

I'll think on it for a bit, and an implementation that might be nice as an extension, instead of me just forking and doing a hard reverse, heh.

shmup commented 6 years ago

I guess... the question I originally had before I saw Supertab had chaining is:

Can "[...] Pattern not found" be triggered on (or captured)

ervandew commented 6 years ago

Can "[...] Pattern not found" be triggered on (or captured)

That's why supertab has limited chaining support. Only user and omni completion provide a function that supertab can call and then check the results. All other completions lack a function, so all supertab can do is send the keys to vim, at which point supertab is out of the picture (it has no idea of there were results or not).