Skip to content

Fix note popup in Neovim (popup_atcursor → nvim_open_win) - #7

Draft
mvanderkamp with Copilot wants to merge 1 commit into
masterfrom
copilot/neovim-vim-cross-compatibility-solution
Draft

Fix note popup in Neovim (popup_atcursor → nvim_open_win)#7
mvanderkamp with Copilot wants to merge 1 commit into
masterfrom
copilot/neovim-vim-cross-compatibility-solution

Conversation

Copilot AI commented Aug 2, 2026

Copy link
Copy Markdown

popup_atcursor/popup_close are Vim-only APIs; Neovim lacks them entirely, causing :WorklistShow to error on any nvim installation.

Changes

  • s:WrapText(text, width) — new helper to pre-wrap note text into a line list bounded by worklist_popup_maxwidth; needed because nvim floating windows take explicit lines rather than auto-wrapping
  • s:ShowNotePopup() — branches on has('nvim'):
    • Neovim: nvim_create_buf + nvim_buf_set_lines + nvim_open_win (cursor-relative, border: 'single')
    • Vim: original popup_atcursor path unchanged
  • s:CloseNotePopup() — branches on has('nvim'):
    • Neovim: nvim_win_close wrapped in try/catch (guards against already-closed window), resets s:notewinid = -1
    • Vim: original popup_close path unchanged

Copilot AI changed the title Fix #1: Add Neovim/Vim cross-compatibility for note popup Fix note popup in Neovim (popup_atcursor → nvim_open_win) Aug 2, 2026
Copilot AI requested a review from mvanderkamp August 2, 2026 02:23
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.

2 participants