diff options
author | Christian Clason <c.clason@uni-graz.at> | 2024-09-15 19:31:06 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2024-09-16 08:16:20 +0200 |
commit | 5e7933693bd87fc5e39e9680cac2a5e17775bfb9 (patch) | |
tree | 8c1c4869f9f5f71b338b392d2029dde7678e5349 | |
parent | f408603f4fc10ef2ff2dd3b6550365109b0b6214 (diff) | |
download | rneovim-5e7933693bd87fc5e39e9680cac2a5e17775bfb9.tar.gz rneovim-5e7933693bd87fc5e39e9680cac2a5e17775bfb9.tar.bz2 rneovim-5e7933693bd87fc5e39e9680cac2a5e17775bfb9.zip |
vim-patch:0f5effb: runtime(netrw): delete confirmation not strict enough
fixes: vim/vim#15680
https://github.com/vim/vim/commit/0f5effbd1fb58128be677aa577d3d0ab2fc9527a
Co-authored-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | runtime/autoload/netrw.vim | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index cb71d2e110..c38529d0e5 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -23,6 +23,7 @@ " 2024 Aug 15 by Vim Project: style changes, prevent E121 (#15501) " 2024 Aug 22 by Vim Project: fix mf-selection highlight (#15551) " 2024 Aug 22 by Vim Project: adjust echo output of mx command (#15550) +" 2024 Sep 15 by Vim Project: more strict confirmation dialog (#15680) " }}} " Former Maintainer: Charles E Campbell " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim @@ -11275,7 +11276,7 @@ fun! s:NetrwLocalRm(path) range let ok= s:NetrwLocalRmFile(a:path,fname,all) if ok =~# 'q\%[uit]' || ok == "no" break - elseif ok =~# 'a\%[ll]' + elseif ok =~# '^a\%[ll]$' let all= 1 endif endfor @@ -11304,7 +11305,7 @@ fun! s:NetrwLocalRm(path) range let ok= s:NetrwLocalRmFile(a:path,curword,all) if ok =~# 'q\%[uit]' || ok == "no" break - elseif ok =~# 'a\%[ll]' + elseif ok =~# '^a\%[ll]$' let all= 1 endif let ctr= ctr + 1 @@ -11351,12 +11352,12 @@ fun! s:NetrwLocalRmFile(path,fname,all) " call Decho("response: ok<".ok.">",'~'.expand("<slnum>")) let ok= substitute(ok,'\[{y(es)},n(o),a(ll),q(uit)]\s*','','e') " call Decho("response: ok<".ok."> (after sub)",'~'.expand("<slnum>")) - if ok =~# 'a\%[ll]' + if ok =~# '^a\%[ll]$' let all= 1 endif endif - if all || ok =~# 'y\%[es]' || ok == "" + if all || ok =~# '^y\%[es]$' || ok == "" let ret= s:NetrwDelete(rmfile) " call Decho("errcode=".v:shell_error." ret=".ret,'~'.expand("<slnum>")) endif @@ -11372,13 +11373,13 @@ fun! s:NetrwLocalRmFile(path,fname,all) if ok == "" let ok="no" endif - if ok =~# 'a\%[ll]' + if ok =~# '^a\%[ll]$' let all= 1 endif endif let rmfile= substitute(rmfile,'[\/]$','','e') - if all || ok =~# 'y\%[es]' || ok == "" + if all || ok =~# '^y\%[es]$' || ok == "" if delete(rmfile,"rf") call netrw#ErrorMsg(s:ERROR,"unable to delete directory <".rmfile.">!",103) endif |