weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

[BUG] Cannot close coc-explorer outside its window #563

Closed moetayuko closed 1 year ago

moetayuko commented 1 year ago

Describe the bug

Previously, :CocCommand explorer toggles coc-explorer regardless of which window is focused. However, the command no longer closes an existing explorer window after a coc.nvim update but moves focus to it. One needs to rerun the command while focusing on the explorer window to close it.

The last working coc.nvim is https://github.com/neoclide/coc.nvim/commit/6adfb13aa16733aa5ede483f428750ce03954c4d

Result from CocInfo

## versions

vim version: VIM - Vi IMproved 9.0 9001337
node version: v19.7.0
coc.nvim version: 0.0.82-b7375d5f 2023-01-30 05:09:03 +0800
coc.nvim directory: /home/dianlujitao/.dotfiles/vim/.vim/plugged/coc.nvim
term: tmux
platform: linux

## Log of coc.nvim

2023-03-04T16:45:19.172 INFO (pid:64770) [plugin] - coc.nvim initialized with node: v19.7.0 after 359
2023-03-04T16:45:19.847 INFO (pid:64770) [attach] - receive notification: runCommand [ 'explorer', '--root-strategies', 'keep' ]
2023-03-04T16:45:19.886 INFO (pid:64770) [attach] - receive notification: doAutocmd [ 2, 2 ]
2023-03-04T16:45:20.215 INFO (pid:64770) [attach] - receive notification: highlight []
2023-03-04T16:45:20.686 INFO (pid:64770) [attach] - receive notification: highlight []
2023-03-04T16:45:20.698 INFO (pid:64770) [attach] - receive notification: runCommand [ 'explorer', '--root-strategies', 'keep' ]
2023-03-04T16:45:20.753 INFO (pid:64770) [attach] - receive notification: doAutocmd [ 3, 2 ]
2023-03-04T16:45:20.787 INFO (pid:64770) [attach] - receive notification: doAutocmd [ 2, 3 ]
2023-03-04T16:45:21.124 INFO (pid:64770) [attach] - receive notification: highlight []
2023-03-04T16:45:22.092 INFO (pid:64770) [attach] - receive notification: runCommand [ 'explorer', '--root-strategies', 'keep' ]
2023-03-04T16:45:22.447 INFO (pid:64770) [attach] - receive notification: highlight []
2023-03-04T16:45:24.346 INFO (pid:64770) [attach] - receive notification: showInfo []

Steps to reproduce Steps to reproduce the behavior:

  1. execute vim
  2. :CocCommand explorer, focus automatically moved to the explorer's window
  3. Move focus to another window
  4. :CocCommand explorer, the focus moved to the explorer's window
  5. :CocCommand explorer, explorer's window closed

Expected behavior

explorer's window closed at step 4

Screenshots

Additional context None

BenjamimCS commented 1 year ago

Yeah. The same here. 🙁

weirongxu commented 1 year ago

Will fix this on https://github.com/neoclide/coc.nvim/pull/4569