>From a plugin author there are only two features I would need i.e. allow to pass an option for popup for focusable: true/false when creating popup and capability to focus on the popup or move focus to another buffer/win. Neovim has a win_gotoid() to focus to popup which avoids creating a new api since it treats popup as just any other window with buffer. Based on the api we might need a third once that says which one currently focused.
As for the experience it is like any other buffer or window. You can only be currently focused in a buffer or popup and not multiple. Use / for search, jkhl for movements and so on. Here is how vim-lsp works when trying to show popup for hovering under a symbol that gives doc. nmap <buffer> K <plug>(lsp-hover) lsp-hover is same as preview window concept in vim but instead of using preview window it uses popup if it exists. We have a flag to allow autofocus for lsp-hover. if it is true we autofocus to popup window and if false the focus remains in the buffer. By default we have set it to false so it doesn't focus in the popup. The popup closes when cursor moves since it is not on focus. We then have a concept of double tap which means if the user again presses K when the popup is open it focus inside the popup. Inside the popup they can use all the features of normal buffer and cursor movement doesn't close the popup. For fuzzy finder style popup it also becomes important. I have tried multiple approaches ie. using custom prompt similar to ctrlp, denite style where the prompt is a buffer. I'm leaning to denite style pattern but that means it won't work in popup. vim-clap already seems to be hitting this issue. (Not related to popup but is there an event similar to InsertCharPre but that works in normal code so we can look at v:char and see what character is pressed? This would solve the issue of using prompt to work in multibyte chars and avoid this https://github.com/prabirshrestha/quickpick.vim/blob/68465f4654f83d4a711afe1059a104f9c16f4ac7/autoload/quickpick.vim#L48-L57. getchar() isn't an option since it is blocking. This would solve the prompt issue but not popup issue) On Monday, October 5, 2020 at 9:30:15 AM UTC-7 Blay263 wrote: > I think the use cases have been detailed above and are limited. Neovim > provides a proof of concept. Not having the popup focusable is blocking > specific functionality that is already available in Neovim. > > On Monday, October 5, 2020 at 10:28:08 AM UTC-4 Bram Moolenaar wrote: > >> >> > +1 I would also like the popup to be focusable so that it can be used >> like >> > a normal window/buffer. Neovim doesn't have this issue. >> > >> > Here is another use case for me. This is vim-lsp >> > <https://github.com/prabirshrestha/vim-lsp> using hover to show >> > information about the word under the cursor. Most rust projects have >> big >> > docs including great examples and I would like to move around and copy >> text >> > from popup, search inside the popup and use all my vim knowledge there. >> > >> > Right now the solution for me is to open the website or use neovim. >> >> I have been thinking of this, but it raises many questions: >> >> - How to focus a popup? I imagine in most cases you want to switch >> between the current window and the popup, back and forth. This >> matters especially if you already have a dozen split windows, you >> don't want to cycle through all of them to reach the popup, and you >> don't want to cycle through all windows to end up in the one you were >> coming from. >> >> - If there is more than one focusable popup, how to reach each of them? >> Perhaps some are connected to a specific window (e.g. for completion >> or anchored to text), or some are unrelated to a specific window (e.g. >> help). >> >> - What if the focused popup window closes? What if it closes while you >> are typing (since they might be under control of some async plugin)? >> >> - How to avoid this turns into an avalanche of more feature requests? >> Aka creeping featurism. >> >> -- >> He who laughs last, thinks slowest. >> >> /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ >> /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ >> \\\ an exciting new programming language -- http://www.Zimbu.org /// >> \\\ help me help AIDS victims -- http://ICCF-Holland.org /// >> > -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/da38b161-ae38-4d4a-acf9-825e54451ba0n%40googlegroups.com.
