aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hahler <git@thequod.de>2019-10-19 23:45:27 +0200
committerDaniel Hahler <git@thequod.de>2019-10-20 00:54:07 +0200
commit924fa143ccd4e144a95a0dd2630e609f896f0c59 (patch)
tree6897b593e7daf9b0de7156e46067e24c2874360b
parent327e8ddb183071df0882410efa13605c2a3f0797 (diff)
downloadrneovim-924fa143ccd4e144a95a0dd2630e609f896f0c59.tar.gz
rneovim-924fa143ccd4e144a95a0dd2630e609f896f0c59.tar.bz2
rneovim-924fa143ccd4e144a95a0dd2630e609f896f0c59.zip
[release-0.4] ex_echo: fix check for got_int #11225
It needs to return to not output any remaining parts. Followup to https://github.com/neovim/neovim/pull/10926 Ref: https://github.com/neovim/neovim/issues/10923 (cherry picked from commit 93fe30593b47fe98a31c6bb67f4d6effb8b725fe)
-rw-r--r--src/nvim/message.c5
-rw-r--r--test/functional/ui/messages_spec.lua2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 30e906cd5f..0fe38498a7 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -233,7 +233,10 @@ void msg_multiline_attr(const char *s, int attr, bool check_int)
{
const char *next_spec = s;
- while (next_spec != NULL && (!check_int || !got_int)) {
+ while (next_spec != NULL) {
+ if (check_int && got_int) {
+ return;
+ }
next_spec = strpbrk(s, "\t\n\r");
if (next_spec != NULL) {
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index 377d49c036..d16559bab2 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -1125,7 +1125,7 @@ aliquip ex ea commodo consequat.]])
it('can be quit', function()
screen:try_resize(25,5)
- feed(':echon join(map(range(0, &lines*2), "v:val"), "\\n")<cr>')
+ feed(':echon join(map(range(0, &lines*10), "v:val"), "\\n")<cr>')
screen:expect{grid=[[
0 |
1 |