changeset 33980:0078805790af

runtime(netrw): prevent E11 on FocusGained autocommand (#13718) Commit: https://github.com/vim/vim/commit/fbd72d2d47257267bc6e3fe093ef8c225369ab79 Author: Christian Brabandt <cb@256bit.org> Date: Tue Dec 19 20:22:18 2023 +0100 runtime(netrw): prevent E11 on FocusGained autocommand (https://github.com/vim/vim/issues/13718) Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Dec 2023 20:30:07 +0100
parents b54304e710f4
children 00a926acf8d7
files runtime/autoload/netrw.vim
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -10963,6 +10963,10 @@ fun! s:LocalBrowseRefresh()
 "   call Dret("s:LocalBrowseRefresh : don't refresh when focus not on netrw window")
    return
   endif
+  if !empty(getcmdwintype())
+    " cannot move away from cmdline window, see :h E11
+    return
+  endif
   if exists("s:netrw_events") && s:netrw_events == 1
    " s:LocalFastBrowser gets called (indirectly) from a
    let s:netrw_events= 2