patch 9.1.1853: Ctrl-F and Ctrl-B at more prompt not working with key protocol

Commit: 
https://github.com/vim/vim/commit/6622dc2ded496f9e1484034cd4f53e9ba900026f
Author: zeertzjq <[email protected]>
Date:   Mon Oct 13 19:02:10 2025 +0000

    patch 9.1.1853: Ctrl-F and Ctrl-B at more prompt not working with key 
protocol
    
    Problem:  Ctrl-F and Ctrl-B at more prompt not working with kitty
              keyboard protocol or modifyOtherKeys (after v9.1.1849).
    Solution: Call merge_modifyOtherKeys() in get_keystroke() (zeertzjq).
    
    closes: #18558
    
    Signed-off-by: zeertzjq <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/misc1.c b/src/misc1.c
index 225bb3cc2..8af50fc5a 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -871,6 +871,7 @@ get_keystroke(void)
     int                save_mapped_ctrl_c = mapped_ctrl_c;
     int                waited = 0;
 
+    mod_mask = 0;
     mapped_ctrl_c = FALSE;     // mappings are not used here
     for (;;)
     {
@@ -974,7 +975,7 @@ get_keystroke(void)
     vim_free(buf);
 
     mapped_ctrl_c = save_mapped_ctrl_c;
-    return n;
+    return merge_modifyOtherKeys(n, &mod_mask);
 }
 
 // For overflow detection, add a digit safely to an int value.
diff --git a/src/testdir/test_messages.vim b/src/testdir/test_messages.vim
index b1dfa7075..908286c6d 100644
--- a/src/testdir/test_messages.vim
+++ b/src/testdir/test_messages.vim
@@ -209,6 +209,7 @@ func Test_message_more()
   CheckRunVimInTerminal
 
   let buf = RunVimInTerminal('', {'rows': 6})
+  let chan = buf->term_getjob()->job_getchannel()
   call term_sendkeys(buf, ":call setline(1, range(1, 100))
")
 
   call term_sendkeys(buf, ":%pfoo\<C-H>\<C-H>\<C-H>#")
@@ -272,6 +273,19 @@ func Test_message_more()
   call term_sendkeys(buf, 'u')
   call WaitForAssert({-> assert_equal(' 79 79', term_getline(buf, 5))})
 
+  " Test <C-F> and <C-B> with different keyboard protocols.
+  for [ctrl_f, ctrl_b] in [
+        \ [GetEscCodeCSI27('f', 5), GetEscCodeCSI27('b', 5)],
+        \ [GetEscCodeCSI27('F', 5), GetEscCodeCSI27('B', 5)],
+        \ [GetEscCodeCSIu('f', 5), GetEscCodeCSIu('b', 5)],
+        \ [GetEscCodeCSIu('F', 5), GetEscCodeCSIu('B', 5)],
+        \ ]
+    call ch_sendraw(chan, ctrl_f)
+    call WaitForAssert({-> assert_equal(' 84 84', term_getline(buf, 5))})
+    call ch_sendraw(chan, ctrl_b)
+    call WaitForAssert({-> assert_equal(' 79 79', term_getline(buf, 5))})
+  endfor
+
   " Up all the way with 'g'.
   call term_sendkeys(buf, 'g')
   call WaitForAssert({-> assert_equal('  4 4', term_getline(buf, 5))})
@@ -285,6 +299,7 @@ func Test_message_more()
   call WaitForAssert({-> assert_equal('Press ENTER or type command to 
continue', term_getline(buf, 6))})
   call term_sendkeys(buf, 'f')
   call WaitForAssert({-> assert_equal('100 100', term_getline(buf, 5))})
+  call WaitForAssert({-> assert_equal('Press ENTER or type command to 
continue', term_getline(buf, 6))})
   call term_sendkeys(buf, "\<C-F>")
   call WaitForAssert({-> assert_equal('100 100', term_getline(buf, 5))})
   call WaitForAssert({-> assert_equal('Press ENTER or type command to 
continue', term_getline(buf, 6))})
diff --git a/src/version.c b/src/version.c
index 95f88fcb8..100595d66 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1853,
 /**/
     1852,
 /**/

-- 
-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1v8O0g-00CjnD-Ii%40256bit.org.

Raspunde prin e-mail lui