4

When I open the command-line window for editing a complex command-line in vim, I expect to be able to go back and forth in and out of insert / normal mode to edit as I would in any other buffer. (That's the point of the command-line window, right? So that I can do that?) But instead, when I hit ESC to go back to normal mode, I get this:

Error detected while processing function <SNR>15_CloseStackPop:
line    3:
E11: Invalid in command-line window; <CR> executes, CTRL-C quits:         pclose

I'm game to try to figure this out, but I don't have a lot to go on. vim --noplugin doesn't seem to have this problem, so it's clearly one of the plugins I have loaded, but which one? I have quite a few. "line 3" of what file? What does "E11" mean?

Glyph
  • 31,152
  • 11
  • 87
  • 129

2 Answers2

4

It turns out that this was a bug in the 'autoclose' plugin. I removed the reference to pclose from the <SID>CloseStackPop function, and now Escape in command-line mode works fine.

In case anyone else has this problem: functions in plugins can be defined with <SID>, which (in the source code) just looks like <SID>Foo, but to Vim look like <SNR>4321_Foo. I was looking for 15_CloseStackPop, assuming that the <SNR> was something special, but when I just did a grep CloseStackPop -r ~/.vim/plugins the offending plugin came up right away.

Glyph
  • 31,152
  • 11
  • 87
  • 129
  • 2
    You probably want to change `pclose` to `silent! pclose` instead of removing it. It's responsible for closing the preview window after a completion. I had the same error from something doing the same thing: http://stackoverflow.com/q/11733388/79125 – idbrii Jul 31 '12 at 05:24
1

Try Ctrl+C as a synonym for Escape. Also check .vimrc for the plugins. This isn't standard behavior for vi. If I were you I wouldn't use any plugins unless I was absolutely sure what they did. Perhaps start from scratch and reinstall the ones you feel completely sure of.

ktm5124
  • 11,861
  • 21
  • 74
  • 119
  • Ctrl+C doesn't seem to work as a synonym for Escape in that context; Escape goes back to Normal mode, Ctrl+C goes back to cmdline mode (as opposed to cmdwin). – Glyph Jan 17 '11 at 06:11