Patch 8.2.1844

9 views
Skip to first unread message

Bram Moolenaar

unread,
Oct 13, 2020, 4:16:36 PM10/13/20
to vim...@googlegroups.com

Patch 8.2.1844
Problem: Using "q" at the more prompt doesn't stop a long message.
Solution: Check for "got_int". (closes #7122)
Files: src/message.c, src/testdir/test_messages.vim,
src/testdir/dumps/Test_quit_long_message.dump


*** ../vim-8.2.1843/src/message.c 2020-10-12 22:07:09.635378856 +0200
--- src/message.c 2020-10-13 22:14:22.422932305 +0200
***************
*** 1551,1556 ****
--- 1551,1560 ----
char_u *s;
int mb_l;
int c;
+ int save_got_int = got_int;
+
+ // Only quit when got_int was set in here.
+ got_int = FALSE;

// if MSG_HIST flag set, add message to history
if (attr & MSG_HIST)
***************
*** 1568,1574 ****
* Go over the string. Special characters are translated and printed.
* Normal characters are printed several at a time.
*/
! while (--len >= 0)
{
if (enc_utf8)
// Don't include composing chars after the end.
--- 1572,1578 ----
* Go over the string. Special characters are translated and printed.
* Normal characters are printed several at a time.
*/
! while (--len >= 0 && !got_int)
{
if (enc_utf8)
// Don't include composing chars after the end.
***************
*** 1618,1627 ****
}
}

! if (str > plain_start)
// print the printable chars at the end
msg_puts_attr_len((char *)plain_start, (int)(str - plain_start), attr);

return retval;
}

--- 1622,1633 ----
}
}

! if (str > plain_start && !got_int)
// print the printable chars at the end
msg_puts_attr_len((char *)plain_start, (int)(str - plain_start), attr);

+ got_int |= save_got_int;
+
return retval;
}

*** ../vim-8.2.1843/src/testdir/test_messages.vim 2020-08-12 18:50:31.883655785 +0200
--- src/testdir/test_messages.vim 2020-10-13 22:06:10.488267880 +0200
***************
*** 4,9 ****
--- 4,10 ----
source shared.vim
source term_util.vim
source view_util.vim
+ source screendump.vim

func Test_messages()
let oldmore = &more
***************
*** 309,312 ****
--- 310,329 ----
nunmap <C-B>
endfunc

+ func Test_quit_long_message()
+ CheckScreendump
+
+ let content =<< trim END
+ echom range(9999)->join("\x01")
+ END
+ call writefile(content, 'Xtest_quit_message')
+ let buf = RunVimInTerminal('-S Xtest_quit_message', #{rows: 6})
+ call term_sendkeys(buf, "q")
+ call VerifyScreenDump(buf, 'Test_quit_long_message', {})
+
+ " clean up
+ call StopVimInTerminal(buf)
+ call delete('Xtest_diff_rnu')
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.1843/src/testdir/dumps/Test_quit_long_message.dump 2020-10-13 22:15:19.854774985 +0200
--- src/testdir/dumps/Test_quit_long_message.dump 2020-10-13 22:06:27.904221131 +0200
***************
*** 0 ****
--- 1,6 ----
+ > +0&#ffffff0@74
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ | +0#0000000&@56|0|,|0|-|1| @8|A|l@1|
*** ../vim-8.2.1843/src/version.c 2020-10-13 21:11:09.319812379 +0200
--- src/version.c 2020-10-13 22:07:53.383990893 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 1844,
/**/

--
Ed's Radiator Shop: The Best Place in Town to Take a Leak.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages