Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error detected while processing function commandt#HelpFinder: Vim(nunmap):E31: No such mapping #354

Closed
parmort opened this issue May 5, 2019 · 5 comments

Comments

@parmort
Copy link

parmort commented May 5, 2019

Just installed CommandT. I'm getting this error when I open up vim and run CommandT list command (:CommandT, :CommandTMRU, :CommandTHelp, etc.) twice (run any command, close; run any command, error). After that, the error doesn't pop up again until after I open up vim again.
OS: ArchLinux
NVim: 0.4.0
Ruby: 2.6.2-p47

Here's the stack trace:

No matching autocommands
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/session.rb:72:in `block in request'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/session.rb:117:in `main_thread_only'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/session.rb:55:in `request'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/api.rb:84:in `call'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/client.rb:35:in `method_missing'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider/vim.rb:19:in `public_send'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider/vim.rb:19:in `method_missing'
plugged/command-t/ruby/command-t/lib/command-t/settings.rb:90:in `set_bool'
plugged/command-t/ruby/command-t/lib/command-t/settings.rb:58:in `set'
plugged/command-t/ruby/command-t/lib/command-t/match_window.rb:319:in `set'
plugged/command-t/ruby/command-t/lib/command-t/match_window.rb:30:in `initialize'
plugged/command-t/ruby/command-t/lib/command-t/controller.rb:366:in `new'
plugged/command-t/ruby/command-t/lib/command-t/controller.rb:366:in `show'
plugged/command-t/ruby/command-t/lib/command-t/controller.rb:81:in `show_help_finder'
(eval):3:in `show_help_finder'
eval:1:in `<main>'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:45:in `eval'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:45:in `block (2 levels) in __define_ruby_execute'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:101:in `block (2 levels) in __wrap_client'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:123:in `__with_std_streams'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:100:in `block in __wrap_client'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:109:in `__with_exception_handling'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:99:in `__wrap_client'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/ruby_provider.rb:44:in `block in __define_ruby_execute'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/plugin/handler.rb:51:in `call'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/host.rb:98:in `block in wrap_plugin_handler'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/host.rb:36:in `handle'
ruby/2.6.0/gems/neovim-0.8.0/lib/neovim/host.rb:28:in `block in run'
Error detected while processing function commandt#HelpFinder:
line    2:
RuntimeError: Vim(nunmap):E31: No such mapping

I tried following the trace, but I couldn't find any call to Vim(nunmap) anywhere, nor any parameters that would make the command.

parmort added a commit to parmort/dotfiles that referenced this issue May 5, 2019
Add CommandT (still working on it, wincent/command-t#354)
Fix ag support
Add recursivity to `path` for better `:find` et al.
@wincent
Copy link
Owner

wincent commented May 12, 2019

Hm. Thanks for the report @parmort. Quite mysterious. There are two fishy things here:

  • One is why is it printing "No matching autocommands": Command-T itself uses autocommands in only one place, if I recall correctly, and only if you have g:CommandTInputDebounce set to a non-zero value.
  • The other being the mysterious nunmap "No such mapping" message: off the top of my head, I can't think of anywhere that Command-T tries to unmap any bindings (it only maps them for its own window, and leaves them in place forever).

So I'm suspecting some clash with some other plug-in or config that you've got in your local environment. You could try turning a few things off and trying to isolate the culprit: if you can figure out which thing it is, then we can probably figure out a proper mitigation.

@parmort
Copy link
Author

parmort commented May 13, 2019

OK, here's what I've found. The conflict is with romainl/vim-cool. I'll look into the code and see what I find, but removing that plugin removes the error.

@parmort
Copy link
Author

parmort commented May 13, 2019

Ok. Just looking at vim-cool's code, vim-cool maps <Plug>(StopHL), then unmaps it. Is command-t somehow executing that command? I'm saying that because the nunmap is going through nvim's ruby bindings, but vim-cool is written in vimscript.

@wincent
Copy link
Owner

wincent commented May 13, 2019

I see. So it is firing an autocmd on OptionSet here, and that is running when Command-T temporarily sets 'hlsearch' here.

So you could try out a patch like this to Command-T to stop that from happening:

diff --git a/ruby/command-t/lib/command-t/settings.rb b/ruby/command-t/lib/command-t/settings.rb
index 1777bc1..35ab258 100644
--- a/ruby/command-t/lib/command-t/settings.rb
+++ b/ruby/command-t/lib/command-t/settings.rb
@@ -87,12 +87,12 @@ def global?(setting)
     def set_bool(setting, value)
       command = global?(setting) ? 'set' : 'setlocal'
       setting = value ? setting : "no#{setting}"
-      ::VIM::command "#{command} #{setting}"
+      ::VIM::command "noautocmd #{command} #{setting}"
     end

     def set_number(setting, value)
       command = global?(setting) ? 'set' : 'setlocal'
-      ::VIM::command "#{command} #{setting}=#{value}"
+      ::VIM::command "noautocmd #{command} #{setting}=#{value}"
     end
     alias set_string set_number
   end

This might have some unintended side-effects, but it may ok. I might run with this for a while and if it doesn't seem to break anything we can merge it.

@parmort
Copy link
Author

parmort commented May 14, 2019

Just applied, and it seems to work fine. Will reopen and report if there are any problems, but closing for now. Thanks!

@parmort parmort closed this as completed May 14, 2019
wincent added a commit that referenced this issue May 14, 2019
vim-cool has an `OptionSet` autocmd that is running when Command-T sets
temporary options and ends up throwing an error.

Related: #354
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants