aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/message.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-30 21:11:53 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-03-31 10:05:26 +0800
commit47630743fc67c56f724cd99660d86d8c4ea7782f (patch)
tree1caa6cb8260d39fab36ba788dfb4784df81ccad2 /src/nvim/message.c
parentb6e3a2dbbb4c408c21dc58723d8dd3d68053f0cb (diff)
downloadrneovim-47630743fc67c56f724cd99660d86d8c4ea7782f.tar.gz
rneovim-47630743fc67c56f724cd99660d86d8c4ea7782f.tar.bz2
rneovim-47630743fc67c56f724cd99660d86d8c4ea7782f.zip
vim-patch:8.2.1844: using "q" at the more prompt doesn't stop a long message
Problem: Using "q" at the more prompt doesn't stop a long message. Solution: Check for "got_int". (closes vim/vim#7122) https://github.com/vim/vim/commit/3d30af8783bf43fbfece641ec81ad8d2f01b3735 Cherry-pick file name change from patch 8.2.2112.
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r--src/nvim/message.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index b3fefbc0f4..7b90f882ab 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -1486,6 +1486,10 @@ int msg_outtrans_len_attr(const 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) {
@@ -1503,7 +1507,7 @@ int msg_outtrans_len_attr(const 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) {
// Don't include composing chars after the end.
mb_l = utfc_ptr2len_len((char_u *)str, len + 1);
if (mb_l > 1) {
@@ -1542,11 +1546,13 @@ int msg_outtrans_len_attr(const 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(plain_start, str - plain_start, attr);
}
+ got_int |= save_got_int;
+
return retval;
}