I think I'm supposed to file a bug report, however I'm not sure if for Vim or for YCM, so I'm asking this question to better understand what is really happening.

YCM has the :YcmCompleter GoToReferences command, which results in a quickfix window of alternative targets (if there's more than one target, clearly). I say quickfix because if I :ls while in it, the buffer is listed as

  1  a   "uffa.cpp"                     line 0
  2 %a-  "[Quickfix List]"              line 1

Now, while I'm in that window, I can, for instance, search via /. Fine. But what if I need to write a more complex search into it? I'd do q/. However that results in the quickfix window being hidden in favour of the command line window. At this point :ls shows

  1  a   "uffa.cpp"                     line 0
  2 #h-  "[Quickfix List]"              line 2
 19 %a   "[Command Line]"               line 51

and I'm already not sure whether Vim or YCM has made the mistake. Or if just that's how things should go. However, the tricky part comes now: if I press enter on one of the search patterns, I get E199: Active window or buffer deleted for a brief moment, and afterwards

  • the command line window keeps behaving as a buffer where I can edit stuff,
  • but hitting enter just moves me to the next line,
  • and hitting Ctrl-wk successfully moves me away from it, which shouldn't happen,
  • closing it with :q is successfull, but everytime I re-enter it via q/ I get the E199 above, even though now Enter does work.

So I think at least we can be sure that the worflow, as invalid as it can be, is able to leave Vim in a non-consistent state, which I think is a bug. Now the question is whether this is a pure Vim bug, or YCM is not doing things cleanly.

I hope the following clarifies what happens: asciicast

  • This does seem like a bug. q/ shouldn't hide the qflist. In neovim, it works as you'd expect. But I'm using neither vim nor ycm, so I can't confirm where the bug is coming from. You should open a qflist normally (do a :grep 'pattern' or :make) and do q/ and see if the bug is reproducible in vim w/o ycm. If yes, then it's a vim bug. If not, then ycm bug.
    – 3N4N
    Sep 18, 2022 at 11:34
  • 1
    It seems to be the latter case. I've filed it.
    – Enlico
    Sep 18, 2022 at 11:57


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.