runtime(netrw): netrw#BrowseX() needs to distinguish local and remote file Commit: https://github.com/vim/vim/commit/6a6a44ffb5ad7350a4d313a5faeae17e50bf37a2 Author: Christian Brabandt <c...@256bit.org> Date: Thu Aug 7 20:23:16 2025 +0200
runtime(netrw): netrw#BrowseX() needs to distinguish local and remote file fixes: https://github.com/vim/vim/issues/17794 Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/pack/dist/opt/netrw/autoload/netrw.vim b/runtime/pack/dist/opt/netrw/autoload/netrw.vim index fd0b79115..15a45b37c 100644 --- a/runtime/pack/dist/opt/netrw/autoload/netrw.vim +++ b/runtime/pack/dist/opt/netrw/autoload/netrw.vim @@ -3,6 +3,7 @@ " Maintainer: This runtime file is looking for a new maintainer. " Last Change: " 2025 Aug 07 by Vim Project (use correct "=~#" for netrw_stylesize option #17901) +" 2025 Aug 07 by Vim Project (netrw#BrowseX() distinguishes remote files #17794) " 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 @@ -4125,7 +4126,7 @@ function s:NetrwBrowseUpDir(islocal) endfunction " netrw#BrowseX: (implements "x") executes a special "viewer" script or program for the {{{2 -" given filename; typically this means given their extension. +" given filename; typically this means given their extension. function netrw#BrowseX(fname) " special core dump handler if a:fname =~ '/core\(\.\d\+\)\=$' && exists("g:Netrw_corehandler") @@ -4149,7 +4150,12 @@ function netrw#BrowseX(fname) let fname = substitute(fname, '^\~', expand("$HOME"), '') endif - call netrw#os#Open(s:NetrwFile(fname)) + if fname =~ '^[a-z]\+://' + " open a remote file + call netrw#os#Open(fname) + else + call netrw#os#Open(s:NetrwFile(fname)) + endif endfunction " s:NetrwBufRename: renames a buffer without the side effect of retaining an unlisted buffer having the old name {{{2 -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1uk5NL-000uVL-QT%40256bit.org.