soulis-1256 / eagle.nvim

Show diagnostics and lsp info inside a custom window, following the mouse position
Apache License 2.0
232 stars 5 forks source link

Bug: switching to first window in first tab after onHoverOut automatically #11

Closed joehannes closed 8 months ago

joehannes commented 8 months ago

Description: When hovering and displaying with hover-hint in a split window (which is not the first window in the first tab), it seems to me ... it's "onHoverOut" automatically switching the focus/cursor to the first window in the first tab. There's no error msgs occurring or anything, plus I guess you'll know already anyway ...

Expected Behavior: I don't want my focus/cursor to be switched to another window/pane at all

DemoScreencast

soulis-1256 commented 8 months ago

Hi, the video you sent is too long for me to clearly pin point the problem. So I have some questions to start:

  1. Is this a bug or is it a wanted enhancement/option?
  2. By "onHoverOut" you mean when the mouse pointer leaves my plugin's float window, after it has been focused?
  3. To be clear, on your video you have 2 windows with some tabs on each, correct? Also, can you send me a shorter video that still contains your issue, and comment on where the problem appears (maybe timestamps)?
joehannes commented 8 months ago

Sorry for the lack of clarity. It is NOT a feature request BUT a bug ...

Whenever you use the plugin to hover-hint an lsp-diagnostic in a split-window (other than the first one) or a tab (other than the first one) ... after "unhovering" ... it seems to me the hoverhint-plugin does trigger a jump back to the first window in the first tab, somehow thinking this was the original view/window/pane

Shorter Screencast

Edit: Just to be somewhat clearer as of the video: You can see the plugin triggering a focus swap to the first (left-hand-side) window by the cyan cursorcolumn/line and the small automatic window animation (resize [make bigger] the current/focus window)

soulis-1256 commented 8 months ago

Hi, this doesn't happen using :vsplit. So it has to be something with your config that messes things up. Is there a plugin that adds the animation seen on the video? I can't troubleshoot without this information. Edit: I forgot to ask, was this happening before my latest commit? Or did it start now?

joehannes commented 8 months ago

hehey :-) beautiful day and thx for considering fixing this though it might be due to other plugins, that's awesome attitude of yourse :100:

So, here's the plugins that auto-resize and animate my windows/panes: anuvyklack/windows.nvim => maximize (plus auto-slight-resizing & animation stuff via below deps) anuvyklack/middleclass anuvyklack/animation.nvim

Also: I just verified (kinda) it's due to these plugins this is happening, (probably the animation plugin - a guess) as it happened before on a new tab as well. But, having no splits in my new tab, it doesn't do that ... saying it only happens with "animated splits" present, so that's gotta be the culprit.

soulis-1256 commented 8 months ago

Hello, I think I fixed the issue. Please check for yourself and inform me if that's the case.

joehannes commented 8 months ago

Awesome, fixed!!! Confirmed, ayeaye!! thx for your effort!!