" 2026 Apr 01 by Vim Project use fnameescape() with netrw#FileUrlEdit()
" 2026 Apr 05 by Vim Project Fix netrw#RFC2396() #19913
" 2026 Apr 15 by Vim Project Add missing escape()
+" 2026 Apr 19 by Vim Project expand ~ on Windows #20003
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
NetrwKeepj norm! 0
if a:0 > 0
- if a:1 =~ '^\~' && (has("unix") || g:netrw_cygwin)
- let dirname= simplify(substitute(a:1,'\~',expand("$HOME"),''))
+ if a:1 =~ '^\~' && (has("unix") || has("win32") || g:netrw_cygwin)
+ let dirname= simplify(substitute(a:1,'^\~',escape(expand("$HOME"),'\&~'),''))
elseif a:1 == '.'
let dirname= simplify(exists("b:netrw_curdir")? b:netrw_curdir : getcwd())
if dirname !~ '/$'
call assert_equal('a b', netrw#RFC2396(fname))
endfunc
+func Test_netrw_Home_tilde()
+ Explore ~
+ call assert_match('Netrw Directory Listing', getline(2))
+ bw!
+endfunc
+
" vim:ts=8 sts=2 sw=2 et