supertab icon indicating copy to clipboard operation
supertab copied to clipboard

Error on startup in neovim: line 974: E129: Function name required

Open belkka opened this issue 1 year ago • 9 comments

Steps to reproduce:

  1. Run nvim

Observed behavior:

Error message on startup:

Error detected while processing /home/user/.config/nvim/bundle/supertab/plugin/supertab.vim:                       
line  974:                                                                                                         
E129: Function name required                                                                                       
E475: Invalid argument: <Lua 25: vim/_defaults.lua:0>    

Expected behavior: no error message.

Notes: I'm using Vundle to install plugins.

I also tried running nvim -u supertab-only.init.vim (the observed behavior is the same), where supertab-only.init.vim has:

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'
Plugin 'https://github.com/ervandew/supertab'

call vundle#end()

belkka avatar Mar 30 '25 11:03 belkka

This seems to have broken when updating from Neovim 10.4 to 11.0, with no changes to supertab.

walkie avatar Mar 31 '25 04:03 walkie

Re: [ervandew/supertab] Error on startup in neovim: line 974: E129: Function name required (Issue #225) – walkie left a comment (ervandew/supertab#225)

This seems to have broken when updating from Neovim 10.4 to 11.0, with no changes to supertab.

Yes, I suspected this because I've upgraded my system recently (including Neovim, I suppose), but I didn't upgrade plugins for a while (until I discovered supertab triggers error).

Do you think it's an issue that should be reported to/fixed in Neovim instead?

belkka avatar Mar 31 '25 08:03 belkka

Hello. Seeing this issue as well. Neovim v0.11.0, running the latest supertab available via Vundle PluginUpdate. macOS Sequoia, iTerm2. Let me know if I can assist with troubleshooting. Thanks!

daniel-san-pedro avatar Mar 31 '25 14:03 daniel-san-pedro

Straight up commenting out the offending line fixed it for me (i.e. add " symbol to line 974 in supertab.vim). I have no idea if it also broke some feature supertab has. It talks about "shift-tab" (presumably stab = shift-tab if not supertab) which is not a feature I personally use and don't know what it is. The only way I use supertab is just pressing tab so if this breaks something, it broke something I'm not presonally seeing:

In supertab.vim:

plugin/supertab.vim
───────────────────────┐
971: endfunction " }}} │
───────────────────────┘
      if len(existing_stab) && existing_stab.expr
        let stab = substitute(stab, '<SID>\c', '<SNR>' . existing_stab.sid . '_', '')
        let stab = substitute(stab, '()$', '', '')
        " This is the line to comment out: let s:ShiftTab = function(stab) 
        let stab = ''
      endif
    endif

Comments above this block say:

 963   " save user's existing <s-tab> mapping if they have one.
 964   " Note: this could cause more problems than it solves if it picks up <s-tab>
 965   " mappings from other plugins and misinterprets them, etc, so this block is
 966   " experimental and could be removed later.

I don't know what that refers to exactly. Empirically nothing broke for me, but I can imagine that might be meaningful for others, depending on how you use supertab and other plugins.

Noeda avatar Apr 01 '25 17:04 Noeda

I threw the code change that comments out the line here I mentioned in the previous comment here: https://github.com/Noeda/supertab (I don't plan to maintain that repo but if any of you are feeling lazy and just want to test "does it work for me", you could try it). It only has a single extra commit compared to this repo that adds " to the offending line and nothing else.

This is probably my most used extension in terms of "how much do I get practical use out of it", and doesn't look very super actively maintained, maybe bitrot caught up to it (or this is actually a Neovim issue, I did not look very deep, just a quick look this morning when I noticed it breaking). Are there alternatives to supertab, that work similarly? (All I can think of are those AI-code completion extensions that also typically use tab to complete). I'm so used to supertab's existence I probably will prefer to use this particular extension perpetually, even if occasionally I have to do band-aid fixes like the one above. I prefer not to pester the maintainer of this extension if they've moved on; I checked on commit history of this project and commits look sparse. But don't want to assume maintainer's thoughts.

Noeda avatar Apr 01 '25 17:04 Noeda

🔥 Hecc yeah! Thanks for the fix. I can throw away my little hack.

I sometimes wonder if maintainers of codebases with no changes in months are actively looked at, and was super happy to just got a notification.

@ervandew I've used supertab a real long time and am a big fan. Thanks for still taking the time to maintain it!

Noeda avatar Apr 02 '25 16:04 Noeda

Sorry for the late response on this, I was out of town for a few days.

nvim 0.11 added some snippet mappings which triggered this error. I updated the code to handle that case, but since I don't use snippets, there may be other issues lurking around that. If anyone runs into issues with supertab interfering with nvim's new snippet mapping(s), please file a new issue and i'll look into it.

ervandew avatar Apr 02 '25 16:04 ervandew

Can we get a release including this fix?

jorhett avatar May 26 '25 01:05 jorhett

@ervandew could we get a new release?

jamesingoldclover avatar Jul 01 '25 14:07 jamesingoldclover