wincent / command-t

⌨️ Fast file navigation for Neovim and Vim
BSD 2-Clause "Simplified" License
2.74k stars 317 forks source link

Command-T stops working after deleting its hidden buffer #342

Closed JavierParra closed 5 years ago

JavierParra commented 5 years ago

As the title mentions, command-t stops working after deleting its buffer.

I'm using neovim v0.3.0.

Steps to reproduce:

.vim/bundle/command-t/ruby/command-t/lib/command-t/match_window.rb:157:in `rescue in buffer_number'
 .vim/bundle/command-t/ruby/command-t/lib/command-t/match_window.rb:155:in `buffer_number'
 .vim/bundle/command-t/ruby/command-t/lib/command-t/match_window.rb:76:in `initialize'
 .vim/bundle/command-t/ruby/command-t/lib/command-t/controller.rb:366:in `new'
 .vim/bundle/command-t/ruby/command-t/lib/command-t/controller.rb:366:in `show'
 .vim/bundle/command-t/ruby/command-t/lib/command-t/controller.rb:147:in `show_file_finder'
(eval):3:in `show_file_finder'
eval:1:in `<main>'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:45:in `eval'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:45:in `block (2 levels) in __define_ruby_execute'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:101:in `block (2 levels) in __wrap_client'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:123:in `__with_std_streams'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:100:in `block in __wrap_client'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:109:in `__with_exception_handling'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:99:in `__wrap_client'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/ruby_provider.rb:44:in `block in __define_ruby_execute'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/plugin/handler.rb:51:in `call'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/host.rb:98:in `block in wrap_plugin_handler'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/host.rb:36:in `handle'
/usr/local/lib/ruby/gems/2.5.0/gems/neovim-0.7.1/lib/neovim/host.rb:28:in `block in run'
Error detected while processing function commandt#FileFinder:
line    2:
NameError: uninitialized constant Vim::DeletedBufferError

Edit: Pinpointed the real culprit and simplified steps to reproduce.

JavierParra commented 5 years ago

The following simple (albeit ugly) patch fixes the error: deleted-buffer.diff.txt

wincent commented 5 years ago

Awesome. Thanks. It may be ugly, but error-handling often is.

wincent commented 5 years ago

Thanks for the detailed bug report and the suggested fix @JavierParra. I just cut 5.0.3 with a fix included.

JavierParra commented 5 years ago

Great! Thanks for the quick response.