eugen0329 / vim-esearch

Perform search in files easily
352 stars 12 forks source link

Results on Popup #187

Closed onur-ozkan closed 3 years ago

onur-ozkan commented 3 years ago

The popup configuration in docs looks like works only on Neovim. Is there configuration also for vanilla Vim(+8)?

eugen0329 commented 3 years ago

If you're asking about file content previews, then yes, you'll have your previews in a popup using vanilla vim8.

If the questions is about running the entire search window in the popup, then unfortunately no. It's not feasible right now as unlike neovim floating windows, vim8 popups aren't focusable. The only exception is when a terminal app is executed like it's done in floatterm plugin, but esearch is a viml plugin, not a terminal app.

onur-ozkan commented 3 years ago

What do you mean with vim8 popups are not focusable?

For example, using junegunn/fzf.vim plugin I can do single file searching in a popup window as in the screenshot below. What is the difference that we can not provide this functionality in vim-esearch?

2021-08-10_12-59

eugen0329 commented 3 years ago

From :h popup-intro:

The popup window contains a buffer, and that buffer is always associated with
the popup window. The window cannot be in Normal, Visual or Insert mode, it
does not get keyboard focus.

FZF runs an external program fzf written in go. As far as it's executed in a terminal, the window can be focused, but it doesn't act like a regular buffer. From :h popup-terminal:

A special case is running a terminal in a popup window.  Many rules are then
different:                                              E863
- The popup window always has focus.

It's a known limitation that is sometimes handled by other plugins using keystrokes interception and setting the popup cursor position remotely without focusing it, but as far the main feature of esearch buffer is an ability to edit it and write changes into files, it's not really possible to do this without Insert mode.

onur-ozkan commented 3 years ago

Ah, alright. I get you know. Thanks for the detailed explanation.