]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(netrw): prevent polluting the search history
authorChristian Brabandt <cb@256bit.org>
Thu, 7 Nov 2024 13:30:30 +0000 (14:30 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 7 Nov 2024 13:31:09 +0000 (14:31 +0100)
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/netrw.vim

index f8554c9dee133afe1ded0e347e4e4c1bd0f4ac7b..a15ca1c9247bf6a8bccbc002ecd6377a838afa45 100644 (file)
@@ -32,6 +32,7 @@
 "   2024 Oct 30 by Vim Project: fix x mapping on cygwin (#13687)
 "   2024 Oct 31 by Vim Project: add netrw#Launch() and netrw#Open() (#15962)
 "   2024 Oct 31 by Vim Project: fix E874 when browsing remote dir (#15964)
+"   2024 Nov 07 by Vim Project: use keeppatterns to prevent polluting the search history
 "   }}}
 " Former Maintainer:   Charles E Campbell
 " GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
@@ -9601,7 +9602,7 @@ fun! s:NetrwTreeListing(dirname)
    endif
 
    " update the dictionary for the current directory
-   exe "sil! NetrwKeepj ".w:netrw_bannercnt.',$g@^\.\.\=/$@d _'
+   exe "sil! NetrwKeepj keepp ".w:netrw_bannercnt.',$g@^\.\.\=/$@d _'
    let w:netrw_treedict[a:dirname]= getline(w:netrw_bannercnt,line("$"))
    exe "sil! NetrwKeepj ".w:netrw_bannercnt.",$d _"
 
@@ -10028,7 +10029,7 @@ fun! s:PerformListing(islocal)
   " resolve symbolic links if local and (thin or tree)
   if a:islocal && (w:netrw_liststyle == s:THINLIST || (exists("w:netrw_liststyle") && w:netrw_liststyle == s:TREELIST))
 "   call Decho("--resolve symbolic links if local and thin|tree",'~'.expand("<slnum>"))
-   sil! g/@$/call s:ShowLink()
+   sil! keepp g/@$/call s:ShowLink()
   endif
 
   if exists("w:netrw_bannercnt") && (line("$") >= w:netrw_bannercnt || !g:netrw_banner)