Skip to content

fix: anchor the completion menu, docs and scrollbar to the window - #2235

Open
sassanh wants to merge 1 commit into
hrsh7th:mainfrom
sassanh:fix/window-relative-floats
Open

sassanh wants to merge 1 commit into
hrsh7th:mainfrom
sassanh:fix/window-relative-floats

Conversation

@sassanh

@sassanh sassanh commented Oct 27, 2026

Copy link
Copy Markdown

The custom entries view, the documentation window and the scrollbar floats were opened with relative='editor', i.e. at a cell of Neovim's screen. A GUI can show the editor area inside a larger screen (sidebars, panels, a status bar), so a screen cell is not a cell of the window's text: the menu opened away from the cursor, over the sidebar or at the bottom left of the window, and the docs and scrollbar followed the menu's screen cell instead of the menu.

Open them with relative='win' anchored to the window they belong to, and place the entries in the window's cells (winline()/wincol() in insert mode; the command line keeps its screen position, which is the window's row below the text). The documentation window and the scrollbar use the entries window's space and measure the room to its right edge in the window.

Related: sassanh/qnvim#66

The custom entries view, the documentation window and the scrollbar floats were
opened with relative='editor', i.e. at a cell of Neovim's screen. A GUI can show
the editor area inside a larger screen (sidebars, panels, a status bar), so a
screen cell is not a cell of the window's text: the menu opened away from the
cursor, over the sidebar or at the bottom left of the window, and the docs and
scrollbar followed the menu's screen cell instead of the menu.

Open them with relative='win' anchored to the window they belong to, and place
the entries in the window's cells (winline()/wincol() in insert mode; the
command line keeps its screen position, which is the window's row below the
text). The documentation window and the scrollbar use the entries window's
space and measure the room to its right edge in the window.

Neovim's own popup menu and the wildmenu view stay screen-relative, and the
top half/bottom half fit checks are unchanged.
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.

1 participant