From: MiguelBarro <45819833+MiguelBarro@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:07:17 +0000 (+0100) Subject: runtime(netrw): fixing remote file removal via ssh (#13942) X-Git-Tag: v9.1.0066~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c46c21b4ca476c0846a410d7c4d8c6e3e930f167;p=thirdparty%2Fvim.git runtime(netrw): fixing remote file removal via ssh (#13942) Make pattern, which retrieves the path component from e.g. `scp://user@host//opt/program/file.ext` non-greedy. Signed-off-by: GuyBrush Signed-off-by: Christian Brabandt --- diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 0006d133cc..d9baabb011 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -10668,7 +10668,7 @@ fun! s:NetrwRemoteRmFile(path,rmfile,all) NetrwKeepj call netrw#ErrorMsg(s:ERROR,"for some reason b:netrw_curdir doesn't exist!",53) let ok="q" else - let remotedir= substitute(b:netrw_curdir,'^.*//[^/]\+/\(.*\)$','\1','') + let remotedir= substitute(b:netrw_curdir,'^.\{-}//[^/]\+/\(.*\)$','\1','') " call Decho("netrw_rm_cmd<".netrw_rm_cmd.">",'~'.expand("")) " call Decho("remotedir<".remotedir.">",'~'.expand("")) " call Decho("rmfile<".a:rmfile.">",'~'.expand(""))