diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-09-27 22:24:50 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-09-27 23:05:14 +0200 |
commit | 448d4837be7f7bd60ac0b5a3100c0217ac48a495 (patch) | |
tree | 9eb1707c0cae31a9d97569b5024e0c12ff72d449 /src | |
parent | b85f1dafc7c0a19704135617454f1c66f41202c1 (diff) | |
download | rneovim-448d4837be7f7bd60ac0b5a3100c0217ac48a495.tar.gz rneovim-448d4837be7f7bd60ac0b5a3100c0217ac48a495.tar.bz2 rneovim-448d4837be7f7bd60ac0b5a3100c0217ac48a495.zip |
refactor(messages): rename msg_trunc_attr and msg_multiline_attr without attr
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer.c | 2 | ||||
-rw-r--r-- | src/nvim/bufwrite.c | 2 | ||||
-rw-r--r-- | src/nvim/eval.c | 2 | ||||
-rw-r--r-- | src/nvim/fileio.c | 2 | ||||
-rw-r--r-- | src/nvim/insexpand.c | 12 | ||||
-rw-r--r-- | src/nvim/message.c | 8 | ||||
-rw-r--r-- | src/nvim/search.c | 4 |
7 files changed, 16 insertions, 16 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 1ef1f26d6b..87096767f9 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3233,7 +3233,7 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate) msg(buffer, 0); msg_scroll = n; } else { - p = msg_trunc_attr(buffer, false, 0); + p = msg_trunc(buffer, false, 0); if (restart_edit != 0 || (msg_scrolled && !need_wait_return)) { // Need to repeat the message after redrawing when: // - When restart_edit is set (otherwise there will be a delay diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c index f2f6833db5..770c269b0e 100644 --- a/src/nvim/bufwrite.c +++ b/src/nvim/bufwrite.c @@ -1785,7 +1785,7 @@ restore_backup: } } - set_keep_msg(msg_trunc_attr(IObuff, false, 0), 0); + set_keep_msg(msg_trunc(IObuff, false, 0), 0); } // When written everything correctly: reset 'modified'. Unless not diff --git a/src/nvim/eval.c b/src/nvim/eval.c index dc07c0fc90..f7614af548 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -8018,7 +8018,7 @@ void ex_echo(exarg_T *eap) char *tofree = encode_tv2echo(&rettv, NULL); if (*tofree != NUL) { msg_ext_set_kind("echo"); - msg_multiline_attr(tofree, echo_attr, true, &need_clear); + msg_multiline(tofree, echo_attr, true, &need_clear); } xfree(tofree); } diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index dfa61e7cf7..7c1d495505 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -1762,7 +1762,7 @@ failed: if (msg_col > 0) { msg_putchar('\r'); // overwrite previous message } - p = (uint8_t *)msg_trunc_attr(IObuff, false, 0); + p = (uint8_t *)msg_trunc(IObuff, false, 0); } if (read_stdin || read_buffer || restart_edit != 0 diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 80118e9e11..e1e1750e8e 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -1451,10 +1451,10 @@ static void ins_compl_files(int count, char **files, int thesaurus, int flags, r for (i = 0; i < count && !got_int && !compl_interrupted; i++) { fp = os_fopen(files[i], "r"); // open dictionary file if (flags != DICT_EXACT && !shortmess(SHM_COMPLETIONSCAN)) { - msg_hist_off = true; // reset in msg_trunc_attr() + msg_hist_off = true; // reset in msg_trunc() vim_snprintf(IObuff, IOSIZE, _("Scanning dictionary: %s"), files[i]); - (void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R)); + (void)msg_trunc(IObuff, true, HL_ATTR(HLF_R)); } if (fp == NULL) { @@ -2877,14 +2877,14 @@ static int process_next_cpt_value(ins_compl_next_state_T *st, int *compl_type_ar st->dict_f = DICT_EXACT; } if (!shortmess(SHM_COMPLETIONSCAN)) { - msg_hist_off = true; // reset in msg_trunc_attr() + msg_hist_off = true; // reset in msg_trunc() vim_snprintf(IObuff, IOSIZE, _("Scanning: %s"), st->ins_buf->b_fname == NULL ? buf_spname(st->ins_buf) : st->ins_buf->b_sfname == NULL ? st->ins_buf->b_fname : st->ins_buf->b_sfname); - (void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R)); + (void)msg_trunc(IObuff, true, HL_ATTR(HLF_R)); } } else if (*st->e_cpt == NUL) { status = INS_COMPL_CPT_END; @@ -2908,9 +2908,9 @@ static int process_next_cpt_value(ins_compl_next_state_T *st, int *compl_type_ar } else if (*st->e_cpt == ']' || *st->e_cpt == 't') { compl_type = CTRL_X_TAGS; if (!shortmess(SHM_COMPLETIONSCAN)) { - msg_hist_off = true; // reset in msg_trunc_attr() + msg_hist_off = true; // reset in msg_trunc() vim_snprintf(IObuff, IOSIZE, "%s", _("Scanning tags.")); - (void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R)); + (void)msg_trunc(IObuff, true, HL_ATTR(HLF_R)); } } diff --git a/src/nvim/message.c b/src/nvim/message.c index a9d5fb332b..63d1b44d67 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -233,7 +233,7 @@ int msg(const char *s, const int attr) } /// Similar to msg_outtrans, but support newlines and tabs. -void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clear) +void msg_multiline(const char *s, int attr, bool check_int, bool *need_clear) FUNC_ATTR_NONNULL_ALL { const char *next_spec = s; @@ -273,7 +273,7 @@ void msg_multiattr(HlMessage hl_msg, const char *kind, bool history) msg_ext_set_kind(kind); for (uint32_t i = 0; i < kv_size(hl_msg); i++) { HlMessageChunk chunk = kv_A(hl_msg, i); - msg_multiline_attr(chunk.text.data, chunk.attr, true, &need_clear); + msg_multiline(chunk.text.data, chunk.attr, true, &need_clear); } if (history && kv_size(hl_msg)) { add_msg_hist_multiattr(NULL, 0, 0, true, hl_msg); @@ -334,7 +334,7 @@ bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline) bool need_clear = true; if (multiline) { - msg_multiline_attr(s, attr, false, &need_clear); + msg_multiline(s, attr, false, &need_clear); } else { msg_outtrans(s, attr); } @@ -903,7 +903,7 @@ void msg_schedule_semsg_multiline(const char *const fmt, ...) /// Careful: The string may be changed by msg_may_trunc()! /// /// @return a pointer to the printed message, if wait_return() not called. -char *msg_trunc_attr(char *s, bool force, int attr) +char *msg_trunc(char *s, bool force, int attr) { int n; diff --git a/src/nvim/search.c b/src/nvim/search.c index bf6e60026a..e9b92ce3f4 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -3791,11 +3791,11 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool files[depth].lnum = 0; files[depth].matched = false; if (action == ACTION_EXPAND) { - msg_hist_off = true; // reset in msg_trunc_attr() + msg_hist_off = true; // reset in msg_trunc() vim_snprintf(IObuff, IOSIZE, _("Scanning included file: %s"), new_fname); - msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R)); + msg_trunc(IObuff, true, HL_ATTR(HLF_R)); } else if (p_verbose >= 5) { verbose_enter(); smsg(_("Searching included file %s"), new_fname); |