echasnovski / mini.nvim

Library of 40+ independent Lua modules improving overall Neovim (version 0.8 and higher) experience with minimal effort
MIT License
4.92k stars 184 forks source link

mini.visits fails to open again after opening file in a split #1239

Closed madhermit closed 1 day ago

madhermit commented 1 day ago

Contributing guidelines

Module(s)

mini.visits

Description

If i open a file from the mini.visits ui (MiniVisits.select_path) in the current window using the <enter> key, I can continue to call up the ui and open files all day long. However, when i use the <ctrl-v> or <ctrl-x> to open a file in a split, it opens the file in the split, but the ui will then fail to appear until nvim is restarted.

Neovim version

0.10.1

Steps to reproduce

  1. setup a fresh lazyvim install and added the standalone mini.visits plugin
  2. Add a label using the MiniVisits.add_label() command
  3. Use the MiniVisits.select_path() command to open the picker
  4. Use a open in split key stroke <ctrl-v> or <ctrl-x> on the path added in step 2
  5. File opens in split
  6. Repeat step 3 -- Use the MiniVisits.select_path() command to open the picker

Expected behavior

I would expect to step 6 to re-open the picker

Actual behavior

the picker fails to open until nvim is restarted

echasnovski commented 1 day ago

Thanks for the issue!

I indeed can reproduce with LazyVim and it has to do with its vim.ui.select override (which comes from 'nvim-telescope/telescope.nvim').

The select_path() uses vim.ui.select() to choose between visited paths. Selecting one of them shows a visited path (in a current window, in case that matters). As the vim.ui.select() describes only a single on_choice() (which is reasonable), that is what select_path() provides.

The <C-x> and <C-v> in Telescope's override of vim.ui.select() are more meant for built-in pickers (like find_files, buffers, etc.) so probably should not be used (or even present) inside of it.

For what it's worth, the splitting mappings of vim.ui.select() override from 'mini.pick' work even in this case. Which gives me more confidence in saying that this is not a 'mini.visits' issue per se.

Closing as not a 'mini.visits' issue.