Using YCMHover to dismiss a popup causes the popup to be leaked

Author: Aster89Created Jun 23, 2026Updated Jun 23, 2026

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

  • I have read and understood YCM's CONTRIBUTING document.
  • I have read and understood YCM's CODE_OF_CONDUCT document.
  • I have read and understood YCM's README, especially the Frequently Asked Questions section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm about to report and couldn't find an answer to my problem. (Example Google search.)
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have attached the contents of the logfiles using the :YcmToggleLogs command.
  • If filing a bug report, I have included which OS (including specific OS version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I expected to happen and what actually happened.
  • If filing a installation failure report, I have included the entire output of install.py (or cmake/make/ninja) including its invocation
  • I understand this is an open-source project staffed by volunteers and that any help I receive is a selfless, heartfelt gift of their free time. I know I am not entitled to anything and will be polite and courteous.
  • I understand my issue may be closed if it becomes obvious I didn't actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved quickly and that neither your nor our time is needlessly wasted.

Issue Details

Closing a popup (opend via YCMHover) via YCMHover causes the popup ID to be leaked. Successive calls to YCMHover will be assigned another popup ID and so on. If the popup is closed by moving the cursor away, this doesn't happen.

(Related to https://github.com/ycm-core/YouCompleteMe/issues/4330)

Provide a clear description of the problem, including the following key questions:

  • What did you do?

Include steps to reproduce here.

  1. Open Vim via vim -Nu ~/.vim/plugged/YouCompleteMe/vimrc_ycm_minimal -c 'nmap <leader>D <plug>(YCMHover)' ~/foo.cpp,
  2. move the cursor on something you can successfully do YCMHover on,
  3. press leaderD and even number of times, say 2*n,
    • you'll see the popup be shown and hidden n times,
  4. execute :echo popup_list()

Include description of a minimal test case, including any actual code required to reproduce the issue.

If you made changes to vimrc_ycm_minimal, pase them here:

" no changes
  • What did you expect to happen?

Include description of the expected behaviour.

  • What actually happened?

Include description of the observed behaviour, including actual output, screenshots, etc.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 9.2 (2026 Feb 14, compiled Jun 21 2026 20:25:36)
Included patches: 1-699
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl                +clientserver       +dialog_con_gui     +float              +lambda             +mouseshape         +netbeans_intg      +quickfix           -image_gdi          -tag_any_white      +vartabs            +windows
+arabic             +clipboard          +diff               +folding            +langmap            +mouse_dec          +num64              +reltime            +image_cairo        +tcl/dyn            +vertsplit          +writebackup
+autocmd            +clipboard_provider +digraphs           -footer             +libcall            +mouse_gpm          +packages           +rightleft          -image_gdk          +termguicolors      +vim9script         +X11
+autochdir          +cmdline_compl      +dnd                +fork()             +linebreak          -mouse_jsbterm      +path_extra         +ruby/dyn           +sound              +terminal           +viminfo            +xattr
-autoservername     +cmdline_hist       -ebcdic             +gettext            +lispindent         +mouse_netterm      +perl/dyn           +scrollbind         +spell              +terminfo           +virtualedit        -xfontset
+balloon_eval       +cmdline_info       +emacs_tags         -hangul_input       +listcmds           +mouse_sgr          +persistent_undo    +signs              +startuptime        +termresponse       +visual             +xim
+balloon_eval_term  +comments           +eval               +iconv              +localmap           -mouse_sysmouse     +popupwin           +smartindent        +statusline         +textobjects        +visualextra        -xpm
+browse             +conceal            +ex_extra           +insert_expand      +lua/dyn            +mouse_urxvt        +postscript         +socketserver       -sun_workshop       +textprop           +vreplace           +xsmp_interact
++builtin_terms     +cryptv             +extra_search       +ipv6               +menu               +mouse_xterm        +printer            -sodium             +syntax             +timers             +wayland            +xterm_clipboard
+byte_offset        +cscope             -farsi              +job                +mksession          +multi_byte         +profile            +image              +tabpanel           +title              +wayland_clipboard  -xterm_save
+channel            +cursorbind         +file_in_path       +jumplist           +modify_fname       +multi_lang         -python             +image_sixel        +tag_binary         +toolbar            +wildignore
+cindent            +cursorshape        +find_in_path       +keymap             +mouse              -mzscheme           +python3/dyn        +image_kitty        -tag_old_static     +user_commands      +wildmenu
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
 3rd user vimrc file: "~/.config/vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
3rd user gvimrc file: "~/.config/vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cloudproviders -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2 -I/usr/include/at-spi2-
atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/atk-1.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/fribidi -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/inc
lude/gio-unix-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fsta
ck-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/vim/src=/usr/src/debug/vim -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.42/core_perl/CORE -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto -L/usr/local/lib -o vim -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lcairo-gob
ject -lgdk_pixbuf-2.0 -latk-1.0 -lpango-1.0 -lcairo -lharfbuzz -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lz -lSM -lICE -lXt -lX11 -lwayland-client -lm -lXdmcp -lSM -lICE -lm -ltinfo -lnsl -lcanberra -lacl -lattr -lgpm -L/usr/lib -ltclstub8.6 -ld
l -lz -lpthread -lm

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_vzv4xhvj.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.14.6
-- Server has Clang support compiled in: False
-- Clang version: None
-- Extra configuration file found and loaded
-- Extra configuration path: /home/enrico/.ycm_extra_conf.py
-- C-family completer debug information:
--   Clangd running
--   Clangd process ID: 828841
--   Clangd executable: ['/home/enrico/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-header-insertion-decorators=0', '-resource-dir=/home/enrico/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party
/clang/lib/clang/21.1.3', '-limit-results=500', '-log=verbose']
--   Clangd logfiles:
--     /tmp/clangd_stderr01j2j83m.log
--   Clangd Server State: Initialized
--   Clangd Project Directory: /home/enrico
--   Clangd Open Workspaces: {'/home/enrico'}
--   Clangd Settings: {}
--   Clangd Compilation Command: ['clang-tool', '-x', 'c++', '-std=c++26', '-Wall', '-Wextra', '-Wattributes', '-Wconversion', '/home/enrico/foo.cpp']
-- Server running at: http://127.0.0.1:56225
-- Server process ID: 828801
-- Server logfiles:
--   /tmp/ycmd_56225_stdout_tpp1t1qv.log
--   /tmp/ycmd_56225_stderr_3m9z8f6r.log
-- Semantic highlighting supported: True
-- Virtual text supported: True
-- Popup windows supported: True

Output of YcmDiags

No warnings or errors detected.

Output of git rev-parse HEAD in YouCompleteMe installation directory

f8fbc1ddf440b0b34ac23bcd7b7d8d14a7fb80e6

Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which enabled debug logging and other useful diagnostics. Include a link to a gist containing all of the log files listed by :YcmToggleLogs.

OS version, distribution, etc.

up-to-date ArchLinux

Output of build/install commands

Include link to a gist containing the invocation and entire output of install.py if reporting an installation issue.