]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(netrw): fixing remote file removal via ssh (#13942)
authorMiguelBarro <45819833+MiguelBarro@users.noreply.github.com>
Wed, 31 Jan 2024 19:07:17 +0000 (20:07 +0100)
committerGitHub <noreply@github.com>
Wed, 31 Jan 2024 19:07:17 +0000 (20:07 +0100)
Make pattern, which retrieves the path component from e.g.
`scp://user@host//opt/program/file.ext` non-greedy.

Signed-off-by: GuyBrush <miguel.barro@live.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/netrw.vim

index 0006d133ccf37bbc6e2ac033bfbbd6679017f746..d9baabb011a023d10dff4e7504154e6f6f627a63 100644 (file)
@@ -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("<slnum>"))
 "      call Decho("remotedir<".remotedir.">",'~'.expand("<slnum>"))
 "      call Decho("rmfile<".a:rmfile.">",'~'.expand("<slnum>"))