YouCompleteMe icon indicating copy to clipboard operation
YouCompleteMe copied to clipboard

Entering command-line window from GoToReference's quickfix window results in inconsistent Vim state

Open Aster89 opened this issue 1 year ago • 0 comments

Issue Prelude

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

  • [x] I have read and understood YCM's CONTRIBUTING document.
  • [x] I have read and understood YCM's CODE_OF_CONDUCT document.
  • [x] I have read and understood YCM's README, especially the Frequently Asked Questions section.
  • [x] 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.)
  • [x] If filing a bug report, I have included the output of vim --version.
  • [x] If filing a bug report, I have included the output of :YcmDebugInfo.
  • [x] If filing a bug report, I have attached the contents of the logfiles using the :YcmToggleLogs command.
  • [x] If filing a bug report, I have included which OS (including specific OS version) I am using.
  • [x] 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
  • [x] 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.
  • [x] 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

(I asked on vi.stackexchange first, becase I thought it could be a Vim bug as well.)

  • What did you do?

See screencast below, which follow the steps below from step 2 (I've done step 1 as well and I can reproduce the issue, but didn't record):

  1. vim -Nu /path/to/YCM/ycm_vimrc_minimal someFile.cpp
  2. :YcmCompleter GoToReferences while on a variable that is used more than once (well, you just want to trigger the qf to open)
  3. q/
  4. hit enter on one of the search patters
  5. you'll get an error

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:

<contents of ycm_vimrc_minimal>
  • What did you expect to happen?

Include description of the expected behaviour.

Probably the same that happens if I do :copen q/?

  • What actually happened?

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

asciicast

Diagnostic data

Output of vim --version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 01 2022 21:10:19)
Included patches: 1-354
Compiled by Arch Linux
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +file_in_path      +mouse_urxvt       -tag_any_white
+arabic            +find_in_path      +mouse_xterm       +tcl/dyn
+autocmd           +float             +multi_byte        +termguicolors
+autochdir         +folding           +multi_lang        +terminal
-autoservername    -footer            -mzscheme          +terminfo
+balloon_eval      +fork()            +netbeans_intg     +termresponse
+balloon_eval_term +gettext           +num64             +textobjects
+browse            -hangul_input      +packages          +textprop
++builtin_terms    +iconv             +path_extra        +timers
+byte_offset       +insert_expand     +perl/dyn          +title
+channel           +ipv6              +persistent_undo   +toolbar
+cindent           +job               +popupwin          +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +vim9script
+cmdline_hist      +langmap           -python            +viminfo
+cmdline_info      +libcall           +python3/dyn       +virtualedit
+comments          +linebreak         +quickfix          +visual
+conceal           +lispindent        +reltime           +visualextra
+cryptv            +listcmds          +rightleft         +vreplace
+cscope            +localmap          +ruby/dyn          +wildignore
+cursorbind        +lua/dyn           +scrollbind        +wildmenu
+cursorshape       +menu              +signs             +windows
+dialog_con_gui    +mksession         +smartindent       +writebackup
+diff              +modify_fname      -sodium            +X11
+digraphs          +mouse             +sound             -xfontset
+dnd               +mouseshape        +spell             +xim
-ebcdic            +mouse_dec         +startuptime       -xpm
+emacs_tags        +mouse_gpm         +statusline        +xsmp_interact
+eval              -mouse_jsbterm     -sun_workshop      +xterm_clipboard
+ex_extra          +mouse_netterm     +syntax            -xterm_save
+extra_search      +mouse_sgr         +tag_binary        
-farsi             -mouse_sysmouse    -tag_old_static    
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.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/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cloudproviders -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/at-spi-2.0 -pthread -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/vim/src=/usr/src/debug -flto=auto -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,--no-as-needed -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto -L/usr/local/lib -o vim -lgtk-3 -lgdk-3 -lz -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lXdmcp -lSM -lICE -lm -ltinfo -lelf -lcanberra -lacl -lattr -lgpm -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.36/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.36/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm

Output of YcmDebugInfo

Printing YouCompleteMe debug information...
-- Resolve completions: Up front
-- Client logfile: /tmp/ycm_8jqh424p.log
-- Server Python interpreter: /usr/bin/python3
-- Server Python version: 3.10.7
-- Server has Clang support compiled in: True
-- Clang version: clang version 13.0.0 (https://github.com/ycm-core/llvm 02d1fa3185f1beeebb182b8911bfe09d3429707f)
-- 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: 2253978
--   Clangd executable: ['/home/enrico/.vim/plugged/YouCompleteMe/third_party/ycmd/third_party/clangd/output/bin/clangd', '-cross-file-rename', '-header-insertion-decorators=0', '-resource-dir=/home/enrico/.vim/plugged/YouCompleteMe/third_party/ycmd/third
_party/clang/lib/clang/14.0.0', '-limit-results=500']
--   Clangd logfiles:
--     /tmp/clangd_stderri2th7vk8.log
--   Clangd Server State: Initialized
--   Clangd Project Directory: /home/enrico
--   Clangd Settings: {}
--   Clangd Compilation Command: ['clang-tool', '-x', 'c++', '-std=c++20', '-Wall', '-Wextra', '-Wattributes', '/home/enrico/uffa.cpp']
-- Server running at: http://127.0.0.1:59141
-- Server process ID: 2253961
-- Server logfiles:
--   /tmp/ycmd_59141_stdout_aabx18x3.log
--   /tmp/ycmd_59141_stderr_0dtnv0vc.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

d4343e8384ffb25d70a9ebc966bbf1277735567c

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.

Aster89 avatar Sep 18 '22 11:09 Aster89