diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-09-25 21:43:11 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-09-25 21:43:11 +0200 |
commit | 101e99207f813ca48a4c0787eed9eb8bf67fba5a (patch) | |
tree | 4019ce512a00a611baa0cb84f73c1cf7306ab23e /src/channel.c | |
parent | 0d0c3ca007940cdb64ccbfd0e70846eedfe6a4a6 (diff) | |
download | vim-git-101e99207f813ca48a4c0787eed9eb8bf67fba5a.tar.gz |
patch 8.1.2075: get many log messages when waiting for a typed characterv8.1.2075
Problem: Get many log messages when waiting for a typed character.
Solution: Do not repeat the repeated messages when nothing happens.
Diffstat (limited to 'src/channel.c')
-rw-r--r-- | src/channel.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/channel.c b/src/channel.c index d5f4ecced..34ee02a66 100644 --- a/src/channel.c +++ b/src/channel.c @@ -194,8 +194,6 @@ ch_log_lead(const char *what, channel_T *ch, ch_part_T part) } } -static int did_log_msg = TRUE; - #ifndef PROTO // prototype is in proto.h void ch_log(channel_T *ch, const char *fmt, ...) @@ -210,7 +208,7 @@ ch_log(channel_T *ch, const char *fmt, ...) va_end(ap); fputc('\n', log_fd); fflush(log_fd); - did_log_msg = TRUE; + did_repeated_msg = 0; } } #endif @@ -235,7 +233,7 @@ ch_error(channel_T *ch, const char *fmt, ...) va_end(ap); fputc('\n', log_fd); fflush(log_fd); - did_log_msg = TRUE; + did_repeated_msg = 0; } } @@ -3918,7 +3916,7 @@ channel_send( vim_ignored = (int)fwrite(buf_arg, len_arg, 1, log_fd); fprintf(log_fd, "'\n"); fflush(log_fd); - did_log_msg = TRUE; + did_repeated_msg = 0; } for (;;) @@ -4432,10 +4430,11 @@ channel_parse_messages(void) /* Only do this message when another message was given, otherwise we get * lots of them. */ - if (did_log_msg) + if ((did_repeated_msg & REPEATED_MSG_LOOKING) == 0) { ch_log(NULL, "looking for messages on channels"); - did_log_msg = FALSE; + // now we should also give the message for SafeState + did_repeated_msg = REPEATED_MSG_LOOKING; } while (channel != NULL) { |