rmagatti / goto-preview

A small Neovim plugin for previewing definitions using floating windows.
Apache License 2.0
835 stars 27 forks source link

[BUG] Preview window won't show if "dismiss_on_move = true" and "focus_on_open = true" #109

Open antonkesy opened 11 months ago

antonkesy commented 11 months ago

Describe the bug I've set dismiss_on_move = true but still got the default value focus_on_open = true But now the preview window won't show anymore / auto closes instantly If focus_on_open = false (the cursor is not moved) all works as expected

To Reproduce Steps to reproduce the behavior:

  1. set config to dismiss_on_move = true and focus_on_open = true
  2. Try to open a valid goto
  3. No window shown

Expected behavior Preview window to show dismiss-on-move to have only have an effect if cursor moved in the buffer which the goto is called from

Baseline (please complete the following information):

Additional context Not sure if this counts as a bug, is intended behavior or just a logic error in general on my part 🤷🏻

rmagatti commented 11 months ago

Hm yeah these options don't really go together. The way dismiss_on_move works is:

Now, how focus_on_open works:

The issue:

Essentially, these options are mutually exclusive. I suppose a note in the readme mentioning this might be a good addition.