]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0256: visual selection size not shown in showcmd during test v9.2.0256
authorzeertzjq <zeertzjq@outlook.com>
Thu, 26 Mar 2026 20:38:39 +0000 (20:38 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 26 Mar 2026 20:38:39 +0000 (20:38 +0000)
Problem:  The visual selection size is not displayed in the showcmd area
          when entering visual mode from a script or mapping, because
          char_avail() incorrectly reports input as pending. This causes
          test failure on CI with the ASAN CI runner.
Solution: Replace char_avail() with explicit checks for an empty stuff
          buffer, empty typeahead buffer, and not running a script
          (zeertzjq).

related: #19801
closes:  #19824

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/normal.c
src/testdir/test_visual.vim
src/version.c

index a9b01821d47db0b5cee97f715935c970c3585a55..01ea4c0915a2314427b9194e7712afa6f5410650 100644 (file)
@@ -1616,7 +1616,8 @@ clear_showcmd(void)
     if (!p_sc)
        return;
 
-    if (VIsual_active && !char_avail())
+    if (VIsual_active
+       && stuff_empty() && typebuf.tb_len == 0 && !using_script())
     {
        int             cursor_bot = LT_POS(VIsual, curwin->w_cursor);
        long            lines;
index 1ba407f05138fd60790391704000cd233695ccb6..ac27354d489f3a220d891d9721fee910fe2f3b0f 100644 (file)
@@ -1634,7 +1634,6 @@ func Test_visual_block_hl_with_autoselect()
   call writefile(lines, 'XTest_visual_block_autoselect', 'D')
 
   let buf = RunVimInTerminal('-S XTest_visual_block_autoselect', {'rows': 10})
-  call TermWait(buf)
   call VerifyScreenDump(buf, 'Test_visual_block_hl_with_autoselect_1', {})
   call term_sendkeys(buf, 'l')
   call VerifyScreenDump(buf, 'Test_visual_block_hl_with_autoselect_2', {})
index a1e911946f73533d676247d1102522e4a4bbe7ee..5dbd0f40178b0cba46f733cdd9bee7fe2cae7065 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    256,
 /**/
     255,
 /**/