When editing a file, I can issue q:
to open a command palette and compose a Vim command using the full power of Vim's normal mode. I can also Alt+Tab
to another window to look for information, then Alt+Tab
back to Gvim to finish composing the Vim command.
When I'm in a netrw v171 buffer and use q:
to compose a command, I can't Alt+Tab
away and back. I get the following error message, and I also lose the Vim command that I'm composing:
Error detected while processing FocusGained Autocommands
for "*"..function <SNR>36_LocalBrowseRefresh:
line 49:
E11: Invalid in command-line window; <CR> executes, CTRL-C quits
I never had this problem with older Vim/netrw
versions, though I admit that I haven't tracked which (I just update everything from Cygwin once in a while).
From the Vim help, I know that FocusGained
is an event that triggers autocommands, and from the message above, they seem specific to LocalBrowseRefresh
. I looked up SNR
s and understand that they are used to deconflict names between scripts. I looked for LocalBrowseRefresh
and FocusGained
in netrwPlugin.vim
, but they aren't present.
I have to admit to just rummaging around, and there could be lots of naivity in the way I'm going about it. All I'm seeking is to Alt+Tab
back and forth from Gvim, even if I started from a netrw
buffer and am in the midst of composing a command using q:
. Is there a simple way to achieve this or to dig deeper into the cause?
If I can find the cause without taking a hiatus to become an expert in Vimscript, I can try hacking the netrw
code. It's not the most reliable approach to a solution, but I've had some success with this for BufExplorer, though that was with tremendous time and effort, and it's my only experience in hacking a plugin. I also have to re-explore how to implement the hack every time I update Cygwin.
fun! s:LocalBrowseRequest()
is actually defined inautoload/netrw.vim
not innetrwPlugin.vim
LocalBrowseRefresh
,FocusGained
, andnetrw_events
, but I can't infer a scheme from them. Fast browsing seems to crop up everywhere, but I haven't found anything about it. Ah well. I appreciate the pointer to the autoload file.