stable-windows icon indicating copy to clipboard operation
stable-windows copied to clipboard

Reset cursor to original position after preview closes.

Open iago-lito opened this issue 4 years ago • 6 comments

Hello, and thank you for this plugin :)

I understand that the cursor needs to move when the preview window would override it. However, I often need to navigate back to the original position by myself when the preview window is eventually closed.

Would it be possible for the cursor, when the preview window is closed, to optionally/automatically navigate back where it was just before the preview opened?

Note, as a workaround, that a couple of <c-o> is enough to navigate back to original location (btw why 2?).

This is it, thank you for support :)

iago-lito avatar Dec 17 '19 07:12 iago-lito

I made a small change regarding preview windows (after the other issue you opened) - so if you can let me know if this still happens that would be great. Thanks! :)

gillyb avatar Dec 25 '19 13:12 gillyb

Hm, still bugging after a :PlugUpdate or a fresh install. It works fine at the top of the file with small previews, but weird navigation occur if the cursor is further down or if the preview window is tall. I'll try to build a small animation to help you understand what is happening here.

BTW I use coc's doHover action to test your changes, but doubt this is minimal. How can I simply check your pluggin with no additional packages?

Anyway, happy 2020 to stable-windows :)

iago-lito avatar Jan 05 '20 18:01 iago-lito

I've just found out about asciinema :D Does this help?

iago-lito avatar Jan 05 '20 19:01 iago-lito

Hmmm, I see exactly what you mean now, thanks for the video (without it I probably still wouldn't understand). I need to think a little about how to implement a clean solution for this problem. I'll try to get to it during this week, or next.

gillyb avatar Jan 06 '20 21:01 gillyb

this was still an issue for me in opening/closing the preview window with external plugins (e.g. the hover command in ALE) - I resolved it in an easy but kind of hacky way by automatically setting and triggering marks if anyone needs a quick fix

ds2606 avatar Dec 27 '20 20:12 ds2606

This also seems to cause some nasty bugs with deoplete. This actually results in text getting messed up, which is a real showstopper:

https://asciinema.org/a/kF0QcjiuGmJXE9Av5dgs59kNc

Edit: I've opted to use https://github.com/ncm2/float-preview.nvim to solve my usecase.

giddie avatar Jul 07 '21 12:07 giddie