From c46c21b4ca476c0846a410d7c4d8c6e3e930f167 Mon Sep 17 00:00:00 2001 From: MiguelBarro <45819833+MiguelBarro@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:07:17 +0100 Subject: [PATCH] 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 --- runtime/autoload/netrw.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 0006d133c..d9baabb01 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(""))