Bekaboo / dropbar.nvim

IDE-like breadcrumbs, out of the box
GNU General Public License v3.0
990 stars 23 forks source link

[Bug]: Can't exit interactive pick mode when we want to cancel the selecting #102

Closed tan-wei closed 11 months ago

tan-wei commented 11 months ago

Description

When entering interactive pick mode, we can't exit the pick mode when the selecting pop menu is shown.

nvim version

NVIM v0.10.0-dev-1303+g61f1e992ce

dropbar.nvim version

Bekaboo/dropbar.nvim

Operating system and version

Linux archlinux 6.1.56-1-lts #1 SMP PREEMPT_DYNAMIC Fri, 06 Oct 2023 14:13:03 +0000 x86_64 GNU/Linux

Minimal config

-- Default configure file is enough

local tmp = vim.env.TMPDIR
  or vim.env.TEMPDIR
  or vim.env.TMP
  or vim.env.TEMP
  or '/tmp'
local data = tmp ..  '/' .. (vim.env.NVIM_APPNAME or 'nvim')
local packages_root = data .. '/site'
local cloned_root = packages_root .. '/pack/packages/start'
local cloned_path = cloned_root .. '/dropbar.nvim'
local url = 'https://github.com/Bekaboo/dropbar.nvim.git'

vim.fn.mkdir(cloned_root, 'p')
vim.opt.pp:prepend(packages_root)
vim.opt.rtp:prepend(packages_root)

if not vim.loop.fs_stat(cloned_path) then
  vim.fn.system({ 'git', 'clone', url, cloned_path })
end

require('dropbar').setup()

Steps to reproduce

Enter pick mode, and select a element, then popup menu is shown.

Now we can not exit pick mode, despite we ESC or something else.

Expected behavior

We could exit pick mode at any step.

Actual behavior

Any key will not exit pick mode, except:

Additional information

No response

Bekaboo commented 11 months ago

Cannot reproduce.

Enter pick mode, and select a element, then popup menu is shown.

Now we can not exit pick mode

Not sure what do you mean here. Pick mode can be exited with <Esc>; after selecting a element, e.g. after the drop-down menu is shown, you should immediately exit pick mode.

tan-wei commented 11 months ago

Sorry it is not that clear.

I think your understanding is exactly mine. I upload a gif to help me describe this:

pick

First time I try to strike several s, nothing happens, so Ican only strike to reopen main.cpp. Then second time, I try to use mouse click to exit pick mode, it sucesses.

tan-wei commented 11 months ago

I try it on different neovim version, it just behaves the same.

Bekaboo commented 11 months ago

@tan-wei Please use the mininal config for demo.

tan-wei commented 11 months ago

OK, I'll try.

tan-wei commented 11 months ago

Hmm, minimal config could reproduce this: demo

After the drop-down menu is shown, will not exit pick mode (and I strike many times here). Then I could only reopen the current file (you can see warnings that the current buffer is not saved) by strike .

Bekaboo commented 11 months ago

Cannot reproduce. From the gif provided it seems that the pick pivots (the letters in red) disappear after a drop-down menu is opened, as expected -- so you should have already exit pick mode then. What exactly bugs you here?

and I strike many times here

Do you mean that nvim does not respond to your key strikes?

(you can see warnings that the current buffer is not saved) by strike .

What keys did you pressed? It is not clear from the GIF so I could not trigger the warning on my end.

P.S. Could you please upload videos instead of GIFs? It will be more convenient for me to stop and see the error messages. Thanks.

tan-wei commented 11 months ago

OK, I will upload a video with showing the key I input then.

From the gif provided it seems that the pick pivots (the letters in red) disappear after a drop-down menu is opened, as expected -- so you should have already exit pick mode then. What exactly bugs you here?

There may be some misunderstandings here. Yes, before we pick a pivot, it can exit pick mode by strike . But if I have picked up a pivot, then the drop-menu is shown, I can't close the drop-menu by strick . Perhaps my title is incorrect: Pick mode can be exited by , but drop-down menu is not closed by strick .

tan-wei commented 11 months ago

The error messages shown on the GIF are not related to the issue. It is just because:

Bekaboo commented 11 months ago

@tan-wei Drop-down menus are just floating windows, use :q, :bd, <C-w>c or any other ways you prefer to close a drop-down window. If you would like to use <esc> to close a drop-down menu, remap it to <C-w>c or something equivalent.

tan-wei commented 11 months ago

Got it, it is a float window. Thanks for replying. The issue should be closed.