File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
runtime/pack/dist/opt/netrw/autoload Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 1313" 2025 Oct 26 by Vim Project fix parsing of remote user names #18611
1414" 2025 Oct 27 by Vim Project align comment after #18611
1515" 2025 Nov 01 by Vim Project fix NetrwChgPerm #18674
16+ " 2025 Nov 13 by Vim Project don't wipe unnamed buffers #18740
1617" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
1718" Permission is hereby granted to use and distribute this code,
1819" with or without modifications, provided that this copyright
@@ -8315,7 +8316,7 @@ function netrw#LocalBrowseCheck(dirname)
83158316 let ibuf = 1
83168317 let buflast = bufnr (" $" )
83178318 while ibuf <= buflast
8318- if bufwinnr (ibuf) == -1 && isdirectory (s: NetrwFile (bufname (ibuf)))
8319+ if bufwinnr (ibuf) == -1 && ! empty ( bufname (ibuf)) && isdirectory (s: NetrwFile (bufname (ibuf)))
83198320 exe " sil! keepj keepalt " .ibuf." bw!"
83208321 endif
83218322 let ibuf= ibuf + 1
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ func Test_netrw_parse_ssh_config_entries()
104104endfunction
105105
106106" username containing special-chars"
107- func Test_netrw_parse_special_char_user ()
107+ func Test_netrw_parse_special_char_user ()
108108 call s: setup ()
109109 let result = TestNetrwCaptureRemotePath (' scp://user-01@localhost:2222/test.txt' )
110110 call assert_equal (result.method, ' scp' )
@@ -114,3 +114,19 @@ func Test_netrw_parse_special_char_user ()
114114 call assert_equal (result.path , ' test.txt' )
115115 call s: cleanup ()
116116endfunction
117+
118+ func Test_netrw_wipe_empty_buffer_fastpath ()
119+ let g: netrw_fastbrowse= 0
120+ packadd netrw
121+ call setline (1 , ' foobar' )
122+ let bufnr = bufnr (' %' )
123+ tabnew
124+ Explore
125+ call search (' README.txt' , ' W' )
126+ exe " :norm \<cr> "
127+ call assert_equal (4 , bufnr (' $' ))
128+ call assert_true (bufexists (bufnr ))
129+ bw
130+
131+ unlet ! netrw_fastbrowse
132+ endfunction
Original file line number Diff line number Diff line change @@ -729,6 +729,8 @@ static char *(features[]) =
729729
730730static int included_patches [] =
731731{ /* Add new patch number below this line */
732+ /**/
733+ 1914 ,
732734/**/
733735 1913 ,
734736/**/
You can’t perform that action at this time.
0 commit comments