From 0da18ae5ceb2a53115332d3f6993437cca67b9b4 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 1 Feb 2024 09:33:02 +0100 Subject: [PATCH] vim-patch:c46c21b4ca47 runtime(netrw): fixing remote file removal via ssh (vim/vim#13942) Make pattern, which retrieves the path component from e.g. `scp://user@host//opt/program/file.ext` non-greedy. https://github.com/vim/vim/commit/c46c21b4ca476c0846a410d7c4d8c6e3e930f167 Co-authored-by: MiguelBarro <45819833+MiguelBarro@users.noreply.github.com> --- 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 88a5c3128c..d457d7d1de 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -10558,7 +10558,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(""))