Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset cursor to original position after preview closes. #3

Open
iago-lito opened this issue Dec 17, 2019 · 6 comments
Open

Reset cursor to original position after preview closes. #3

iago-lito opened this issue Dec 17, 2019 · 6 comments

Comments

@iago-lito
Copy link

iago-lito commented Dec 17, 2019

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 :)

@gillyb
Copy link
Owner

gillyb commented Dec 25, 2019

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! :)

@iago-lito
Copy link
Author

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
Copy link
Author

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

@gillyb
Copy link
Owner

gillyb commented Jan 6, 2020

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.

@ds2606
Copy link

ds2606 commented Dec 27, 2020

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

@giddie
Copy link

giddie commented Jul 7, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants