Skip to content

Commit 040a47a

Browse files
MiguelBarrochrisbra
authored andcommitted
runtime(netrw): Use proper UNC notation for temp files
closes: #18764 Signed-off-by: Guybrush <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent c2cc63e commit 040a47a

File tree

1 file changed

+3
-2
lines changed
  • runtime/pack/dist/opt/netrw/autoload

1 file changed

+3
-2
lines changed

runtime/pack/dist/opt/netrw/autoload/netrw.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
" 2025 Oct 27 by Vim Project align comment after #18611
1515
" 2025 Nov 01 by Vim Project fix NetrwChgPerm #18674
1616
" 2025 Nov 13 by Vim Project don't wipe unnamed buffers #18740
17+
" 2025 Nov 18 by Vim Project use UNC paths when using scp and Windows paths #18764
1718
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
1819
" Permission is hereby granted to use and distribute this code,
1920
" with or without modifications, provided that this copyright
@@ -1701,10 +1702,10 @@ function netrw#NetRead(mode,...)
17011702
else
17021703
let useport= ""
17031704
endif
1704-
" 'C' in 'C:\path\to\file' is handled as hostname on windows.
1705+
" Using UNC notation in windows to get a unix like path.
17051706
" This is workaround to avoid mis-handle windows local-path:
17061707
if g:netrw_scp_cmd =~ '^scp' && has("win32")
1707-
let tmpfile_get = substitute(tr(tmpfile, '\', '/'), '^\(\a\):[/\\]\(.*\)$', '/\1/\2', '')
1708+
let tmpfile_get = substitute(tr(tmpfile, '\', '/'), '^\(\a\):[/\\]\(.*\)$', '//' .. $COMPUTERNAME .. '/\1$/\2', '')
17081709
else
17091710
let tmpfile_get = tmpfile
17101711
endif

0 commit comments

Comments
 (0)