summaryrefslogtreecommitdiffstats
path: root/src/message.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-13 22:15:56 +0200
committerBram Moolenaar <Bram@vim.org>2020-10-13 22:15:56 +0200
commit3d30af8783bf43fbfece641ec81ad8d2f01b3735 (patch)
treede6cca0163885d9bcdc5a223a76abf5f3e9393bb /src/message.c
parentb9616af23f31fc18721a92643c21f42b69854efe (diff)
patch 8.2.1844: using "q" at the more prompt doesn't stop a long messagev8.2.1844
Problem: Using "q" at the more prompt doesn't stop a long message. Solution: Check for "got_int". (closes #7122)
Diffstat (limited to 'src/message.c')
-rw-r--r--src/message.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/message.c b/src/message.c
index c52795286b..42641211ce 100644
--- a/src/message.c
+++ b/src/message.c
@@ -1551,6 +1551,10 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
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,7 +1572,7 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
* Go over the string. Special characters are translated and printed.
* Normal characters are printed several at a time.
*/
- while (--len >= 0)
+ while (--len >= 0 && !got_int)
{
if (enc_utf8)
// Don't include composing chars after the end.
@@ -1618,10 +1622,12 @@ msg_outtrans_len_attr(char_u *msgstr, int len, int attr)
}
}
- if (str > plain_start)
+ 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;
}