Skip to content

Commit 06aa378

Browse files
zeertzjqchrisbra
authored andcommitted
patch 9.2.0256: visual selection size not shown in showcmd during test
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>
1 parent 96898d7 commit 06aa378

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/normal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,8 @@ clear_showcmd(void)
16161616
if (!p_sc)
16171617
return;
16181618

1619-
if (VIsual_active && !char_avail())
1619+
if (VIsual_active
1620+
&& stuff_empty() && typebuf.tb_len == 0 && !using_script())
16201621
{
16211622
int cursor_bot = LT_POS(VIsual, curwin->w_cursor);
16221623
long lines;

src/testdir/test_visual.vim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1634,7 +1634,6 @@ func Test_visual_block_hl_with_autoselect()
16341634
call writefile(lines, 'XTest_visual_block_autoselect', 'D')
16351635

16361636
let buf = RunVimInTerminal('-S XTest_visual_block_autoselect', {'rows': 10})
1637-
call TermWait(buf)
16381637
call VerifyScreenDump(buf, 'Test_visual_block_hl_with_autoselect_1', {})
16391638
call term_sendkeys(buf, 'l')
16401639
call VerifyScreenDump(buf, 'Test_visual_block_hl_with_autoselect_2', {})

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
256,
737739
/**/
738740
255,
739741
/**/

0 commit comments

Comments
 (0)