aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-09-27 21:46:39 +0200
committerbfredl <bjorn.linse@gmail.com>2023-09-27 21:46:39 +0200
commitf91cd31d7d9d70006e0000592637d5d997eab52c (patch)
treed0b982c4348583040359ed440414252b5f174589 /src
parent26d6f030231831ad9804f195155111aaf375340a (diff)
downloadrneovim-f91cd31d7d9d70006e0000592637d5d997eab52c.tar.gz
rneovim-f91cd31d7d9d70006e0000592637d5d997eab52c.tar.bz2
rneovim-f91cd31d7d9d70006e0000592637d5d997eab52c.zip
refactor(messages): fold msg_outtrans_attr into msg_outtrans
problem: there are too many different functions in message.c solution: fold some of the functions into themselves
Diffstat (limited to 'src')
-rw-r--r--src/nvim/autocmd.c6
-rw-r--r--src/nvim/buffer.c2
-rw-r--r--src/nvim/cmdexpand.c4
-rw-r--r--src/nvim/cmdhist.c2
-rw-r--r--src/nvim/digraph.c8
-rw-r--r--src/nvim/eval/vars.c2
-rw-r--r--src/nvim/ex_cmds.c4
-rw-r--r--src/nvim/ex_docmd.c4
-rw-r--r--src/nvim/ex_getln.c8
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/highlight_group.c6
-rw-r--r--src/nvim/mapping.c2
-rw-r--r--src/nvim/mark.c15
-rw-r--r--src/nvim/memline.c22
-rw-r--r--src/nvim/menu.c2
-rw-r--r--src/nvim/message.c32
-rw-r--r--src/nvim/ops.c6
-rw-r--r--src/nvim/option.c2
-rw-r--r--src/nvim/os/shell.c6
-rw-r--r--src/nvim/quickfix.c8
-rw-r--r--src/nvim/runtime.c2
-rw-r--r--src/nvim/search.c6
-rw-r--r--src/nvim/sign.c4
-rw-r--r--src/nvim/syntax.c26
-rw-r--r--src/nvim/tag.c14
-rw-r--r--src/nvim/usercmd.c4
26 files changed, 91 insertions, 108 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index ff0c2f063f..f2408a9457 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -228,7 +228,7 @@ static void au_show_for_event(int group, event_T event, const char *pat)
}
msg_col = 4;
- msg_outtrans(ac->pat->pat);
+ msg_outtrans(ac->pat->pat, 0);
}
if (got_int) {
@@ -253,12 +253,12 @@ static void au_show_for_event(int group, event_T event, const char *pat)
} else {
snprintf(msg, msglen, "%s [%s]", exec_to_string, ac->desc);
}
- msg_outtrans(msg);
+ msg_outtrans(msg, 0);
XFREE_CLEAR(msg);
} else if (ac->exec.type == CALLABLE_CB) {
msg_puts_attr(exec_to_string, HL_ATTR(HLF_8));
} else {
- msg_outtrans(exec_to_string);
+ msg_outtrans(exec_to_string, 0);
}
XFREE_CLEAR(exec_to_string);
if (p_verbose > 0) {
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 15fbf7df7b..f04a3be447 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -2858,7 +2858,7 @@ void buflist_list(exarg_T *eap)
buf == curbuf ? (int64_t)curwin->w_cursor.lnum : (int64_t)buflist_findlnum(buf));
}
- msg_outtrans(IObuff);
+ msg_outtrans(IObuff, 0);
line_breakcheck();
}
diff --git a/src/nvim/cmdexpand.c b/src/nvim/cmdexpand.c
index 4da6c3c8ba..290cc336b8 100644
--- a/src/nvim/cmdexpand.c
+++ b/src/nvim/cmdexpand.c
@@ -971,7 +971,7 @@ static void showmatches_oneline(expand_T *xp, char **matches, int numMatches, in
int lastlen = 999;
for (int j = linenr; j < numMatches; j += lines) {
if (xp->xp_context == EXPAND_TAGS_LISTFILES) {
- msg_outtrans_attr(matches[j], HL_ATTR(HLF_D));
+ msg_outtrans(matches[j], HL_ATTR(HLF_D));
p = matches[j] + strlen(matches[j]) + 1;
msg_advance(maxlen + 1);
msg_puts(p);
@@ -1013,7 +1013,7 @@ static void showmatches_oneline(expand_T *xp, char **matches, int numMatches, in
isdir = false;
p = SHOW_MATCH(j);
}
- lastlen = msg_outtrans_attr(p, isdir ? dir_attr : 0);
+ lastlen = msg_outtrans(p, isdir ? dir_attr : 0);
}
if (msg_col > 0) { // when not wrapped around
msg_clr_eos();
diff --git a/src/nvim/cmdhist.c b/src/nvim/cmdhist.c
index 072898706b..96d2710001 100644
--- a/src/nvim/cmdhist.c
+++ b/src/nvim/cmdhist.c
@@ -672,7 +672,7 @@ void ex_history(exarg_T *eap)
} else {
xstrlcat(IObuff, hist[i].hisstr, IOSIZE);
}
- msg_outtrans(IObuff);
+ msg_outtrans(IObuff, 0);
}
if (i == idx) {
break;
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c
index 7a690d889f..69a4676148 100644
--- a/src/nvim/digraph.c
+++ b/src/nvim/digraph.c
@@ -1706,7 +1706,7 @@ static void digraph_header(const char *msg)
if (msg_col > 0) {
msg_putchar('\n');
}
- msg_outtrans_attr(msg, HL_ATTR(HLF_CM));
+ msg_outtrans(msg, HL_ATTR(HLF_CM));
msg_putchar('\n');
}
@@ -1860,7 +1860,7 @@ static void printdigraph(const digr_T *dp, result_T *previous)
*p++ = (char)dp->char2;
*p++ = ' ';
*p = NUL;
- msg_outtrans(buf);
+ msg_outtrans(buf, 0);
p = buf;
// add a space to draw a composing char on
@@ -1870,14 +1870,14 @@ static void printdigraph(const digr_T *dp, result_T *previous)
p += utf_char2bytes(dp->result, p);
*p = NUL;
- msg_outtrans_attr(buf, HL_ATTR(HLF_8));
+ msg_outtrans(buf, HL_ATTR(HLF_8));
p = buf;
if (char2cells(dp->result) == 1) {
*p++ = ' ';
}
assert(p >= buf);
vim_snprintf(p, sizeof(buf) - (size_t)(p - buf), " %3d", dp->result);
- msg_outtrans(buf);
+ msg_outtrans(buf, 0);
}
/// Get the two digraph characters from a typval.
diff --git a/src/nvim/eval/vars.c b/src/nvim/eval/vars.c
index 5d1da956ee..60cf0f8054 100644
--- a/src/nvim/eval/vars.c
+++ b/src/nvim/eval/vars.c
@@ -1378,7 +1378,7 @@ static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t
msg_putchar(' ');
}
- msg_outtrans(string);
+ msg_outtrans(string, 0);
if (type == VAR_FUNC || type == VAR_PARTIAL) {
msg_puts("()");
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index dc7136196e..6a5e8a8d38 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1062,7 +1062,7 @@ void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out
msg_start();
msg_putchar(':');
msg_putchar('!');
- msg_outtrans(newcmd);
+ msg_outtrans(newcmd, 0);
msg_clr_eos();
ui_cursor_goto(msg_row, msg_col);
@@ -4790,7 +4790,7 @@ void ex_oldfiles(exarg_T *eap)
if (!message_filtered(fname)) {
msg_outnum(nr);
msg_puts(": ");
- msg_outtrans(tv_get_string(TV_LIST_ITEM_TV(li)));
+ msg_outtrans(tv_get_string(TV_LIST_ITEM_TV(li)), 0);
msg_clr_eos();
msg_putchar('\n');
os_breakcheck();
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index ea93d0fe91..cbb0ae81c5 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -5137,7 +5137,7 @@ static void ex_tabs(exarg_T *eap)
msg_putchar('\n');
vim_snprintf(IObuff, IOSIZE, _("Tab page %d"), tabcount++);
- msg_outtrans_attr(IObuff, HL_ATTR(HLF_T));
+ msg_outtrans(IObuff, HL_ATTR(HLF_T));
os_breakcheck();
FOR_ALL_WINDOWS_IN_TAB(wp, tp) {
@@ -5155,7 +5155,7 @@ static void ex_tabs(exarg_T *eap)
} else {
home_replace(wp->w_buffer, wp->w_buffer->b_fname, IObuff, IOSIZE, true);
}
- msg_outtrans(IObuff);
+ msg_outtrans(IObuff, 0);
os_breakcheck();
}
}
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 09781f392a..4ec6d24d94 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -3400,7 +3400,7 @@ static void draw_cmdline(int start, int len)
}
}
- msg_outtrans_len(arshape_buf, newlen);
+ msg_outtrans_len(arshape_buf, newlen, 0);
} else {
draw_cmdline_no_arabicshape:
if (kv_size(ccline.last_colors.colors)) {
@@ -3410,12 +3410,10 @@ draw_cmdline_no_arabicshape:
continue;
}
const int chunk_start = MAX(chunk.start, start);
- msg_outtrans_len_attr(ccline.cmdbuff + chunk_start,
- chunk.end - chunk_start,
- chunk.attr);
+ msg_outtrans_len(ccline.cmdbuff + chunk_start, chunk.end - chunk_start, chunk.attr);
}
} else {
- msg_outtrans_len(ccline.cmdbuff + start, len);
+ msg_outtrans_len(ccline.cmdbuff + start, len, 0);
}
}
}
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 7ff3e0ec6e..8a5473acdb 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -118,7 +118,7 @@ void filemess(buf_T *buf, char *name, char *s, int attr)
msg_scroll = msg_scroll_save;
msg_scrolled_ign = true;
// may truncate the message to avoid a hit-return prompt
- msg_outtrans_attr(msg_may_trunc(false, IObuff), attr);
+ msg_outtrans(msg_may_trunc(false, IObuff), attr);
msg_clr_eos();
ui_flush();
msg_scrolled_ign = false;
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index eeed58a9ab..c097c6a524 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -1523,7 +1523,7 @@ static void highlight_list_one(const int id)
didh = true;
msg_puts_attr("links to", HL_ATTR(HLF_D));
msg_putchar(' ');
- msg_outtrans(hl_table[hl_table[id - 1].sg_link - 1].sg_name);
+ msg_outtrans(hl_table[hl_table[id - 1].sg_link - 1].sg_name, 0);
}
if (!didh) {
@@ -1656,7 +1656,7 @@ static bool highlight_list_arg(const int id, bool didh, const int type, int iarg
msg_puts_attr(name, HL_ATTR(HLF_D));
msg_puts_attr("=", HL_ATTR(HLF_D));
}
- msg_outtrans(ts);
+ msg_outtrans(ts, 0);
}
return didh;
}
@@ -1786,7 +1786,7 @@ bool syn_list_header(const bool did_header, const int outlen, const int id, bool
if (got_int) {
return true;
}
- msg_outtrans(hl_table[id - 1].sg_name);
+ msg_outtrans(hl_table[id - 1].sg_name, 0);
name_col = msg_col;
endcol = 15;
} else if ((ui_has(kUIMessages) || msg_silent) && !force_newline) {
diff --git a/src/nvim/mapping.c b/src/nvim/mapping.c
index 35a728314c..f2aeedd430 100644
--- a/src/nvim/mapping.c
+++ b/src/nvim/mapping.c
@@ -2504,7 +2504,7 @@ void ex_map(exarg_T *eap)
// If we are in a secure mode we print the mappings for security reasons.
if (secure) {
secure = 2;
- msg_outtrans(eap->cmd);
+ msg_outtrans(eap->cmd, 0);
msg_putchar('\n');
}
do_exmap(eap, false);
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index 0dc1be526b..23555ba145 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -903,9 +903,9 @@ static void show_one_mark(int c, char *arg, pos_T *p, char *name_arg, int curren
msg_putchar('\n');
if (!got_int) {
snprintf(IObuff, IOSIZE, " %c %6" PRIdLINENR " %4d ", c, p->lnum, p->col);
- msg_outtrans(IObuff);
+ msg_outtrans(IObuff, 0);
if (name != NULL) {
- msg_outtrans_attr(name, current ? HL_ATTR(HLF_D) : 0);
+ msg_outtrans(name, current ? HL_ATTR(HLF_D) : 0);
}
}
}
@@ -1033,10 +1033,9 @@ void ex_jumps(exarg_T *eap)
i == curwin->w_jumplistidx ? '>' : ' ',
i > curwin->w_jumplistidx ? i - curwin->w_jumplistidx : curwin->w_jumplistidx - i,
curwin->w_jumplist[i].fmark.mark.lnum, curwin->w_jumplist[i].fmark.mark.col);
- msg_outtrans(IObuff);
- msg_outtrans_attr(name,
- curwin->w_jumplist[i].fmark.fnum == curbuf->b_fnum
- ? HL_ATTR(HLF_D) : 0);
+ msg_outtrans(IObuff, 0);
+ msg_outtrans(name,
+ curwin->w_jumplist[i].fmark.fnum == curbuf->b_fnum ? HL_ATTR(HLF_D) : 0);
xfree(name);
os_breakcheck();
}
@@ -1072,9 +1071,9 @@ void ex_changes(exarg_T *eap)
i > curwin->w_changelistidx ? i - curwin->w_changelistidx : curwin->w_changelistidx - i,
(long)curbuf->b_changelist[i].mark.lnum,
curbuf->b_changelist[i].mark.col);
- msg_outtrans(IObuff);
+ msg_outtrans(IObuff, 0);
name = mark_line(&curbuf->b_changelist[i].mark, 17);
- msg_outtrans_attr(name, HL_ATTR(HLF_D));
+ msg_outtrans(name, HL_ATTR(HLF_D));
xfree(name);
os_breakcheck();
}
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index dc9173910e..f8f148fa23 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -845,7 +845,7 @@ void ml_recover(bool checkext)
if ((hp = mf_get(mfp, 0, 1)) == NULL) {
msg_start();
msg_puts_attr(_("Unable to read block 0 from "), attr | MSG_HIST);
- msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST);
+ msg_outtrans(mfp->mf_fname, attr | MSG_HIST);
msg_puts_attr(_("\nMaybe no changes were made or Vim did not update the swap file."),
attr | MSG_HIST);
msg_end();
@@ -854,7 +854,7 @@ void ml_recover(bool checkext)
b0p = hp->bh_data;
if (strncmp(b0p->b0_version, "VIM 3.0", 7) == 0) {
msg_start();
- msg_outtrans_attr(mfp->mf_fname, MSG_HIST);
+ msg_outtrans(mfp->mf_fname, MSG_HIST);
msg_puts_attr(_(" cannot be used with this version of Vim.\n"),
MSG_HIST);
msg_puts_attr(_("Use Vim version 3.0.\n"), MSG_HIST);
@@ -867,7 +867,7 @@ void ml_recover(bool checkext)
}
if (b0_magic_wrong(b0p)) {
msg_start();
- msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST);
+ msg_outtrans(mfp->mf_fname, attr | MSG_HIST);
msg_puts_attr(_(" cannot be used on this computer.\n"),
attr | MSG_HIST);
msg_puts_attr(_("The file was created on "), attr | MSG_HIST);
@@ -887,7 +887,7 @@ void ml_recover(bool checkext)
mf_new_page_size(mfp, (unsigned)char_to_long(b0p->b0_page_size));
if (mfp->mf_page_size < previous_page_size) {
msg_start();
- msg_outtrans_attr(mfp->mf_fname, attr | MSG_HIST);
+ msg_outtrans(mfp->mf_fname, attr | MSG_HIST);
msg_puts_attr(_(" has been damaged (page size is smaller than minimum value).\n"),
attr | MSG_HIST);
msg_end();
@@ -1515,7 +1515,7 @@ static time_t swapfile_info(char *fname)
// print name of owner of the file
if (os_get_uname((uv_uid_t)file_info.stat.st_uid, uname, B0_UNAME_SIZE) == OK) {
msg_puts(_(" owned by: "));
- msg_outtrans(uname);
+ msg_outtrans(uname, 0);
msg_puts(_(" dated: "));
} else {
msg_puts(_(" dated: "));
@@ -1543,7 +1543,7 @@ static time_t swapfile_info(char *fname)
if (b0.b0_fname[0] == NUL) {
msg_puts(_("[No Name]"));
} else {
- msg_outtrans(b0.b0_fname);
+ msg_outtrans(b0.b0_fname, 0);
}
msg_puts(_("\n modified: "));
@@ -1551,7 +1551,7 @@ static time_t swapfile_info(char *fname)
if (*(b0.b0_uname) != NUL) {
msg_puts(_("\n user name: "));
- msg_outtrans(b0.b0_uname);
+ msg_outtrans(b0.b0_uname, 0);
}
if (*(b0.b0_hname) != NUL) {
@@ -1560,7 +1560,7 @@ static time_t swapfile_info(char *fname)
} else {
msg_puts(_("\n host name: "));
}
- msg_outtrans(b0.b0_hname);
+ msg_outtrans(b0.b0_hname, 0);
}
if (char_to_long(b0.b0_pid) != 0L) {
@@ -3226,7 +3226,7 @@ static void attention_message(buf_T *buf, char *fname)
msg_puts("\"\n");
const time_t swap_mtime = swapfile_info(fname);
msg_puts(_("While opening file \""));
- msg_outtrans(buf->b_fname);
+ msg_outtrans(buf->b_fname, 0);
msg_puts("\"\n");
FileInfo file_info;
if (!os_fileinfo(buf->b_fname, &file_info)) {
@@ -3248,10 +3248,10 @@ static void attention_message(buf_T *buf, char *fname)
" Quit, or continue with caution.\n"));
msg_puts(_("(2) An edit session for this file crashed.\n"));
msg_puts(_(" If this is the case, use \":recover\" or \"vim -r "));
- msg_outtrans(buf->b_fname);
+ msg_outtrans(buf->b_fname, 0);
msg_puts(_("\"\n to recover the changes (see \":help recovery\").\n"));
msg_puts(_(" If you did this already, delete the swap file \""));
- msg_outtrans(fname);
+ msg_outtrans(fname, 0);
msg_puts(_("\"\n to avoid this message.\n"));
cmdline_row = msg_row;
no_wait_return--;
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index 3b2e45e2a4..f51f2999a3 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -824,7 +824,7 @@ static void show_menus_recursive(vimmenu_T *menu, int modes, int depth)
msg_puts(" ");
}
// Same highlighting as for directories!?
- msg_outtrans_attr(menu->name, HL_ATTR(HLF_D));
+ msg_outtrans(menu->name, HL_ATTR(HLF_D));
}
if (menu != NULL && menu->children == NULL) {
diff --git a/src/nvim/message.c b/src/nvim/message.c
index dba4dba600..4c19c0dd5b 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -237,7 +237,7 @@ int msg_attr(const char *s, const int attr)
return msg_attr_keep(s, attr, false, false);
}
-/// Similar to msg_outtrans_attr, but support newlines and tabs.
+/// Similar to msg_outtrans, but support newlines and tabs.
void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clear)
FUNC_ATTR_NONNULL_ALL
{
@@ -251,7 +251,7 @@ void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clea
if (next_spec != NULL) {
// Printing all char that are before the char found by strpbrk
- msg_outtrans_len_attr(s, (int)(next_spec - s), attr);
+ msg_outtrans_len(s, (int)(next_spec - s), attr);
if (*next_spec != TAB && *need_clear) {
msg_clr_eos();
@@ -265,7 +265,7 @@ void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clea
// Print the rest of the message. We know there is no special
// character because strpbrk returned NULL
if (*s != NUL) {
- msg_outtrans_attr(s, attr);
+ msg_outtrans(s, attr);
}
}
@@ -341,7 +341,7 @@ bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline)
if (multiline) {
msg_multiline_attr(s, attr, false, &need_clear);
} else {
- msg_outtrans_attr(s, attr);
+ msg_outtrans(s, attr);
}
if (need_clear) {
msg_clr_eos();
@@ -1520,7 +1520,7 @@ void msg_home_replace_hl(const char *fname)
static void msg_home_replace_attr(const char *fname, int attr)
{
char *name = home_replace_save(NULL, fname);
- msg_outtrans_attr(name, attr);
+ msg_outtrans(name, attr);
xfree(name);
}
@@ -1529,19 +1529,9 @@ static void msg_home_replace_attr(const char *fname, int attr)
/// Use attributes 'attr'.
///
/// @return the number of characters it takes on the screen.
-int msg_outtrans(const char *str)
+int msg_outtrans(const char *str, int attr)
{
- return msg_outtrans_attr(str, 0);
-}
-
-int msg_outtrans_attr(const char *str, int attr)
-{
- return msg_outtrans_len_attr(str, (int)strlen(str), attr);
-}
-
-int msg_outtrans_len(const char *str, int len)
-{
- return msg_outtrans_len_attr(str, len, 0);
+ return msg_outtrans_len(str, (int)strlen(str), attr);
}
/// Output one character at "p".
@@ -1553,14 +1543,14 @@ const char *msg_outtrans_one(const char *p, int attr)
int l;
if ((l = utfc_ptr2len(p)) > 1) {
- msg_outtrans_len_attr(p, l, attr);
+ msg_outtrans_len(p, l, attr);
return p + l;
}
msg_puts_attr(transchar_byte_buf(NULL, (uint8_t)(*p)), attr);
return p + 1;
}
-int msg_outtrans_len_attr(const char *msgstr, int len, int attr)
+int msg_outtrans_len(const char *msgstr, int len, int attr)
{
int retval = 0;
const char *str = msgstr;
@@ -2052,10 +2042,10 @@ void msg_outtrans_long_len_attr(const char *longstr, int len, int attr)
room = Columns - msg_col;
if (len > room && room >= 20) {
slen = (room - 3) / 2;
- msg_outtrans_len_attr(longstr, slen, attr);
+ msg_outtrans_len(longstr, slen, attr);
msg_puts_attr("...", HL_ATTR(HLF_8));
}
- msg_outtrans_len_attr(longstr + len - slen, slen, attr);
+ msg_outtrans_len(longstr + len - slen, slen, attr);
}
/// Basic function for writing a message with highlight attributes.
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 96deae228f..bab1696cfe 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3838,7 +3838,7 @@ void ex_display(exarg_T *eap)
for (p = yb->y_array[j];
*p != NUL && (n -= ptr2cells(p)) >= 0; p++) { // -V1019
clen = utfc_ptr2len(p);
- msg_outtrans_len(p, clen);
+ msg_outtrans_len(p, clen, 0);
p += clen - 1;
}
}
@@ -3913,10 +3913,10 @@ static void dis_msg(const char *p, bool skip_esc)
&& (n -= ptr2cells(p)) >= 0) {
int l;
if ((l = utfc_ptr2len(p)) > 1) {
- msg_outtrans_len(p, l);
+ msg_outtrans_len(p, l, 0);
p += l;
} else {
- msg_outtrans_len(p++, 1);
+ msg_outtrans_len(p++, 1, 0);
}
}
os_breakcheck();
diff --git a/src/nvim/option.c b/src/nvim/option.c
index c34999ed32..804adfe537 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -4058,7 +4058,7 @@ static void showoneopt(vimoption_T *p, int opt_flags)
msg_putchar('=');
// put value string in NameBuff
option_value2string(p, opt_flags);
- msg_outtrans(NameBuff);
+ msg_outtrans(NameBuff, 0);
}
silent_mode = save_silent;
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 81e15bf841..48219f6231 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -876,9 +876,9 @@ static int do_os_system(char **argv, const char *input, size_t len, char **outpu
// Failed, probably 'shell' is not executable.
if (!silent) {
msg_puts(_("\nshell failed to start: "));
- msg_outtrans(os_strerror(status));
+ msg_outtrans(os_strerror(status), 0);
msg_puts(": ");
- msg_outtrans(prog);
+ msg_outtrans(prog, 0);
msg_putchar('\n');
}
multiqueue_free(events);
@@ -1127,7 +1127,7 @@ static void out_data_append_to_screen(char *output, size_t *count, bool eof)
goto end;
}
- (void)msg_outtrans_len_attr(p, i, 0);
+ (void)msg_outtrans_len(p, i, 0);
p += i;
}
}
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 70fcf3d276..39cb974e95 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -3132,7 +3132,7 @@ static void qf_list_entry(qfline_T *qfp, int qf_idx, bool cursel)
}
msg_putchar('\n');
- msg_outtrans_attr(IObuff, cursel ? HL_ATTR(HLF_QFL) : qfFileAttr);
+ msg_outtrans(IObuff, cursel ? HL_ATTR(HLF_QFL) : qfFileAttr);
if (qfp->qf_lnum != 0) {
msg_puts_attr(":", qfSepAttr);
@@ -4317,7 +4317,7 @@ static char *make_get_fullcmd(const char *makecmd, const char *fname)
}
msg_start();
msg_puts(":!");
- msg_outtrans(cmd); // show what we are doing
+ msg_outtrans(cmd, 0); // show what we are doing
return cmd;
}
@@ -5168,9 +5168,9 @@ static void vgr_display_fname(char *fname)
msg_start();
char *p = msg_strtrunc(fname, true);
if (p == NULL) {
- msg_outtrans(fname);
+ msg_outtrans(fname, 0);
} else {
- msg_outtrans(p);
+ msg_outtrans(p, 0);
xfree(p);
}
msg_clr_eos();
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c
index 269c3805a1..4cb5925176 100644
--- a/src/nvim/runtime.c
+++ b/src/nvim/runtime.c
@@ -2329,7 +2329,7 @@ void ex_scriptnames(exarg_T *eap)
vim_snprintf(IObuff, IOSIZE, "%3d: %s", i, NameBuff);
if (!message_filtered(IObuff)) {
msg_putchar('\n');
- msg_outtrans(IObuff);
+ msg_outtrans(IObuff, 0);
line_breakcheck();
}
}
diff --git a/src/nvim/search.c b/src/nvim/search.c
index cb6596d211..7e8737f6fb 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -1263,7 +1263,7 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char *pat, int count, in
memset(msgbuf + pat_len, ' ', (size_t)(r - msgbuf));
}
}
- msg_outtrans(msgbuf);
+ msg_outtrans(msgbuf, 0);
msg_clr_eos();
msg_check();
@@ -3709,7 +3709,7 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool
if (new_fname != NULL) {
// using "new_fname" is more reliable, e.g., when
// 'includeexpr' is set.
- msg_outtrans_attr(new_fname, HL_ATTR(HLF_D));
+ msg_outtrans(new_fname, HL_ATTR(HLF_D));
} else {
// Isolate the file name.
// Include the surrounding "" or <> if present.
@@ -3743,7 +3743,7 @@ void find_pattern_in_path(char *ptr, Direction dir, size_t len, bool whole, bool
}
save_char = p[i];
p[i] = NUL;
- msg_outtrans_attr(p, HL_ATTR(HLF_D));
+ msg_outtrans(p, HL_ATTR(HLF_D));
p[i] = save_char;
}
diff --git a/src/nvim/sign.c b/src/nvim/sign.c
index 1910e046e6..e30dffa294 100644
--- a/src/nvim/sign.c
+++ b/src/nvim/sign.c
@@ -1663,12 +1663,12 @@ static void sign_list_defined(sign_T *sp)
smsg("sign %s", sp->sn_name);
if (sp->sn_icon != NULL) {
msg_puts(" icon=");
- msg_outtrans(sp->sn_icon);
+ msg_outtrans(sp->sn_icon, 0);
msg_puts(_(" (not supported)"));
}
if (sp->sn_text != NULL) {
msg_puts(" text=");
- msg_outtrans(sp->sn_text);
+ msg_outtrans(sp->sn_text, 0);
}
if (sp->sn_line_hl > 0) {
msg_puts(" linehl=");
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 7e3ae4a62c..f4e0fa7fd0 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -2946,9 +2946,9 @@ static void syn_cmd_iskeyword(exarg_T *eap, int syncing)
msg_puts("\n");
if (curwin->w_s->b_syn_isk != empty_option) {
msg_puts("syntax iskeyword ");
- msg_outtrans(curwin->w_s->b_syn_isk);
+ msg_outtrans(curwin->w_s->b_syn_isk, 0);
} else {
- msg_outtrans(_("syntax iskeyword not set"));
+ msg_outtrans(_("syntax iskeyword not set"), 0);
}
} else {
if (STRNICMP(arg, "clear", 5) == 0) {
@@ -3427,7 +3427,7 @@ static void syn_list_one(const int id, const bool syncing, const bool link_only)
msg_putchar(' ');
if (spp->sp_sync_idx >= 0) {
msg_outtrans(highlight_group_name(SYN_ITEMS(curwin->w_s)
- [spp->sp_sync_idx].sp_syn.id - 1));
+ [spp->sp_sync_idx].sp_syn.id - 1), 0);
} else {
msg_puts("NONE");
}
@@ -3440,7 +3440,7 @@ static void syn_list_one(const int id, const bool syncing, const bool link_only)
(void)syn_list_header(did_header, 0, id, true);
msg_puts_attr("links to", attr);
msg_putchar(' ');
- msg_outtrans(highlight_group_name(highlight_link_id(id - 1) - 1));
+ msg_outtrans(highlight_group_name(highlight_link_id(id - 1) - 1), 0);
}
}
@@ -3461,7 +3461,7 @@ static void syn_list_cluster(int id)
// slight hack: roughly duplicate the guts of syn_list_header()
msg_putchar('\n');
- msg_outtrans(SYN_CLSTR(curwin->w_s)[id].scl_name);
+ msg_outtrans(SYN_CLSTR(curwin->w_s)[id].scl_name, 0);
if (msg_col >= endcol) { // output at least one space
endcol = msg_col + 1;
@@ -3498,9 +3498,9 @@ static void put_id_list(const char *const name, const int16_t *const list, const
int scl_id = *p - SYNID_CLUSTER;
msg_putchar('@');
- msg_outtrans(SYN_CLSTR(curwin->w_s)[scl_id].scl_name);
+ msg_outtrans(SYN_CLSTR(curwin->w_s)[scl_id].scl_name, 0);
} else {
- msg_outtrans(highlight_group_name(*p - 1));
+ msg_outtrans(highlight_group_name(*p - 1), 0);
}
if (p[1]) {
msg_putchar(',');
@@ -3520,9 +3520,9 @@ static void put_pattern(const char *const s, const int c, const synpat_T *const
msg_puts_attr("matchgroup", attr);
msg_putchar('=');
if (last_matchgroup == 0) {
- msg_outtrans("NONE");
+ msg_outtrans("NONE", 0);
} else {
- msg_outtrans(highlight_group_name(last_matchgroup - 1));
+ msg_outtrans(highlight_group_name(last_matchgroup - 1), 0);
}
msg_putchar(' ');
}
@@ -3539,7 +3539,7 @@ static void put_pattern(const char *const s, const int c, const synpat_T *const
}
}
msg_putchar(sepchars[i]);
- msg_outtrans(spp->sp_pattern);
+ msg_outtrans(spp->sp_pattern, 0);
msg_putchar(sepchars[i]);
// output any pattern options
@@ -3649,7 +3649,7 @@ static bool syn_list_keywords(const int id, const hashtab_T *const ht, bool did_
prev_skipempty = (kp->flags & HL_SKIPEMPTY);
}
}
- msg_outtrans(kp->keyword);
+ msg_outtrans(kp->keyword, 0);
}
}
}
@@ -5682,7 +5682,7 @@ static void syntime_report(void)
msg_puts(profile_msg(p->average));
msg_puts(" ");
msg_advance(50);
- msg_outtrans(highlight_group_name(p->id - 1));
+ msg_outtrans(highlight_group_name(p->id - 1), 0);
msg_puts(" ");
msg_advance(69);
@@ -5695,7 +5695,7 @@ static void syntime_report(void)
if (len > (int)strlen(p->pattern)) {
len = (int)strlen(p->pattern);
}
- msg_outtrans_len(p->pattern, len);
+ msg_outtrans_len(p->pattern, len, 0);
msg_puts("\n");
}
ga_clear(&ga);
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 8bbfb663bd..f74556d45b 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -847,13 +847,10 @@ static void print_tag_list(int new_tag, int use_tagstack, int num_matches, char
mt_names[matches[i][0] & MT_MASK]);
msg_puts(IObuff);
if (tagp.tagkind != NULL) {
- msg_outtrans_len(tagp.tagkind,
- (int)(tagp.tagkind_end - tagp.tagkind));
+ msg_outtrans_len(tagp.tagkind, (int)(tagp.tagkind_end - tagp.tagkind), 0);
}
msg_advance(13);
- msg_outtrans_len_attr(tagp.tagname,
- (int)(tagp.tagname_end - tagp.tagname),
- HL_ATTR(HLF_T));
+ msg_outtrans_len(tagp.tagname, (int)(tagp.tagname_end - tagp.tagname), HL_ATTR(HLF_T));
msg_putchar(' ');
taglen_advance(taglen);
@@ -861,7 +858,7 @@ static void print_tag_list(int new_tag, int use_tagstack, int num_matches, char
// it and put "..." in the middle
p = tag_full_fname(&tagp);
if (p != NULL) {
- msg_outtrans_attr(p, HL_ATTR(HLF_D));
+ msg_outtrans(p, HL_ATTR(HLF_D));
XFREE_CLEAR(p);
}
if (msg_col > 0) {
@@ -1149,9 +1146,8 @@ void do_tags(exarg_T *eap)
tagstack[i].cur_match + 1,
tagstack[i].tagname,
tagstack[i].fmark.mark.lnum);
- msg_outtrans(IObuff);
- msg_outtrans_attr(name, tagstack[i].fmark.fnum == curbuf->b_fnum
- ? HL_ATTR(HLF_D) : 0);
+ msg_outtrans(IObuff, 0);
+ msg_outtrans(name, tagstack[i].fmark.fnum == curbuf->b_fnum ? HL_ATTR(HLF_D) : 0);
xfree(name);
}
}
diff --git a/src/nvim/usercmd.c b/src/nvim/usercmd.c
index 7ccd13c3a7..f581151f63 100644
--- a/src/nvim/usercmd.c
+++ b/src/nvim/usercmd.c
@@ -495,7 +495,7 @@ static void uc_list(char *name, size_t name_len)
msg_putchar(' ');
}
- msg_outtrans_attr(cmd->uc_name, HL_ATTR(HLF_D));
+ msg_outtrans(cmd->uc_name, HL_ATTR(HLF_D));
len = strlen(cmd->uc_name) + 4;
do {
@@ -582,7 +582,7 @@ static void uc_list(char *name, size_t name_len)
} while ((int64_t)len < 25 - over);
IObuff[len] = '\0';
- msg_outtrans(IObuff);
+ msg_outtrans(IObuff, 0);
if (cmd->uc_luaref != LUA_NOREF) {
char *fn = nlua_funcref_str(cmd->uc_luaref);