runtime(man): don't add jumps when loading a manpage

Commit: 
https://github.com/vim/vim/commit/b34ce3e2058921450f6985bb0b6db477789d84c6
Author: David Mandelberg <da...@mandelberg.org>
Date:   Wed Mar 5 20:38:20 2025 +0100

    runtime(man): don't add jumps when loading a manpage
    
    Without this change, pressing K while in one manpage to load another
    one, then pressing CTRL-O to go back, results in going to the bottom of
    the current (second) manpage. With this change, it goes back to the
    previous manpage.
    
    closes: #16791
    
    Signed-off-by: David Mandelberg <da...@mandelberg.org>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/autoload/dist/man.vim b/runtime/autoload/dist/man.vim
index d9dbaf47d..281b75158 100644
--- a/runtime/autoload/dist/man.vim
+++ b/runtime/autoload/dist/man.vim
@@ -5,6 +5,7 @@
 " Autoload Split: Bram Moolenaar
 " Last Change:         2024 Jan 17 (make it work on AIX, see #13847)
 "              2024 Jul 06 (honor command modifiers, #15117)
+"              2025 Mar 05 (add :keepjumps, #16791)
 
 let s:cpo_save = &cpo
 set cpo-=C
@@ -188,7 +189,7 @@ func dist#man#GetPage(cmdmods, ...)
   setl buftype=nofile noswapfile
 
   setl fdc=0 ma nofen nonu nornu
-  %delete _
+  keepjumps %delete _
   let unsetwidth = 0
   if empty($MANWIDTH)
     let $MANWIDTH = winwidth(0)
@@ -218,10 +219,10 @@ func dist#man#GetPage(cmdmods, ...)
   endif
   " Remove blank lines from top and bottom.
   while line('$') > 1 && getline(1) =~ '^\s*$'
-    1delete _
+    keepjumps 1delete _
   endwhile
   while line('$') > 1 && getline('$') =~ '^\s*$'
-    $delete _
+    keepjumps $delete _
   endwhile
   1
   setl ft=man nomod

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1tpufx-00AZvc-3B%40256bit.org.

Raspunde prin e-mail lui