Closed parmort closed 5 years ago
Hm. Thanks for the report @parmort. Quite mysterious. There are two fishy things here:
g:CommandTInputDebounce
set to a non-zero value.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.
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.
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.
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.
Just applied, and it seems to work fine. Will reopen and report if there are any problems, but closing for now. Thanks!
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:
I tried following the trace, but I couldn't find any call to
Vim(nunmap)
anywhere, nor any parameters that would make the command.