mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 13:26:06 +00:00
vim-patch:6a6a44f: runtime(netrw): netrw#BrowseX() needs to distinguish local and remote file
fixes: vim/vim#17794
6a6a44ffb5
Co-authored-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
10
runtime/pack/dist/opt/netrw/autoload/netrw.vim
vendored
10
runtime/pack/dist/opt/netrw/autoload/netrw.vim
vendored
@@ -3,6 +3,7 @@
|
|||||||
" Maintainer: This runtime file is looking for a new maintainer.
|
" Maintainer: This runtime file is looking for a new maintainer.
|
||||||
" Last Change:
|
" Last Change:
|
||||||
" 2025 Aug 07 by Vim Project (use correct "=~#" for netrw_stylesize option #17901)
|
" 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
|
" Copyright: Copyright (C) 2016 Charles E. Campbell {{{1
|
||||||
" Permission is hereby granted to use and distribute this code,
|
" Permission is hereby granted to use and distribute this code,
|
||||||
" with or without modifications, provided that this copyright
|
" with or without modifications, provided that this copyright
|
||||||
@@ -4125,7 +4126,7 @@ function s:NetrwBrowseUpDir(islocal)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" netrw#BrowseX: (implements "x") executes a special "viewer" script or program for the {{{2
|
" 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)
|
function netrw#BrowseX(fname)
|
||||||
" special core dump handler
|
" special core dump handler
|
||||||
if a:fname =~ '/core\(\.\d\+\)\=$' && exists("g:Netrw_corehandler")
|
if a:fname =~ '/core\(\.\d\+\)\=$' && exists("g:Netrw_corehandler")
|
||||||
@@ -4149,7 +4150,12 @@ function netrw#BrowseX(fname)
|
|||||||
let fname = substitute(fname, '^\~', expand("$HOME"), '')
|
let fname = substitute(fname, '^\~', expand("$HOME"), '')
|
||||||
endif
|
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
|
endfunction
|
||||||
|
|
||||||
" s:NetrwBufRename: renames a buffer without the side effect of retaining an unlisted buffer having the old name {{{2
|
" s:NetrwBufRename: renames a buffer without the side effect of retaining an unlisted buffer having the old name {{{2
|
||||||
|
Reference in New Issue
Block a user