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

get window in a particular direction #19

Open
andymass opened this issue Jul 14, 2018 · 2 comments
Open

get window in a particular direction #19

andymass opened this issue Jul 14, 2018 · 2 comments

Comments

@andymass
Copy link

Forgive me if this isn't what you're looking for- but I think determining the window in the "hjkl" direction is already possible using basic arithmetic (but that's not to say a built-in function wouldn't be better.)

https://gist.github.com/andymass/fa3934faf0695955ed3815d0ca6475a7

With more time/testing I'd probably make it into a small plugin, but that's moot if a patch to vim gets accepted.

@blueyed
Copy link
Owner

blueyed commented Jul 14, 2018

Oh, thanks! - missed it until now.

I've just done #20 using the new getwininfo API.
Currently it is only required to check if the column is the same as with the current window, i.e. if it is in the same screen column (by iterating through the winnrs with lower numbers).

Will look into your gist later.

@blueyed
Copy link
Owner

blueyed commented Jul 15, 2018

Yes, nice.

It uses win_screenpos() (added in 8.0.1364), which I've probably not found, since it is not in Neovim yet. And it's from Dec 2017, while I was investigating before into this issue.

Actually that would have been enough already for me, since I am only interested in the col currently anyway. I will use win_screenpos then for now, which makes the gap of degraded support smaller.

Thanks again.
This might come in useful later anyway - e.g. I still want to check how it behaves with a wide qf list, depending on the cursor position etc.
But enough for now, once this issue is fixed.

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

No branches or pull requests

2 participants