[vim/vim] Netrw: clicking on another window fail with "E21: Cannot make changes, 'modifiable' is off" (Issue #20552)

0 views
Skip to first unread message

user202729

unread,
Jun 17, 2026, 10:14:12 PM (3 hours ago) Jun 17
to vim/vim, Subscribed
user202729 created an issue (vim/vim#20552)

Steps to reproduce

  1. Run ./src/vim --clean '+:packadd netrw' ~/ '+:new'. See that there's an empty buffer caused by the :new, plus a netrw buffer open, where the empty buffer is currently focused
  2. Click on the netrw buffer. Focus is successfully changed to that buffer
  3. Click on the empty buffer. See E21: Cannot make changes, 'modifiable' is off

Expected behaviour

focus is changed to the empty buffer

Version of Vim

9.2.649

Environment

Ubuntu


Possibly related: #12143, #15660


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20552@github.com>

user202729

unread,
Jun 17, 2026, 10:30:17 PM (2 hours ago) Jun 17
to vim/vim, Subscribed
user202729 left a comment (vim/vim#20552)

This patch fixes the issue

--- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim
+++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim
@@ -4977,11 +4977,11 @@ function s:NetrwMaps(islocal)
             nmap <buffer>                       <2-leftmouse>           <Plug>Netrw2Leftmouse
             imap <buffer>                       <leftmouse>             <Plug>ILeftmouse
             imap <buffer>                       <middlemouse>           <Plug>IMiddlemouse
-            nno  <buffer> <silent>              <Plug>NetrwLeftmouse    :exec "norm! \<lt>leftmouse>"<bar>call <SID>NetrwLeftmouse(1)<cr>
-            nno  <buffer> <silent>              <Plug>NetrwCLeftmouse   :exec "norm! \<lt>leftmouse>"<bar>call <SID>NetrwCLeftmouse(1)<cr>
-            nno  <buffer> <silent>              <Plug>NetrwMiddlemouse  :exec "norm! \<lt>leftmouse>"<bar>call <SID>NetrwPrevWinOpen(1)<cr>
-            nno  <buffer> <silent>              <Plug>NetrwSLeftmouse   :exec "norm! \<lt>leftmouse>"<bar>call <SID>NetrwSLeftmouse(1)<cr>
-            nno  <buffer> <silent>              <Plug>NetrwSLeftdrag    :exec "norm! \<lt>leftmouse>"<bar>call <SID>NetrwSLeftdrag(1)<cr>
+            nno  <buffer> <silent>              <Plug>NetrwLeftmouse    :exec "norm! <Bslash><lt>leftmouse>"<bar>call <SID>NetrwLeftmouse(1)<cr>
+            nno  <buffer> <silent>              <Plug>NetrwCLeftmouse   :exec "norm! <Bslash><lt>leftmouse>"<bar>call <SID>NetrwCLeftmouse(1)<cr>
+            nno  <buffer> <silent>              <Plug>NetrwMiddlemouse  :exec "norm! <Bslash><lt>leftmouse>"<bar>call <SID>NetrwPrevWinOpen(1)<cr>
+            nno  <buffer> <silent>              <Plug>NetrwSLeftmouse   :exec "norm! <Bslash><lt>leftmouse>"<bar>call <SID>NetrwSLeftmouse(1)<cr>
+            nno  <buffer> <silent>              <Plug>NetrwSLeftdrag    :exec "norm! <Bslash><lt>leftmouse>"<bar>call <SID>NetrwSLeftdrag(1)<cr>
             nmap <buffer> <silent>              <Plug>Netrw2Leftmouse   -
                 exe 'nnoremap <buffer> <silent> <rightmouse>  :exec "norm! \<lt>leftmouse>"<bar>call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'
             exe 'vnoremap <buffer> <silent> <rightmouse>  :exec "norm! \<lt>leftmouse>"<bar>call <SID>NetrwLocalRm("'.mapsafecurdir.'")<cr>'

but I'm pretty sure this only breaks recently, probably because of some change in how Vim parses the command/script.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20552/4737290420@github.com>

zeertzjq

unread,
Jun 17, 2026, 10:35:52 PM (2 hours ago) Jun 17
to vim/vim, Subscribed
zeertzjq left a comment (vim/vim#20552)

I think this is caused by 8e41c34


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20552/4737314601@github.com>

user202729

unread,
Jun 17, 2026, 10:39:40 PM (2 hours ago) Jun 17
to vim/vim, Subscribed
user202729 left a comment (vim/vim#20552)

Looks correct. I think the proper patch would be to escape the map command properly (also why do the directory name get to the map command at all? Puzzling)


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/20552/4737329687@github.com>

Reply all
Reply to author
Forward
0 new messages