Skip to content

zN<CR> only if preview window is a horizontal split #2306

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

Merged
merged 1 commit into from
Sep 10, 2020

Conversation

tomtomjhj
Copy link
Contributor

When using "coc.preferences.hoverTarget": "preview", coc sets the preview window height with zN<CR>. The problem is that it reduces the height of the window even if there is no window adjacent to the top/bottom current window, which is undesirable. Therefore, it first need to check that there is a adjacent window.

For example this is what you'll get if you move the preview window to the right size and then do hover.
image

When using "coc.preferences.hoverTarget": "preview", coc sets the
preview window height with zN<CR>. The problem is that it reduces the
height of the window even if there is no window adjacent to the
top/bottom current window, which is undesirable. Therefore, it first
need to check that there is a adjacent window.
@tomtomjhj
Copy link
Contributor Author

Note: Direction parameter for winnr was added in vim 8.1.1140, which is higher than minimal version requirement for coc (8.0.1453).

@chemzqm chemzqm merged commit 1bf7e53 into neoclide:master Sep 10, 2020
chemzqm pushed a commit that referenced this pull request Sep 10, 2020
When using "coc.preferences.hoverTarget": "preview", coc sets the
preview window height with zN<CR>. The problem is that it reduces the
height of the window even if there is no window adjacent to the
top/bottom current window, which is undesirable. Therefore, it first
need to check that there is a adjacent window.
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

Successfully merging this pull request may close these issues.

None yet

2 participants