runtime(man): honor cmd modifiers before `g:ft_man_open_mode`

Commit: 
https://github.com/vim/vim/commit/84ca1388d8d9a9858f37a5c0586527589cbdadda
Author: Ivan Shapovalov <inte...@intelfx.name>
Date:   Sat Jul 6 16:56:02 2024 +0200

    runtime(man): honor cmd modifiers before `g:ft_man_open_mode`
    
    Give priority to (placement) command modifiers, specifically
    `:vertical`, `:horizontal` and `:tab`, ahead of `g:ft_man_open_mode`,
    so that if the user says e.g. `:vert Man`, Vim does the expected thing.
    
    closes: #15117
    
    Signed-off-by: Ivan Shapovalov <inte...@intelfx.name>
    Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/autoload/dist/man.vim b/runtime/autoload/dist/man.vim
index 708e1062b..d9dbaf47d 100644
--- a/runtime/autoload/dist/man.vim
+++ b/runtime/autoload/dist/man.vim
@@ -4,6 +4,7 @@
 " Maintainer:  SungHyun Nam <gow...@gmail.com>
 " Autoload Split: Bram Moolenaar
 " Last Change:         2024 Jan 17 (make it work on AIX, see #13847)
+"              2024 Jul 06 (honor command modifiers, #15117)
 
 let s:cpo_save = &cpo
 set cpo-=C
@@ -165,7 +166,9 @@ func dist#man#GetPage(cmdmods, ...)
       endwhile
     endif
     if &filetype != "man"
-      if exists("g:ft_man_open_mode")
+      if a:cmdmods =~ '\<\(tab\|vertical\|horizontal\)\>'
+       let open_cmd = a:cmdmods . ' split'
+      elseif exists("g:ft_man_open_mode")
         if g:ft_man_open_mode == 'vert'
          let open_cmd = 'vsplit'
         elseif g:ft_man_open_mode == 'tab'
@@ -174,7 +177,7 @@ func dist#man#GetPage(cmdmods, ...)
          let open_cmd = 'split'
         endif
       else
-       let open_cmd = a:cmdmods . ' split'
+       let open_cmd = 'split'
       endif
     endif
   endif
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index 87484bf69..f0723ef7b 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -4,6 +4,7 @@
 " Maintainer:  SungHyun Nam <gow...@gmail.com>
 " Autoload Split: Bram Moolenaar
 " Last Change: 2024 Jun 06 (disabled the q mapping, #8210)
+"              2024 Jul 06 (use nnoremap, #15130)
 
 " To make the ":Man" command available before editing a manual page, source
 " this script from your startup vimrc file.

-- 
-- 
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 on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1sQ6tS-006hRb-FE%40256bit.org.

Raspunde prin e-mail lui