Merge pull request #25396 from bfredl/no_attr

refactor(messages): fold msg() functions with and without attr
This commit is contained in:
bfredl 2023-09-27 23:49:47 +02:00 committed by GitHub
commit e46f5aab89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 382 additions and 413 deletions

View File

@ -1699,21 +1699,26 @@ static void write_msg(String message, bool to_err, bool writeln)
{ {
static StringBuilder out_line_buf = KV_INITIAL_VALUE; static StringBuilder out_line_buf = KV_INITIAL_VALUE;
static StringBuilder err_line_buf = KV_INITIAL_VALUE; static StringBuilder err_line_buf = KV_INITIAL_VALUE;
StringBuilder *line_buf = to_err ? &err_line_buf : &out_line_buf;
#define PUSH_CHAR(c, line_buf, msg) \ #define PUSH_CHAR(c) \
if (kv_max(line_buf) == 0) { \ if (kv_max(*line_buf) == 0) { \
kv_resize(line_buf, LINE_BUFFER_MIN_SIZE); \ kv_resize(*line_buf, LINE_BUFFER_MIN_SIZE); \
} \ } \
if (c == NL) { \ if (c == NL) { \
kv_push(line_buf, NUL); \ kv_push(*line_buf, NUL); \
msg(line_buf.items); \ if (to_err) { \
emsg(line_buf->items); \
} else { \
msg(line_buf->items, 0); \
} \
msg_didout = true; \ msg_didout = true; \
kv_drop(line_buf, kv_size(line_buf)); \ kv_drop(*line_buf, kv_size(*line_buf)); \
kv_resize(line_buf, LINE_BUFFER_MIN_SIZE); \ kv_resize(*line_buf, LINE_BUFFER_MIN_SIZE); \
} else if (c == NUL) { \ } else if (c == NUL) { \
kv_push(line_buf, NL); \ kv_push(*line_buf, NL); \
} else { \ } else { \
kv_push(line_buf, c); \ kv_push(*line_buf, c); \
} }
no_wait_return++; no_wait_return++;
@ -1721,18 +1726,10 @@ static void write_msg(String message, bool to_err, bool writeln)
if (got_int) { if (got_int) {
break; break;
} }
if (to_err) { PUSH_CHAR(message.data[i]);
PUSH_CHAR(message.data[i], err_line_buf, emsg);
} else {
PUSH_CHAR(message.data[i], out_line_buf, msg);
}
} }
if (writeln) { if (writeln) {
if (to_err) { PUSH_CHAR(NL);
PUSH_CHAR(NL, err_line_buf, emsg);
} else {
PUSH_CHAR(NL, out_line_buf, msg);
}
} }
no_wait_return--; no_wait_return--;
msg_end(); msg_end();

View File

@ -228,7 +228,7 @@ static void au_show_for_event(int group, event_T event, const char *pat)
} }
msg_col = 4; msg_col = 4;
msg_outtrans(ac->pat->pat); msg_outtrans(ac->pat->pat, 0);
} }
if (got_int) { if (got_int) {
@ -253,12 +253,12 @@ static void au_show_for_event(int group, event_T event, const char *pat)
} else { } else {
snprintf(msg, msglen, "%s [%s]", exec_to_string, ac->desc); snprintf(msg, msglen, "%s [%s]", exec_to_string, ac->desc);
} }
msg_outtrans(msg); msg_outtrans(msg, 0);
XFREE_CLEAR(msg); XFREE_CLEAR(msg);
} else if (ac->exec.type == CALLABLE_CB) { } else if (ac->exec.type == CALLABLE_CB) {
msg_puts_attr(exec_to_string, HL_ATTR(HLF_8)); msg_puts_attr(exec_to_string, HL_ATTR(HLF_8));
} else { } else {
msg_outtrans(exec_to_string); msg_outtrans(exec_to_string, 0);
} }
XFREE_CLEAR(exec_to_string); XFREE_CLEAR(exec_to_string);
if (p_verbose > 0) { if (p_verbose > 0) {

View File

@ -2858,7 +2858,7 @@ void buflist_list(exarg_T *eap)
buf == curbuf ? (int64_t)curwin->w_cursor.lnum : (int64_t)buflist_findlnum(buf)); buf == curbuf ? (int64_t)curwin->w_cursor.lnum : (int64_t)buflist_findlnum(buf));
} }
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
line_breakcheck(); line_breakcheck();
} }
@ -3230,10 +3230,10 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate)
msg_start(); msg_start();
n = msg_scroll; n = msg_scroll;
msg_scroll = true; msg_scroll = true;
msg(buffer); msg(buffer, 0);
msg_scroll = n; msg_scroll = n;
} else { } else {
p = msg_trunc_attr(buffer, false, 0); p = msg_trunc(buffer, false, 0);
if (restart_edit != 0 || (msg_scrolled && !need_wait_return)) { if (restart_edit != 0 || (msg_scrolled && !need_wait_return)) {
// Need to repeat the message after redrawing when: // Need to repeat the message after redrawing when:
// - When restart_edit is set (otherwise there will be a delay // - When restart_edit is set (otherwise there will be a delay

View File

@ -352,8 +352,7 @@ static int check_mtime(buf_T *buf, FileInfo *file_info)
msg_scroll = true; // Don't overwrite messages here. msg_scroll = true; // Don't overwrite messages here.
msg_silent = 0; // Must give this prompt. msg_silent = 0; // Must give this prompt.
// Don't use emsg() here, don't want to flush the buffers. // Don't use emsg() here, don't want to flush the buffers.
msg_attr(_("WARNING: The file has been changed since reading it!!!"), msg(_("WARNING: The file has been changed since reading it!!!"), HL_ATTR(HLF_E));
HL_ATTR(HLF_E));
if (ask_yesno(_("Do you really want to write to it"), true) == 'n') { if (ask_yesno(_("Do you really want to write to it"), true) == 'n') {
return FAIL; return FAIL;
} }
@ -1721,7 +1720,7 @@ restore_backup:
// This may take a while, if we were interrupted let the user // This may take a while, if we were interrupted let the user
// know we got the message. // know we got the message.
if (got_int) { if (got_int) {
msg(_(e_interr)); msg(_(e_interr), 0);
ui_flush(); ui_flush();
} }
@ -1786,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 // When written everything correctly: reset 'modified'. Unless not

View File

@ -971,7 +971,7 @@ static void showmatches_oneline(expand_T *xp, char **matches, int numMatches, in
int lastlen = 999; int lastlen = 999;
for (int j = linenr; j < numMatches; j += lines) { for (int j = linenr; j < numMatches; j += lines) {
if (xp->xp_context == EXPAND_TAGS_LISTFILES) { 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; p = matches[j] + strlen(matches[j]) + 1;
msg_advance(maxlen + 1); msg_advance(maxlen + 1);
msg_puts(p); msg_puts(p);
@ -1013,7 +1013,7 @@ static void showmatches_oneline(expand_T *xp, char **matches, int numMatches, in
isdir = false; isdir = false;
p = SHOW_MATCH(j); 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 if (msg_col > 0) { // when not wrapped around
msg_clr_eos(); msg_clr_eos();

View File

@ -610,7 +610,7 @@ void ex_history(exarg_T *eap)
char *arg = eap->arg; char *arg = eap->arg;
if (hislen == 0) { if (hislen == 0) {
msg(_("'history' option is zero")); msg(_("'history' option is zero"), 0);
return; return;
} }
@ -672,7 +672,7 @@ void ex_history(exarg_T *eap)
} else { } else {
xstrlcat(IObuff, hist[i].hisstr, IOSIZE); xstrlcat(IObuff, hist[i].hisstr, IOSIZE);
} }
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
} }
if (i == idx) { if (i == idx) {
break; break;

View File

@ -102,7 +102,7 @@ void do_debug(char *cmd)
debug_mode = true; debug_mode = true;
if (!debug_did_msg) { if (!debug_did_msg) {
msg(_("Entering Debug mode. Type \"cont\" to continue.")); msg(_("Entering Debug mode. Type \"cont\" to continue."), 0);
} }
if (debug_oldval != NULL) { if (debug_oldval != NULL) {
smsg(_("Oldval = \"%s\""), debug_oldval); smsg(_("Oldval = \"%s\""), debug_oldval);
@ -116,7 +116,7 @@ void do_debug(char *cmd)
} }
char *sname = estack_sfile(ESTACK_NONE); char *sname = estack_sfile(ESTACK_NONE);
if (sname != NULL) { if (sname != NULL) {
msg(sname); msg(sname, 0);
} }
xfree(sname); xfree(sname);
if (SOURCING_LNUM != 0) { if (SOURCING_LNUM != 0) {
@ -345,7 +345,7 @@ static void do_checkbacktracelevel(void)
{ {
if (debug_backtrace_level < 0) { if (debug_backtrace_level < 0) {
debug_backtrace_level = 0; debug_backtrace_level = 0;
msg(_("frame is zero")); msg(_("frame is zero"), 0);
} else { } else {
char *sname = estack_sfile(ESTACK_NONE); char *sname = estack_sfile(ESTACK_NONE);
int max = get_maxbacktrace_level(sname); int max = get_maxbacktrace_level(sname);
@ -719,7 +719,7 @@ void ex_breakdel(exarg_T *eap)
void ex_breaklist(exarg_T *eap) void ex_breaklist(exarg_T *eap)
{ {
if (GA_EMPTY(&dbg_breakp)) { if (GA_EMPTY(&dbg_breakp)) {
msg(_("No breakpoints defined")); msg(_("No breakpoints defined"), 0);
return; return;
} }

View File

@ -1706,7 +1706,7 @@ static void digraph_header(const char *msg)
if (msg_col > 0) { if (msg_col > 0) {
msg_putchar('\n'); msg_putchar('\n');
} }
msg_outtrans_attr(msg, HL_ATTR(HLF_CM)); msg_outtrans(msg, HL_ATTR(HLF_CM));
msg_putchar('\n'); msg_putchar('\n');
} }
@ -1860,7 +1860,7 @@ static void printdigraph(const digr_T *dp, result_T *previous)
*p++ = (char)dp->char2; *p++ = (char)dp->char2;
*p++ = ' '; *p++ = ' ';
*p = NUL; *p = NUL;
msg_outtrans(buf); msg_outtrans(buf, 0);
p = buf; p = buf;
// add a space to draw a composing char on // 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 += utf_char2bytes(dp->result, p);
*p = NUL; *p = NUL;
msg_outtrans_attr(buf, HL_ATTR(HLF_8)); msg_outtrans(buf, HL_ATTR(HLF_8));
p = buf; p = buf;
if (char2cells(dp->result) == 1) { if (char2cells(dp->result) == 1) {
*p++ = ' '; *p++ = ' ';
} }
assert(p >= buf); assert(p >= buf);
vim_snprintf(p, sizeof(buf) - (size_t)(p - buf), " %3d", dp->result); 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. /// Get the two digraph characters from a typval.

View File

@ -3492,7 +3492,7 @@ static bool ins_esc(long *count, int cmdchar, bool nomove)
showmode(); showmode();
} else if (p_smd && (got_int || !skip_showmode()) } else if (p_smd && (got_int || !skip_showmode())
&& !(p_ch == 0 && !ui_has(kUIMessages))) { && !(p_ch == 0 && !ui_has(kUIMessages))) {
msg(""); msg("", 0);
} }
// Exit Insert mode // Exit Insert mode
return true; return true;

View File

@ -8018,7 +8018,7 @@ void ex_echo(exarg_T *eap)
char *tofree = encode_tv2echo(&rettv, NULL); char *tofree = encode_tv2echo(&rettv, NULL);
if (*tofree != NUL) { if (*tofree != NUL) {
msg_ext_set_kind("echo"); msg_ext_set_kind("echo");
msg_multiline_attr(tofree, echo_attr, true, &need_clear); msg_multiline(tofree, echo_attr, true, &need_clear);
} }
xfree(tofree); xfree(tofree);
} }
@ -8102,7 +8102,7 @@ void ex_execute(exarg_T *eap)
if (eap->cmdidx == CMD_echomsg) { if (eap->cmdidx == CMD_echomsg) {
msg_ext_set_kind("echomsg"); msg_ext_set_kind("echomsg");
msg_attr(ga.ga_data, echo_attr); msg(ga.ga_data, echo_attr);
} else if (eap->cmdidx == CMD_echoerr) { } else if (eap->cmdidx == CMD_echoerr) {
// We don't want to abort following commands, restore did_emsg. // We don't want to abort following commands, restore did_emsg.
int save_did_emsg = did_emsg; int save_did_emsg = did_emsg;

View File

@ -1352,7 +1352,7 @@ static void list_one_var(dictitem_T *v, const char *prefix, int *first)
static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t name_len, static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t name_len,
const VarType type, const char *string, int *first) const VarType type, const char *string, int *first)
{ {
// don't use msg() or msg_attr() to avoid overwriting "v:statusmsg" // don't use msg() to avoid overwriting "v:statusmsg"
msg_start(); msg_start();
msg_puts(prefix); msg_puts(prefix);
if (name != NULL) { // "a:" vars don't have a name stored if (name != NULL) { // "a:" vars don't have a name stored
@ -1378,7 +1378,7 @@ static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t
msg_putchar(' '); msg_putchar(' ');
} }
msg_outtrans(string); msg_outtrans(string, 0);
if (type == VAR_FUNC || type == VAR_PARTIAL) { if (type == VAR_FUNC || type == VAR_PARTIAL) {
msg_puts("()"); msg_puts("()");

View File

@ -135,7 +135,7 @@ void do_ascii(const exarg_T *const eap)
int cc[MAX_MCO]; int cc[MAX_MCO];
int c = utfc_ptr2char(get_cursor_pos_ptr(), cc); int c = utfc_ptr2char(get_cursor_pos_ptr(), cc);
if (c == NUL) { if (c == NUL) {
msg("NUL"); msg("NUL", 0);
return; return;
} }
@ -233,7 +233,7 @@ void do_ascii(const exarg_T *const eap)
xstrlcpy(IObuff + iobuff_len, " ...", sizeof(IObuff) - iobuff_len); xstrlcpy(IObuff + iobuff_len, " ...", sizeof(IObuff) - iobuff_len);
} }
msg(IObuff); msg(IObuff, 0);
} }
/// ":left", ":center" and ":right": align text. /// ":left", ":center" and ":right": align text.
@ -1062,7 +1062,7 @@ void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out
msg_start(); msg_start();
msg_putchar(':'); msg_putchar(':');
msg_putchar('!'); msg_putchar('!');
msg_outtrans(newcmd); msg_outtrans(newcmd, 0);
msg_clr_eos(); msg_clr_eos();
ui_cursor_goto(msg_row, msg_col); ui_cursor_goto(msg_row, msg_col);
@ -1274,7 +1274,7 @@ static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char *cmd, b
if (do_in) { if (do_in) {
vim_snprintf(msg_buf, sizeof(msg_buf), vim_snprintf(msg_buf, sizeof(msg_buf),
_("%" PRId64 " lines filtered"), (int64_t)linecount); _("%" PRId64 " lines filtered"), (int64_t)linecount);
if (msg(msg_buf) && !msg_scroll) { if (msg(msg_buf, 0) && !msg_scroll) {
// save message to display it after redraw // save message to display it after redraw
set_keep_msg(msg_buf, 0); set_keep_msg(msg_buf, 0);
} }
@ -4250,7 +4250,7 @@ skip:
} }
} }
if (cmdpreview_ns <= 0 && !do_sub_msg(subflags.do_count) && subflags.do_ask && p_ch > 0) { if (cmdpreview_ns <= 0 && !do_sub_msg(subflags.do_count) && subflags.do_ask && p_ch > 0) {
msg(""); msg("", 0);
} }
} else { } else {
global_need_beginline = true; global_need_beginline = true;
@ -4265,7 +4265,7 @@ skip:
} else if (got_match) { } else if (got_match) {
// did find something but nothing substituted // did find something but nothing substituted
if (p_ch > 0) { if (p_ch > 0) {
msg(""); msg("", 0);
} }
} else if (subflags.do_error) { } else if (subflags.do_error) {
// nothing found // nothing found
@ -4339,7 +4339,7 @@ bool do_sub_msg(bool count_only)
vim_snprintf_add(msg_buf, sizeof(msg_buf), vim_snprintf_add(msg_buf, sizeof(msg_buf),
NGETTEXT(msg_single, msg_plural, sub_nlines), NGETTEXT(msg_single, msg_plural, sub_nlines),
(int64_t)sub_nsubs, (int64_t)sub_nlines); (int64_t)sub_nsubs, (int64_t)sub_nlines);
if (msg(msg_buf)) { if (msg(msg_buf, 0)) {
// save message to display it after redraw // save message to display it after redraw
set_keep_msg(msg_buf, 0); set_keep_msg(msg_buf, 0);
} }
@ -4468,7 +4468,7 @@ void ex_global(exarg_T *eap)
// pass 2: execute the command for each line that has been marked // pass 2: execute the command for each line that has been marked
if (got_int) { if (got_int) {
msg(_(e_interr)); msg(_(e_interr), 0);
} else if (ndone == 0) { } else if (ndone == 0) {
if (type == 'v') { if (type == 'v') {
smsg(_("Pattern found in every line: %s"), used_pat); smsg(_("Pattern found in every line: %s"), used_pat);
@ -4775,7 +4775,7 @@ void ex_oldfiles(exarg_T *eap)
long nr = 0; long nr = 0;
if (l == NULL) { if (l == NULL) {
msg(_("No old files")); msg(_("No old files"), 0);
return; return;
} }
@ -4790,7 +4790,7 @@ void ex_oldfiles(exarg_T *eap)
if (!message_filtered(fname)) { if (!message_filtered(fname)) {
msg_outnum(nr); msg_outnum(nr);
msg_puts(": "); 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_clr_eos();
msg_putchar('\n'); msg_putchar('\n');
os_breakcheck(); os_breakcheck();

View File

@ -443,7 +443,7 @@ int buf_write_all(buf_T *buf, int forceit)
false, forceit, true, false)); false, forceit, true, false));
if (curbuf != old_curbuf) { if (curbuf != old_curbuf) {
msg_source(HL_ATTR(HLF_W)); msg_source(HL_ATTR(HLF_W));
msg(_("Warning: Entered other buffer unexpectedly (check autocommands)")); msg(_("Warning: Entered other buffer unexpectedly (check autocommands)"), 0);
} }
return retval; return retval;
} }

View File

@ -209,7 +209,7 @@ void do_exmode(void)
RedrawingDisabled++; // don't redisplay the window RedrawingDisabled++; // don't redisplay the window
no_wait_return++; // don't wait for return no_wait_return++; // don't wait for return
msg(_("Entering Ex mode. Type \"visual\" to go to Normal mode.")); msg(_("Entering Ex mode. Type \"visual\" to go to Normal mode."), 0);
while (exmode_active) { while (exmode_active) {
// Check for a ":normal" command and no more characters left. // Check for a ":normal" command and no more characters left.
if (ex_normal_busy > 0 && typebuf.tb_len == 0) { if (ex_normal_busy > 0 && typebuf.tb_len == 0) {
@ -4467,10 +4467,10 @@ static void ex_colorscheme(exarg_T *eap)
xfree(expr); xfree(expr);
if (p != NULL) { if (p != NULL) {
msg(p); msg(p, 0);
xfree(p); xfree(p);
} else { } else {
msg("default"); msg("default", 0);
} }
} else if (load_colors(eap->arg) == FAIL) { } else if (load_colors(eap->arg) == FAIL) {
semsg(_("E185: Cannot find color scheme '%s'"), eap->arg); semsg(_("E185: Cannot find color scheme '%s'"), eap->arg);
@ -4480,7 +4480,7 @@ static void ex_colorscheme(exarg_T *eap)
static void ex_highlight(exarg_T *eap) static void ex_highlight(exarg_T *eap)
{ {
if (*eap->arg == NUL && eap->cmd[2] == '!') { if (*eap->arg == NUL && eap->cmd[2] == '!') {
msg(_("Greetings, Vim user!")); msg(_("Greetings, Vim user!"), 0);
} }
do_highlight(eap->arg, eap->forceit, false); do_highlight(eap->arg, eap->forceit, false);
} }
@ -4751,7 +4751,7 @@ static void ex_tabonly(exarg_T *eap)
} }
if (first_tabpage->tp_next == NULL) { if (first_tabpage->tp_next == NULL) {
msg(_("Already only one tab page")); msg(_("Already only one tab page"), 0);
return; return;
} }
@ -5137,7 +5137,7 @@ static void ex_tabs(exarg_T *eap)
msg_putchar('\n'); msg_putchar('\n');
vim_snprintf(IObuff, IOSIZE, _("Tab page %d"), tabcount++); 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(); os_breakcheck();
FOR_ALL_WINDOWS_IN_TAB(wp, tp) { FOR_ALL_WINDOWS_IN_TAB(wp, tp) {
@ -5155,7 +5155,7 @@ static void ex_tabs(exarg_T *eap)
} else { } else {
home_replace(wp->w_buffer, wp->w_buffer->b_fname, IObuff, IOSIZE, true); home_replace(wp->w_buffer, wp->w_buffer->b_fname, IObuff, IOSIZE, true);
} }
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
os_breakcheck(); os_breakcheck();
} }
} }
@ -5378,9 +5378,9 @@ static void ex_popup(exarg_T *eap)
static void ex_swapname(exarg_T *eap) static void ex_swapname(exarg_T *eap)
{ {
if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL) { if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL) {
msg(_("No swap file")); msg(_("No swap file"), 0);
} else { } else {
msg(curbuf->b_ml.ml_mfp->mf_fname); msg(curbuf->b_ml.ml_mfp->mf_fname, 0);
} }
} }
@ -5694,7 +5694,7 @@ static void ex_pwd(exarg_T *eap)
} }
smsg("[%s] %s", context, NameBuff); smsg("[%s] %s", context, NameBuff);
} else { } else {
msg(NameBuff); msg(NameBuff, 0);
} }
} else { } else {
emsg(_("E187: Unknown")); emsg(_("E187: Unknown"));
@ -7360,289 +7360,290 @@ void verify_command(char *cmd)
if (strcmp("smile", cmd) != 0) { if (strcmp("smile", cmd) != 0) {
return; // acceptable non-existing command return; // acceptable non-existing command
} }
int a = HL_ATTR(HLF_E);
msg(" #xxn` #xnxx` ,+x@##@Mz;` .xxx" msg(" #xxn` #xnxx` ,+x@##@Mz;` .xxx"
"xxxxxxnz+, znnnnnnnnnnnnnnnn."); "xxxxxxnz+, znnnnnnnnnnnnnnnn.", a);
msg(" n###z x####` :x##########W+` ,###" msg(" n###z x####` :x##########W+` ,###"
"##########M; W################."); "##########M; W################.", a);
msg(" n####; x####` `z##############W: ,###" msg(" n####; x####` `z##############W: ,###"
"############# W################."); "############# W################.", a);
msg(" n####W. x####` ,W#################+ ,###" msg(" n####W. x####` ,W#################+ ,###"
"############## W################."); "############## W################.", a);
msg(" n#####n x####` @################### ,###" msg(" n#####n x####` @################### ,###"
"##############i W################."); "##############i W################.", a);
msg(" n######i x####` .#########@W@########* ,###" msg(" n######i x####` .#########@W@########* ,###"
"##############W`W################."); "##############W`W################.", a);
msg(" n######@. x####` x######W*. `;n#######: ,###" msg(" n######@. x####` x######W*. `;n#######: ,###"
"#x,,,,:*M######iW###@:,,,,,,,,,,,`"); "#x,,,,:*M######iW###@:,,,,,,,,,,,`", a);
msg(" n#######n x####` *######+` :M#####M ,###" msg(" n#######n x####` *######+` :M#####M ,###"
"#n `x#####xW###@`"); "#n `x#####xW###@`", a);
msg(" n########* x####``@####@; `x#####i ,###" msg(" n########* x####``@####@; `x#####i ,###"
"#n ,#####@W###@`"); "#n ,#####@W###@`", a);
msg(" n########@ x####`*#####i `M####M ,###" msg(" n########@ x####`*#####i `M####M ,###"
"#n x#########@`"); "#n x#########@`", a);
msg(" n######### x####`M####z :#####:,###" msg(" n######### x####`M####z :#####:,###"
"#n z#########@`"); "#n z#########@`", a);
msg(" n#########* x####,#####. n####+,###" msg(" n#########* x####,#####. n####+,###"
"#n n#########@`"); "#n n#########@`", a);
msg(" n####@####@, x####i####x ;####x,###" msg(" n####@####@, x####i####x ;####x,###"
"#n `W#####@####+++++++++++i"); "#n `W#####@####+++++++++++i", a);
msg(" n####*#####M` x#########* `####@,###" msg(" n####*#####M` x#########* `####@,###"
"#n i#####MW###############W"); "#n i#####MW###############W", a);
msg(" n####.######+ x####z####; W####,###" msg(" n####.######+ x####z####; W####,###"
"#n i@######W###############W"); "#n i@######W###############W", a);
msg(" n####.`W#####: x####n####: M####:###" msg(" n####.`W#####: x####n####: M####:###"
"#@nnnnnW#######,W###############W"); "#@nnnnnW#######,W###############W", a);
msg(" n####. :#####M`x####z####; W####,###" msg(" n####. :#####M`x####z####; W####,###"
"##############z W###############W"); "##############z W###############W", a);
msg(" n####. #######x#########* `####W,###" msg(" n####. #######x#########* `####W,###"
"#############W` W###############W"); "#############W` W###############W", a);
msg(" n####. `M#####W####i####x ;####x,###" msg(" n####. `M#####W####i####x ;####x,###"
"############W, W####+**********i"); "############W, W####+**********i", a);
msg(" n####. ,##########,#####. n####+,###" msg(" n####. ,##########,#####. n####+,###"
"###########n. W###@`"); "###########n. W###@`", a);
msg(" n####. ##########`M####z :#####:,###" msg(" n####. ##########`M####z :#####:,###"
"########Wz: W###@`"); "########Wz: W###@`", a);
msg(" n####. x#########`*#####i `M####M ,###" msg(" n####. x#########`*#####i `M####M ,###"
"#x.....` W###@`"); "#x.....` W###@`", a);
msg(" n####. ,@########``@####@; `x#####i ,###" msg(" n####. ,@########``@####@; `x#####i ,###"
"#n W###@`"); "#n W###@`", a);
msg(" n####. *########` *#####@+` ,M#####M ,###" msg(" n####. *########` *#####@+` ,M#####M ,###"
"#n W###@`"); "#n W###@`", a);
msg(" n####. x#######` x######W*. `;n######@: ,###" msg(" n####. x#######` x######W*. `;n######@: ,###"
"#n W###@,,,,,,,,,,,,`"); "#n W###@,,,,,,,,,,,,`", a);
msg(" n####. .@######` .#########@W@########* ,###" msg(" n####. .@######` .#########@W@########* ,###"
"#n W################,"); "#n W################,", a);
msg(" n####. i######` @################### ,###" msg(" n####. i######` @################### ,###"
"#n W################,"); "#n W################,", a);
msg(" n####. n#####` ,W#################+ ,###" msg(" n####. n#####` ,W#################+ ,###"
"#n W################,"); "#n W################,", a);
msg(" n####. .@####` .n##############W; ,###" msg(" n####. .@####` .n##############W; ,###"
"#n W################,"); "#n W################,", a);
msg(" n####. i####` :x##########W+` ,###" msg(" n####. i####` :x##########W+` ,###"
"#n W################,"); "#n W################,", a);
msg(" +nnnn` +nnn` ,+x@##@Mz;` .nnn" msg(" +nnnn` +nnn` ,+x@##@Mz;` .nnn"
"n+ zxxxxxxxxxxxxxxxx."); "n+ zxxxxxxxxxxxxxxxx.", a);
msg(" "); msg(" ", a);
msg(" " msg(" "
" ,+M@#Mi"); " ,+M@#Mi", a);
msg(" " msg(" "
" .z########"); " .z########", a);
msg(" " msg(" "
" i@#########i"); " i@#########i", a);
msg(" " msg(" "
" `############W`"); " `############W`", a);
msg(" " msg(" "
" `n#############i"); " `n#############i", a);
msg(" " msg(" "
" `n##############n"); " `n##############n", a);
msg(" `` " msg(" `` "
" z###############@`"); " z###############@`", a);
msg(" `W@z, " msg(" `W@z, "
" ##################,"); " ##################,", a);
msg(" *#####` " msg(" *#####` "
" i############@x@###i"); " i############@x@###i", a);
msg(" ######M. " msg(" ######M. "
" :#############n`,W##+"); " :#############n`,W##+", a);
msg(" +######@: " msg(" +######@: "
" .W#########M@##+ *##z"); " .W#########M@##+ *##z", a);
msg(" :#######@: " msg(" :#######@: "
" `x########@#x###* ,##n"); " `x########@#x###* ,##n", a);
msg(" `@#######@; " msg(" `@#######@; "
" z#########M*@nW#i .##x"); " z#########M*@nW#i .##x", a);
msg(" z########@i " msg(" z########@i "
" *###########WM#@#, `##x"); " *###########WM#@#, `##x", a);
msg(" i##########+ " msg(" i##########+ "
" ;###########*n###@ `##x"); " ;###########*n###@ `##x", a);
msg(" `@#MM#######x, " msg(" `@#MM#######x, "
" ,@#########zM,`z##M `@#x"); " ,@#########zM,`z##M `@#x", a);
msg(" n##M#W#######n. " msg(" n##M#W#######n. "
" `.:i*+#zzzz##+i:.` ,W#########Wii,`n@#@` n@##n"); " `.:i*+#zzzz##+i:.` ,W#########Wii,`n@#@` n@##n", a);
msg(" ;###@#x#######n `,i" msg(" ;###@#x#######n `,i"
"#nW@#####@@WWW@@####@Mzi. ,W##########@z.. ;zM#+i####z"); "#nW@#####@@WWW@@####@Mzi. ,W##########@z.. ;zM#+i####z", a);
msg(" x####nz######## .;#x@##" msg(" x####nz######## .;#x@##"
"@Wn#*;,.` ``,:*#x@##M+, ;@########xz@WM+#` `n@#######"); "@Wn#*;,.` ``,:*#x@##M+, ;@########xz@WM+#` `n@#######", a);
msg(" ,@####M########xi#@##@Mzi," msg(" ,@####M########xi#@##@Mzi,"
"` .+x###Mi:n##########Mz```.:i *@######*"); "` .+x###Mi:n##########Mz```.:i *@######*", a);
msg(" *#####W#########ix+:` " msg(" *#####W#########ix+:` "
" :n#############z: `*.`M######i"); " :n#############z: `*.`M######i", a);
msg(" i#W##nW@+@##@#M@; " msg(" i#W##nW@+@##@#M@; "
" ;W@@##########W, i`x@#####,"); " ;W@@##########W, i`x@#####,", a);
msg(" `@@n@Wn#@iMW*#*: " msg(" `@@n@Wn#@iMW*#*: "
" `iz#z@######x. M######`"); " `iz#z@######x. M######`", a);
msg(" z##zM###x`*, .` " msg(" z##zM###x`*, .` "
" `iW#####W;:` +#####M"); " `iW#####W;:` +#####M", a);
msg(" ,###nn##n` " msg(" ,###nn##n` "
" ,#####x;` ,;@######"); " ,#####x;` ,;@######", a);
msg(" x###xz#. " msg(" x###xz#. "
" in###+ `:######@."); " in###+ `:######@.", a);
msg(" ;####n+ " msg(" ;####n+ "
" `Mnx##xi` , zM#######"); " `Mnx##xi` , zM#######", a);
msg(" `W####+ " msg(" `W####+ "
"i. `.+x###@#. :n,z######:"); "i. `.+x###@#. :n,z######:", a);
msg(" z####@` ;" msg(" z####@` ;"
"#: .ii@###@;.*M*z####@`"); "#: .ii@###@;.*M*z####@`", a);
msg(" i####M ` `i@" msg(" i####M ` `i@"
"#, :: +#n##@+@##W####n"); "#, :: +#n##@+@##W####n", a);
msg(" :####x ,i. ##xzM###" msg(" :####x ,i. ##xzM###"
"@` i. .@@, .z####x#######*"); "@` i. .@@, .z####x#######*", a);
msg(" ,###W; i##Wz########" msg(" ,###W; i##Wz########"
"# :## z##n ,@########x###:"); "# :## z##n ,@########x###:", a);
msg(" n##n `W###########M" msg(" n##n `W###########M"
"`;n, i#x ,###@i *W########W#@`"); "`;n, i#x ,###@i *W########W#@`", a);
msg(" .@##+ `x###########@." msg(" .@##+ `x###########@."
" z#+ .M#W``x#####n` `;#######@z#x"); " z#+ .M#W``x#####n` `;#######@z#x", a);
msg(" n###z :W############@ " msg(" n###z :W############@ "
" z#* @##xM#######@n; `########nW+"); " z#* @##xM#######@n; `########nW+", a);
msg(" ;####nW##############W " msg(" ;####nW##############W "
":@#* `@#############* :########z@i`"); ":@#* `@#############* :########z@i`", a);
msg(" M##################### " msg(" M##################### "
"M##: @#############@: *W########M#"); "M##: @#############@: *W########M#", a);
msg(" ;#####################i." msg(" ;#####################i."
"##x` W#############W, :n########zx"); "##x` W#############W, :n########zx", a);
msg(" x####################@.`" msg(" x####################@.`"
"x; @#############z. .@########W#"); "x; @#############z. .@########W#", a);
msg(" ,######################` " msg(" ,######################` "
" W###############x*,` W######zM#i"); " W###############x*,` W######zM#i", a);
msg(" #######################: " msg(" #######################: "
" z##################@x+*#zzi `@#########."); " z##################@x+*#zzi `@#########.", a);
msg(" W########W#z#M#########; " msg(" W########W#z#M#########; "
" *##########################z :@#######@`"); " *##########################z :@#######@`", a);
msg(" `@#######x`;#z ,x#######; " msg(" `@#######x`;#z ,x#######; "
" z###########M###xnM@########* :M######@"); " z###########M###xnM@########* :M######@", a);
msg(" i########, x#@` z######; " msg(" i########, x#@` z######; "
" *##########i *#@` `+########+` n######."); " *##########i *#@` `+########+` n######.", a);
msg(" n#######@` M##, `W#####. " msg(" n#######@` M##, `W#####. "
" *#########z ###; z########M: :W####n"); " *#########z ###; z########M: :W####n", a);
msg(" M#######M n##. x####x " msg(" M#######M n##. x####x "
" `x########: z##+ M#########@; .n###+"); " `x########: z##+ M#########@; .n###+", a);
msg(" W#######@` :#W `@####: " msg(" W#######@` :#W `@####: "
" `@######W i### ;###########@. n##n"); " `@######W i### ;###########@. n##n", a);
msg(" W########z` ,, .x####z " msg(" W########z` ,, .x####z "
" @######@` `W#; `W############* *###;"); " @######@` `W#; `W############* *###;", a);
msg(" `@#########Mi,:*n@####W` " msg(" `@#########Mi,:*n@####W` "
" W#######* .. `n#############i i###x"); " W#######* .. `n#############i i###x", a);
msg(" .#####################z " msg(" .#####################z "
" `@#######@*` .x############n:` ;####."); " `@#######@*` .x############n:` ;####.", a);
msg(" :####################x`,,` " msg(" :####################x`,,` "
" `W#########@x#+#@#############i ,####:"); " `W#########@x#+#@#############i ,####:", a);
msg(" ;###################x#@###x" msg(" ;###################x#@###x"
"i` *############################: `####i"); "i` *############################: `####i", a);
msg(" i##################+#######" msg(" i##################+#######"
"#M, x##########################@` W###i"); "#M, x##########################@` W###i", a);
msg(" *################@; @######" msg(" *################@; @######"
"##@, .W#########################@ x###:"); "##@, .W#########################@ x###:", a);
msg(" .+M#############z. M######" msg(" .+M#############z. M######"
"###x ,W########################@` ####."); "###x ,W########################@` ####.", a);
msg(" *M*;z@########x: :W#####" msg(" *M*;z@########x: :W#####"
"##i .M########################i i###:"); "##i .M########################i i###:", a);
msg(" *##@z;#@####x: :z###" msg(" *##@z;#@####x: :z###"
"@i `########################x .###;"); "@i `########################x .###;", a);
msg(" *#####n;#@## ;##" msg(" *#####n;#@## ;##"
"* ,x#####################@` W##*"); "* ,x#####################@` W##*", a);
msg(" *#######n;* :M##" msg(" *#######n;* :M##"
"W*, *W####################` n##z"); "W*, *W####################` n##z", a);
msg(" i########@. ,*n####" msg(" i########@. ,*n####"
"###M*` `###################M *##M"); "###M*` `###################M *##M", a);
msg(" i########n `z#####@@" msg(" i########n `z#####@@"
"#####Wi ,M################; ,##@`"); "#####Wi ,M################; ,##@`", a);
msg(" ;WMWW@###* .x##@ni.``" msg(" ;WMWW@###* .x##@ni.``"
".:+zW##z` `n##############z @##,"); ".:+zW##z` `n##############z @##,", a);
msg(" .*++*i;;;. .M#@+` " msg(" .*++*i;;;. .M#@+` "
" .##n `x############x` n##i"); " .##n `x############x` n##i", a);
msg(" :########* x#W, " msg(" :########* x#W, "
" *#+ *###########M` +##+"); " *#+ *###########M` +##+", a);
msg(" ,######### :#@: " msg(" ,######### :#@: "
" ##: #nzzzzzzzzzz. :##x"); " ##: #nzzzzzzzzzz. :##x", a);
msg(" .#####Wz+` ##+ " msg(" .#####Wz+` ##+ "
" `MM` .znnnnnnnnn. `@#@`"); " `MM` .znnnnnnnnn. `@#@`", a);
msg(" `@@ni;*nMz` @W` " msg(" `@@ni;*nMz` @W` "
" :#+ .x#######n x##,"); " :#+ .x#######n x##,", a);
msg(" i;z@#####, .#* " msg(" i;z@#####, .#* "
" z#: ;;;*zW##; ###i"); " z#: ;;;*zW##; ###i", a);
msg(" z########: :#; " msg(" z########: :#; "
" `Wx +###Wni;n. ;##z"); " `Wx +###Wni;n. ;##z", a);
msg(" n########W: .#* " msg(" n########W: .#* "
" ,#, ;#######@+ `@#M"); " ,#, ;#######@+ `@#M", a);
msg(" .###########n;.MM " msg(" .###########n;.MM "
" n* ;iM#######* x#@`"); " n* ;iM#######* x#@`", a);
msg(" :#############@;; " msg(" :#############@;; "
" .n` ,#W*iW#####W` +##,"); " .n` ,#W*iW#####W` +##,", a);
msg(" ,##############. " msg(" ,##############. "
" ix. `x###M;####### ,##i"); " ix. `x###M;####### ,##i", a);
msg(" .#############@` " msg(" .#############@` "
" x@n**#W######z;M###@. W##"); " x@n**#W######z;M###@. W##", a);
msg(" .##############W: " msg(" .##############W: "
" .x############@*;zW#; z#x"); " .x############@*;zW#; z#x", a);
msg(" ,###############@; " msg(" ,###############@; "
" `##############@n*;. i#@"); " `##############@n*;. i#@", a);
msg(" ,#################i " msg(" ,#################i "
" :n##############W` .##,"); " :n##############W` .##,", a);
msg(" ,###################` " msg(" ,###################` "
" .+W##########W, `##i"); " .+W##########W, `##i", a);
msg(" :###################@zi,` " msg(" :###################@zi,` "
" ;zM@@@WMn*` @#z"); " ;zM@@@WMn*` @#z", a);
msg(" :#######################@x+" msg(" :#######################@x+"
"*i;;:i#M, `` M#W"); "*i;;:i#M, `` M#W", a);
msg(" ;##########################" msg(" ;##########################"
"######@x. n##,"); "######@x. n##,", a);
msg(" i#####################@W@@@" msg(" i#####################@W@@@"
"@Wxz*:` *##+"); "@Wxz*:` *##+", a);
msg(" *######################+```" msg(" *######################+```"
" :##M"); " :##M", a);
msg(" ########################M; " msg(" ########################M; "
" `@##,"); " `@##,", a);
msg(" z#########################x" msg(" z#########################x"
", z###"); ", z###", a);
msg(" n##########################" msg(" n##########################"
"#n: ;##W`"); "#n: ;##W`", a);
msg(" x##########################" msg(" x##########################"
"###Mz#++##* `W##i"); "###Mz#++##* `W##i", a);
msg(" M##########################" msg(" M##########################"
"##########@` ###x"); "##########@` ###x", a);
msg(" W##########################" msg(" W##########################"
"###########` .###,"); "###########` .###,", a);
msg(" @##########################" msg(" @##########################"
"##########M n##z"); "##########M n##z", a);
msg(" @##################z*i@WMMM" msg(" @##################z*i@WMMM"
"x#x@#####,. :##@."); "x#x@#####,. :##@.", a);
msg(" `#####################@xi` " msg(" `#####################@xi` "
" `::,* x##+"); " `::,* x##+", a);
msg(" .#####################@#M. " msg(" .#####################@#M. "
" ;##@`"); " ;##@`", a);
msg(" ,#####################:. " msg(" ,#####################:. "
" M##i"); " M##i", a);
msg(" ;###################ni` " msg(" ;###################ni` "
" i##M"); " i##M", a);
msg(" *#################W#` " msg(" *#################W#` "
" `W##,"); " `W##,", a);
msg(" z#################@Wx+. " msg(" z#################@Wx+. "
" +###"); " +###", a);
msg(" x######################z. " msg(" x######################z. "
" .@#@`"); " .@#@`", a);
msg(" `@#######################@; " msg(" `@#######################@; "
" z##;"); " z##;", a);
msg(" :##########################: " msg(" :##########################: "
" :##z"); " :##z", a);
msg(" +#########################W# " msg(" +#########################W# "
" M#W"); " M#W", a);
msg(" W################@n+*i;:,` " msg(" W################@n+*i;:,` "
" +##,"); " +##,", a);
msg(" :##################WMxz+, " msg(" :##################WMxz+, "
" ,##i"); " ,##i", a);
msg(" n#######################W.., " msg(" n#######################W.., "
" W##"); " W##", a);
msg(" +#########################WW@+. .:. " msg(" +#########################WW@+. .:. "
" z#x"); " z#x", a);
msg(" `@#############################@@###: " msg(" `@#############################@@###: "
" *#W"); " *#W", a);
msg(" #################################Wz: " msg(" #################################Wz: "
" :#@"); " :#@", a);
msg(",@###############################i " msg(",@###############################i "
" .##"); " .##", a);
msg("n@@@@@@@#########################+ " msg("n@@@@@@@#########################+ "
" `##"); " `##", a);
msg("` `.:.`.,:iii;;;;;;;;iii;;;:` `.`` " msg("` `.:.`.,:iii;;;;;;;;iii;;;:` `.`` "
" `nW"); " `nW", a);
} }
/// Get argt of command with id /// Get argt of command with id

View File

@ -2664,7 +2664,7 @@ static void abandon_cmdline(void)
if (msg_scrolled == 0) { if (msg_scrolled == 0) {
compute_cmdrow(); compute_cmdrow();
} }
msg(""); msg("", 0);
redraw_cmdline = true; redraw_cmdline = true;
} }
@ -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 { } else {
draw_cmdline_no_arabicshape: draw_cmdline_no_arabicshape:
if (kv_size(ccline.last_colors.colors)) { if (kv_size(ccline.last_colors.colors)) {
@ -3410,12 +3410,10 @@ draw_cmdline_no_arabicshape:
continue; continue;
} }
const int chunk_start = MAX(chunk.start, start); const int chunk_start = MAX(chunk.start, start);
msg_outtrans_len_attr(ccline.cmdbuff + chunk_start, msg_outtrans_len(ccline.cmdbuff + chunk_start, chunk.end - chunk_start, chunk.attr);
chunk.end - chunk_start,
chunk.attr);
} }
} else { } else {
msg_outtrans_len(ccline.cmdbuff + start, len); msg_outtrans_len(ccline.cmdbuff + start, len, 0);
} }
} }
} }

View File

@ -118,7 +118,7 @@ void filemess(buf_T *buf, char *name, char *s, int attr)
msg_scroll = msg_scroll_save; msg_scroll = msg_scroll_save;
msg_scrolled_ign = true; msg_scrolled_ign = true;
// may truncate the message to avoid a hit-return prompt // 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(); msg_clr_eos();
ui_flush(); ui_flush();
msg_scrolled_ign = false; msg_scrolled_ign = false;
@ -1762,7 +1762,7 @@ failed:
if (msg_col > 0) { if (msg_col > 0) {
msg_putchar('\r'); // overwrite previous message 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 if (read_stdin || read_buffer || restart_edit != 0
@ -2035,7 +2035,7 @@ static char *readfile_charconvert(char *fname, char *fenc, int *fdp)
if (errmsg != NULL) { if (errmsg != NULL) {
// Don't use emsg(), it breaks mappings, the retry with // Don't use emsg(), it breaks mappings, the retry with
// another type of conversion might still work. // another type of conversion might still work.
msg(errmsg); msg(errmsg, 0);
if (tmpname != NULL) { if (tmpname != NULL) {
os_remove(tmpname); // delete converted file os_remove(tmpname); // delete converted file
XFREE_CLEAR(tmpname); XFREE_CLEAR(tmpname);

View File

@ -1523,7 +1523,7 @@ static void highlight_list_one(const int id)
didh = true; didh = true;
msg_puts_attr("links to", HL_ATTR(HLF_D)); msg_puts_attr("links to", HL_ATTR(HLF_D));
msg_putchar(' '); 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) { 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(name, HL_ATTR(HLF_D));
msg_puts_attr("=", HL_ATTR(HLF_D)); msg_puts_attr("=", HL_ATTR(HLF_D));
} }
msg_outtrans(ts); msg_outtrans(ts, 0);
} }
return didh; return didh;
} }
@ -1786,7 +1786,7 @@ bool syn_list_header(const bool did_header, const int outlen, const int id, bool
if (got_int) { if (got_int) {
return true; return true;
} }
msg_outtrans(hl_table[id - 1].sg_name); msg_outtrans(hl_table[id - 1].sg_name, 0);
name_col = msg_col; name_col = msg_col;
endcol = 15; endcol = 15;
} else if ((ui_has(kUIMessages) || msg_silent) && !force_newline) { } else if ((ui_has(kUIMessages) || msg_silent) && !force_newline) {

View File

@ -467,9 +467,8 @@ bool check_compl_option(bool dict_opt)
&& *curbuf->b_p_tsrfu == NUL && *p_tsrfu == NUL)) { && *curbuf->b_p_tsrfu == NUL && *p_tsrfu == NUL)) {
ctrl_x_mode = CTRL_X_NORMAL; ctrl_x_mode = CTRL_X_NORMAL;
edit_submode = NULL; edit_submode = NULL;
msg_attr((dict_opt msg((dict_opt ? _("'dictionary' option is empty") : _("'thesaurus' option is empty")),
? _("'dictionary' option is empty") HL_ATTR(HLF_E));
: _("'thesaurus' option is empty")), HL_ATTR(HLF_E));
if (emsg_silent == 0 && !in_assert_fails) { if (emsg_silent == 0 && !in_assert_fails) {
vim_beep(BO_COMPL); vim_beep(BO_COMPL);
setcursor(); setcursor();
@ -1452,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++) { for (i = 0; i < count && !got_int && !compl_interrupted; i++) {
fp = os_fopen(files[i], "r"); // open dictionary file fp = os_fopen(files[i], "r"); // open dictionary file
if (flags != DICT_EXACT && !shortmess(SHM_COMPLETIONSCAN)) { 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, vim_snprintf(IObuff, IOSIZE,
_("Scanning dictionary: %s"), files[i]); _("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) { if (fp == NULL) {
@ -2878,14 +2877,14 @@ static int process_next_cpt_value(ins_compl_next_state_T *st, int *compl_type_ar
st->dict_f = DICT_EXACT; st->dict_f = DICT_EXACT;
} }
if (!shortmess(SHM_COMPLETIONSCAN)) { 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"), vim_snprintf(IObuff, IOSIZE, _("Scanning: %s"),
st->ins_buf->b_fname == NULL st->ins_buf->b_fname == NULL
? buf_spname(st->ins_buf) ? buf_spname(st->ins_buf)
: st->ins_buf->b_sfname == NULL : st->ins_buf->b_sfname == NULL
? st->ins_buf->b_fname ? st->ins_buf->b_fname
: st->ins_buf->b_sfname); : 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) { } else if (*st->e_cpt == NUL) {
status = INS_COMPL_CPT_END; status = INS_COMPL_CPT_END;
@ -2909,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') { } else if (*st->e_cpt == ']' || *st->e_cpt == 't') {
compl_type = CTRL_X_TAGS; compl_type = CTRL_X_TAGS;
if (!shortmess(SHM_COMPLETIONSCAN)) { 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.")); 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));
} }
} }
@ -3490,7 +3489,7 @@ static void ins_compl_show_filename(void)
msg_hist_off = true; msg_hist_off = true;
vim_snprintf(IObuff, IOSIZE, "%s %s%s", lead, vim_snprintf(IObuff, IOSIZE, "%s %s%s", lead,
s > compl_shown_match->cp_fname ? "<" : "", s); s > compl_shown_match->cp_fname ? "<" : "", s);
msg(IObuff); msg(IObuff, 0);
msg_hist_off = false; msg_hist_off = false;
redraw_cmdline = false; // don't overwrite! redraw_cmdline = false; // don't overwrite!
} }
@ -4317,9 +4316,8 @@ static void ins_compl_show_statusmsg(void)
if (edit_submode_extra != NULL) { if (edit_submode_extra != NULL) {
if (!p_smd) { if (!p_smd) {
msg_hist_off = true; msg_hist_off = true;
msg_attr(edit_submode_extra, msg(edit_submode_extra, (edit_submode_highl < HLF_COUNT
(edit_submode_highl < HLF_COUNT ? HL_ATTR(edit_submode_highl) : 0));
? HL_ATTR(edit_submode_highl) : 0));
msg_hist_off = false; msg_hist_off = false;
} }
} else { } else {

View File

@ -953,11 +953,11 @@ static void nlua_print_event(void **argv)
} }
break; break;
} }
msg(str + start); msg(str + start, 0);
msg_didout = true; // Make blank lines work properly msg_didout = true; // Make blank lines work properly
} }
if (len && str[len - 1] == NUL) { // Last was newline if (len && str[len - 1] == NUL) { // Last was newline
msg(""); msg("", 0);
} }
xfree(str); xfree(str);
} }

View File

@ -877,9 +877,9 @@ static int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev,
// print entries // print entries
if (!did_it && !did_local) { if (!did_it && !did_local) {
if (is_abbrev) { if (is_abbrev) {
msg(_("No abbreviation found")); msg(_("No abbreviation found"), 0);
} else { } else {
msg(_("No mapping found")); msg(_("No mapping found"), 0);
} }
} }
goto theend; // listing finished goto theend; // listing finished
@ -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 we are in a secure mode we print the mappings for security reasons.
if (secure) { if (secure) {
secure = 2; secure = 2;
msg_outtrans(eap->cmd); msg_outtrans(eap->cmd, 0);
msg_putchar('\n'); msg_putchar('\n');
} }
do_exmap(eap, false); do_exmap(eap, false);

View File

@ -881,7 +881,7 @@ static void show_one_mark(int c, char *arg, pos_T *p, char *name_arg, int curren
did_title = false; did_title = false;
} else { } else {
if (arg == NULL) { if (arg == NULL) {
msg(_("No marks set")); msg(_("No marks set"), 0);
} else { } else {
semsg(_("E283: No marks matching \"%s\""), arg); semsg(_("E283: No marks matching \"%s\""), arg);
} }
@ -903,9 +903,9 @@ static void show_one_mark(int c, char *arg, pos_T *p, char *name_arg, int curren
msg_putchar('\n'); msg_putchar('\n');
if (!got_int) { if (!got_int) {
snprintf(IObuff, IOSIZE, " %c %6" PRIdLINENR " %4d ", c, p->lnum, p->col); snprintf(IObuff, IOSIZE, " %c %6" PRIdLINENR " %4d ", c, p->lnum, p->col);
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
if (name != NULL) { 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 ? i - curwin->w_jumplistidx : curwin->w_jumplistidx - i, 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); curwin->w_jumplist[i].fmark.mark.lnum, curwin->w_jumplist[i].fmark.mark.col);
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
msg_outtrans_attr(name, msg_outtrans(name,
curwin->w_jumplist[i].fmark.fnum == curbuf->b_fnum curwin->w_jumplist[i].fmark.fnum == curbuf->b_fnum ? HL_ATTR(HLF_D) : 0);
? HL_ATTR(HLF_D) : 0);
xfree(name); xfree(name);
os_breakcheck(); os_breakcheck();
} }
@ -1072,9 +1071,9 @@ void ex_changes(exarg_T *eap)
i > curwin->w_changelistidx ? i - curwin->w_changelistidx : curwin->w_changelistidx - i, i > curwin->w_changelistidx ? i - curwin->w_changelistidx : curwin->w_changelistidx - i,
(long)curbuf->b_changelist[i].mark.lnum, (long)curbuf->b_changelist[i].mark.lnum,
curbuf->b_changelist[i].mark.col); curbuf->b_changelist[i].mark.col);
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
name = mark_line(&curbuf->b_changelist[i].mark, 17); 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); xfree(name);
os_breakcheck(); os_breakcheck();
} }

View File

@ -1527,7 +1527,7 @@ void show_utf8(void)
char *line = get_cursor_pos_ptr(); char *line = get_cursor_pos_ptr();
int len = utfc_ptr2len(line); int len = utfc_ptr2len(line);
if (len == 0) { if (len == 0) {
msg("NUL"); msg("NUL", 0);
return; return;
} }
@ -1552,7 +1552,7 @@ void show_utf8(void)
} }
} }
msg(IObuff); msg(IObuff, 0);
} }
/// Return offset from "p" to the start of a character, including composing characters. /// Return offset from "p" to the start of a character, including composing characters.

View File

@ -845,7 +845,7 @@ void ml_recover(bool checkext)
if ((hp = mf_get(mfp, 0, 1)) == NULL) { if ((hp = mf_get(mfp, 0, 1)) == NULL) {
msg_start(); msg_start();
msg_puts_attr(_("Unable to read block 0 from "), attr | MSG_HIST); 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."), msg_puts_attr(_("\nMaybe no changes were made or Vim did not update the swap file."),
attr | MSG_HIST); attr | MSG_HIST);
msg_end(); msg_end();
@ -854,7 +854,7 @@ void ml_recover(bool checkext)
b0p = hp->bh_data; b0p = hp->bh_data;
if (strncmp(b0p->b0_version, "VIM 3.0", 7) == 0) { if (strncmp(b0p->b0_version, "VIM 3.0", 7) == 0) {
msg_start(); 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_puts_attr(_(" cannot be used with this version of Vim.\n"),
MSG_HIST); MSG_HIST);
msg_puts_attr(_("Use Vim version 3.0.\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)) { if (b0_magic_wrong(b0p)) {
msg_start(); 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"), msg_puts_attr(_(" cannot be used on this computer.\n"),
attr | MSG_HIST); attr | MSG_HIST);
msg_puts_attr(_("The file was created on "), 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)); mf_new_page_size(mfp, (unsigned)char_to_long(b0p->b0_page_size));
if (mfp->mf_page_size < previous_page_size) { if (mfp->mf_page_size < previous_page_size) {
msg_start(); 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"), msg_puts_attr(_(" has been damaged (page size is smaller than minimum value).\n"),
attr | MSG_HIST); attr | MSG_HIST);
msg_end(); msg_end();
@ -1196,18 +1196,18 @@ void ml_recover(bool checkext)
emsg(_("E311: Recovery Interrupted")); emsg(_("E311: Recovery Interrupted"));
} else if (error) { } else if (error) {
no_wait_return++; no_wait_return++;
msg(">>>>>>>>>>>>>"); msg(">>>>>>>>>>>>>", 0);
emsg(_("E312: Errors detected while recovering; look for lines starting with ???")); emsg(_("E312: Errors detected while recovering; look for lines starting with ???"));
no_wait_return--; no_wait_return--;
msg(_("See \":help E312\" for more information.")); msg(_("See \":help E312\" for more information."), 0);
msg(">>>>>>>>>>>>>"); msg(">>>>>>>>>>>>>", 0);
} else { } else {
if (curbuf->b_changed) { if (curbuf->b_changed) {
msg(_("Recovery completed. You should check if everything is OK.")); msg(_("Recovery completed. You should check if everything is OK."), 0);
msg_puts(_("\n(You might want to write out this file under another name\n")); msg_puts(_("\n(You might want to write out this file under another name\n"));
msg_puts(_("and run diff with the original file to check for changes)")); msg_puts(_("and run diff with the original file to check for changes)"));
} else { } else {
msg(_("Recovery completed. Buffer contents equals file contents.")); msg(_("Recovery completed. Buffer contents equals file contents."), 0);
} }
msg_puts(_("\nYou may want to delete the .swp file now.")); msg_puts(_("\nYou may want to delete the .swp file now."));
if (swapfile_process_running(b0p, fname_used)) { if (swapfile_process_running(b0p, fname_used)) {
@ -1283,7 +1283,7 @@ int recover_names(char *fname, bool do_list, list_T *ret_list, int nr, char **fn
if (do_list) { if (do_list) {
// use msg() to start the scrolling properly // use msg() to start the scrolling properly
msg(_("Swap files found:")); msg(_("Swap files found:"), 0);
msg_putchar('\n'); msg_putchar('\n');
} }
@ -1515,7 +1515,7 @@ static time_t swapfile_info(char *fname)
// print name of owner of the file // print name of owner of the file
if (os_get_uname((uv_uid_t)file_info.stat.st_uid, uname, B0_UNAME_SIZE) == OK) { if (os_get_uname((uv_uid_t)file_info.stat.st_uid, uname, B0_UNAME_SIZE) == OK) {
msg_puts(_(" owned by: ")); msg_puts(_(" owned by: "));
msg_outtrans(uname); msg_outtrans(uname, 0);
msg_puts(_(" dated: ")); msg_puts(_(" dated: "));
} else { } else {
msg_puts(_(" dated: ")); msg_puts(_(" dated: "));
@ -1543,7 +1543,7 @@ static time_t swapfile_info(char *fname)
if (b0.b0_fname[0] == NUL) { if (b0.b0_fname[0] == NUL) {
msg_puts(_("[No Name]")); msg_puts(_("[No Name]"));
} else { } else {
msg_outtrans(b0.b0_fname); msg_outtrans(b0.b0_fname, 0);
} }
msg_puts(_("\n modified: ")); msg_puts(_("\n modified: "));
@ -1551,7 +1551,7 @@ static time_t swapfile_info(char *fname)
if (*(b0.b0_uname) != NUL) { if (*(b0.b0_uname) != NUL) {
msg_puts(_("\n user name: ")); msg_puts(_("\n user name: "));
msg_outtrans(b0.b0_uname); msg_outtrans(b0.b0_uname, 0);
} }
if (*(b0.b0_hname) != NUL) { if (*(b0.b0_hname) != NUL) {
@ -1560,7 +1560,7 @@ static time_t swapfile_info(char *fname)
} else { } else {
msg_puts(_("\n host name: ")); msg_puts(_("\n host name: "));
} }
msg_outtrans(b0.b0_hname); msg_outtrans(b0.b0_hname, 0);
} }
if (char_to_long(b0.b0_pid) != 0L) { if (char_to_long(b0.b0_pid) != 0L) {
@ -1785,7 +1785,7 @@ theend:
if (message) { if (message) {
if (status == OK) { if (status == OK) {
msg(_("File preserved")); msg(_("File preserved"), 0);
} else { } else {
emsg(_("E314: Preserve failed")); emsg(_("E314: Preserve failed"));
} }
@ -3226,7 +3226,7 @@ static void attention_message(buf_T *buf, char *fname)
msg_puts("\"\n"); msg_puts("\"\n");
const time_t swap_mtime = swapfile_info(fname); const time_t swap_mtime = swapfile_info(fname);
msg_puts(_("While opening file \"")); msg_puts(_("While opening file \""));
msg_outtrans(buf->b_fname); msg_outtrans(buf->b_fname, 0);
msg_puts("\"\n"); msg_puts("\"\n");
FileInfo file_info; FileInfo file_info;
if (!os_fileinfo(buf->b_fname, &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")); " Quit, or continue with caution.\n"));
msg_puts(_("(2) An edit session for this file crashed.\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_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(_("\"\n to recover the changes (see \":help recovery\").\n"));
msg_puts(_(" If you did this already, delete the swap file \"")); 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")); msg_puts(_("\"\n to avoid this message.\n"));
cmdline_row = msg_row; cmdline_row = msg_row;
no_wait_return--; no_wait_return--;

View File

@ -824,7 +824,7 @@ static void show_menus_recursive(vimmenu_T *menu, int modes, int depth)
msg_puts(" "); msg_puts(" ");
} }
// Same highlighting as for directories!? // 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) { if (menu != NULL && menu->children == NULL) {

View File

@ -212,15 +212,6 @@ void msg_grid_validate(void)
} }
} }
/// Displays the string 's' on the status line
/// When terminal not initialized (yet) os_errmsg(..) is used.
///
/// @return true if wait_return() not called
int msg(const char *s)
{
return msg_attr_keep(s, 0, false, false);
}
/// Like msg() but keep it silent when 'verbosefile' is set. /// Like msg() but keep it silent when 'verbosefile' is set.
int verb_msg(const char *s) int verb_msg(const char *s)
{ {
@ -231,14 +222,18 @@ int verb_msg(const char *s)
return n; return n;
} }
int msg_attr(const char *s, const int attr) /// Displays the string 's' on the status line
/// When terminal not initialized (yet) os_errmsg(..) is used.
///
/// @return true if wait_return() not called
int msg(const char *s, const int attr)
FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_NONNULL_ARG(1)
{ {
return msg_attr_keep(s, attr, false, false); 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) void msg_multiline(const char *s, int attr, bool check_int, bool *need_clear)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_ALL
{ {
const char *next_spec = s; const char *next_spec = s;
@ -251,7 +246,7 @@ void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clea
if (next_spec != NULL) { if (next_spec != NULL) {
// Printing all char that are before the char found by strpbrk // 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) { if (*next_spec != TAB && *need_clear) {
msg_clr_eos(); msg_clr_eos();
@ -265,7 +260,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 // Print the rest of the message. We know there is no special
// character because strpbrk returned NULL // character because strpbrk returned NULL
if (*s != NUL) { if (*s != NUL) {
msg_outtrans_attr(s, attr); msg_outtrans(s, attr);
} }
} }
@ -278,7 +273,7 @@ void msg_multiattr(HlMessage hl_msg, const char *kind, bool history)
msg_ext_set_kind(kind); msg_ext_set_kind(kind);
for (uint32_t i = 0; i < kv_size(hl_msg); i++) { for (uint32_t i = 0; i < kv_size(hl_msg); i++) {
HlMessageChunk chunk = kv_A(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)) { if (history && kv_size(hl_msg)) {
add_msg_hist_multiattr(NULL, 0, 0, true, hl_msg); add_msg_hist_multiattr(NULL, 0, 0, true, hl_msg);
@ -339,9 +334,9 @@ bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline)
bool need_clear = true; bool need_clear = true;
if (multiline) { if (multiline) {
msg_multiline_attr(s, attr, false, &need_clear); msg_multiline(s, attr, false, &need_clear);
} else { } else {
msg_outtrans_attr(s, attr); msg_outtrans(s, attr);
} }
if (need_clear) { if (need_clear) {
msg_clr_eos(); msg_clr_eos();
@ -491,7 +486,7 @@ int smsg(const char *s, ...)
vim_vsnprintf(IObuff, IOSIZE, s, arglist); vim_vsnprintf(IObuff, IOSIZE, s, arglist);
va_end(arglist); va_end(arglist);
return msg(IObuff); return msg(IObuff, 0);
} }
int smsg_attr(int attr, const char *s, ...) int smsg_attr(int attr, const char *s, ...)
@ -502,7 +497,7 @@ int smsg_attr(int attr, const char *s, ...)
va_start(arglist, s); va_start(arglist, s);
vim_vsnprintf(IObuff, IOSIZE, s, arglist); vim_vsnprintf(IObuff, IOSIZE, s, arglist);
va_end(arglist); va_end(arglist);
return msg_attr(IObuff, attr); return msg(IObuff, attr);
} }
int smsg_attr_keep(int attr, const char *s, ...) int smsg_attr_keep(int attr, const char *s, ...)
@ -604,12 +599,12 @@ void msg_source(int attr)
char *p = get_emsg_source(); char *p = get_emsg_source();
if (p != NULL) { if (p != NULL) {
msg_scroll = true; // this will take more than one line msg_scroll = true; // this will take more than one line
msg_attr(p, attr); msg(p, attr);
xfree(p); xfree(p);
} }
p = get_emsg_lnum(); p = get_emsg_lnum();
if (p != NULL) { if (p != NULL) {
msg_attr(p, HL_ATTR(HLF_N)); msg(p, HL_ATTR(HLF_N));
xfree(p); xfree(p);
last_sourcing_lnum = SOURCING_LNUM; // only once for each line last_sourcing_lnum = SOURCING_LNUM; // only once for each line
} }
@ -908,7 +903,7 @@ void msg_schedule_semsg_multiline(const char *const fmt, ...)
/// Careful: The string may be changed by msg_may_trunc()! /// Careful: The string may be changed by msg_may_trunc()!
/// ///
/// @return a pointer to the printed message, if wait_return() not called. /// @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; int n;
@ -918,7 +913,7 @@ char *msg_trunc_attr(char *s, bool force, int attr)
char *ts = msg_may_trunc(force, s); char *ts = msg_may_trunc(force, s);
msg_hist_off = true; msg_hist_off = true;
n = msg_attr(ts, attr); n = msg(ts, attr);
msg_hist_off = false; msg_hist_off = false;
if (n) { if (n) {
@ -1400,7 +1395,7 @@ void msgmore(long n)
if (got_int) { if (got_int) {
xstrlcat(msg_buf, _(" (Interrupted)"), MSG_BUF_LEN); xstrlcat(msg_buf, _(" (Interrupted)"), MSG_BUF_LEN);
} }
if (msg(msg_buf)) { if (msg(msg_buf, 0)) {
set_keep_msg(msg_buf, 0); set_keep_msg(msg_buf, 0);
keep_msg_more = true; keep_msg_more = true;
} }
@ -1520,7 +1515,7 @@ void msg_home_replace_hl(const char *fname)
static void msg_home_replace_attr(const char *fname, int attr) static void msg_home_replace_attr(const char *fname, int attr)
{ {
char *name = home_replace_save(NULL, fname); char *name = home_replace_save(NULL, fname);
msg_outtrans_attr(name, attr); msg_outtrans(name, attr);
xfree(name); xfree(name);
} }
@ -1529,19 +1524,9 @@ static void msg_home_replace_attr(const char *fname, int attr)
/// Use attributes 'attr'. /// Use attributes 'attr'.
/// ///
/// @return the number of characters it takes on the screen. /// @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); return msg_outtrans_len(str, (int)strlen(str), attr);
}
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);
} }
/// Output one character at "p". /// Output one character at "p".
@ -1553,14 +1538,14 @@ const char *msg_outtrans_one(const char *p, int attr)
int l; int l;
if ((l = utfc_ptr2len(p)) > 1) { if ((l = utfc_ptr2len(p)) > 1) {
msg_outtrans_len_attr(p, l, attr); msg_outtrans_len(p, l, attr);
return p + l; return p + l;
} }
msg_puts_attr(transchar_byte_buf(NULL, (uint8_t)(*p)), attr); msg_puts_attr(transchar_byte_buf(NULL, (uint8_t)(*p)), attr);
return p + 1; 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; int retval = 0;
const char *str = msgstr; const char *str = msgstr;
@ -2052,10 +2037,10 @@ void msg_outtrans_long_len_attr(const char *longstr, int len, int attr)
room = Columns - msg_col; room = Columns - msg_col;
if (len > room && room >= 20) { if (len > room && room >= 20) {
slen = (room - 3) / 2; 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_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. /// Basic function for writing a message with highlight attributes.
@ -3467,7 +3452,7 @@ void give_warning(const char *message, bool hl)
msg_ext_set_kind("wmsg"); msg_ext_set_kind("wmsg");
} }
if (msg_attr(message, keep_msg_attr) && msg_scrolled == 0) { if (msg(message, keep_msg_attr) && msg_scrolled == 0) {
set_keep_msg(message, keep_msg_attr); set_keep_msg(message, keep_msg_attr);
} }
msg_didout = false; // Overwrite this message. msg_didout = false; // Overwrite this message.

View File

@ -689,7 +689,7 @@ static void normal_redraw_mode_message(NormalState *s)
keep_msg = kmsg; keep_msg = kmsg;
kmsg = xstrdup(keep_msg); kmsg = xstrdup(keep_msg);
msg_attr(kmsg, keep_msg_attr); msg(kmsg, keep_msg_attr);
xfree(kmsg); xfree(kmsg);
} }
setcursor(); setcursor();
@ -1377,7 +1377,7 @@ static void normal_redraw(NormalState *s)
// check for duplicates. Never put this message in // check for duplicates. Never put this message in
// history. // history.
msg_hist_off = true; msg_hist_off = true;
msg_attr(p, keep_msg_attr); msg(p, keep_msg_attr);
msg_hist_off = false; msg_hist_off = false;
xfree(p); xfree(p);
} }
@ -6140,9 +6140,9 @@ static void nv_esc(cmdarg_T *cap)
if (restart_edit == 0 && cmdwin_type == 0 && !VIsual_active && no_reason) { if (restart_edit == 0 && cmdwin_type == 0 && !VIsual_active && no_reason) {
if (anyBufIsChanged()) { if (anyBufIsChanged()) {
msg(_("Type :qa! and press <Enter> to abandon all changes" msg(_("Type :qa! and press <Enter> to abandon all changes"
" and exit Nvim")); " and exit Nvim"), 0);
} else { } else {
msg(_("Type :qa and press <Enter> to exit Nvim")); msg(_("Type :qa and press <Enter> to exit Nvim"), 0);
} }
} }

View File

@ -938,7 +938,7 @@ int do_record(int c)
if (p_ch == 0 || ui_has(kUIMessages)) { if (p_ch == 0 || ui_has(kUIMessages)) {
showmode(); showmode();
} else { } else {
msg(""); msg("", 0);
} }
if (p == NULL) { if (p == NULL) {
retval = FAIL; retval = FAIL;
@ -3838,7 +3838,7 @@ void ex_display(exarg_T *eap)
for (p = yb->y_array[j]; for (p = yb->y_array[j];
*p != NUL && (n -= ptr2cells(p)) >= 0; p++) { // -V1019 *p != NUL && (n -= ptr2cells(p)) >= 0; p++) { // -V1019
clen = utfc_ptr2len(p); clen = utfc_ptr2len(p);
msg_outtrans_len(p, clen); msg_outtrans_len(p, clen, 0);
p += clen - 1; p += clen - 1;
} }
} }
@ -3913,10 +3913,10 @@ static void dis_msg(const char *p, bool skip_esc)
&& (n -= ptr2cells(p)) >= 0) { && (n -= ptr2cells(p)) >= 0) {
int l; int l;
if ((l = utfc_ptr2len(p)) > 1) { if ((l = utfc_ptr2len(p)) > 1) {
msg_outtrans_len(p, l); msg_outtrans_len(p, l, 0);
p += l; p += l;
} else { } else {
msg_outtrans_len(p++, 1); msg_outtrans_len(p++, 1, 0);
} }
} }
os_breakcheck(); os_breakcheck();
@ -5333,7 +5333,7 @@ void cursor_pos_info(dict_T *dict)
// Compute the length of the file in characters. // Compute the length of the file in characters.
if (curbuf->b_ml.ml_flags & ML_EMPTY) { if (curbuf->b_ml.ml_flags & ML_EMPTY) {
if (dict == NULL) { if (dict == NULL) {
msg(_(no_lines_msg)); msg(_(no_lines_msg), 0);
return; return;
} }
} else { } else {
@ -5538,7 +5538,7 @@ void cursor_pos_info(dict_T *dict)
msg_start(); msg_start();
msg_scroll = true; msg_scroll = true;
} }
msg(IObuff); msg(IObuff, 0);
p_shm = p; p_shm = p;
} }
} }
@ -6452,7 +6452,7 @@ static yankreg_T *adjust_clipboard_name(int *name, bool quiet, bool writing)
clipboard_didwarn = true; clipboard_didwarn = true;
// Do NOT error (emsg()) here--if it interrupts :redir we get into // Do NOT error (emsg()) here--if it interrupts :redir we get into
// a weird state, stuck in "redirect mode". // a weird state, stuck in "redirect mode".
msg(MSG_NO_CLIP); msg(MSG_NO_CLIP, 0);
} }
// ... else, be silent (don't flood during :while, :redir, etc.). // ... else, be silent (don't flood during :while, :redir, etc.).
goto end; goto end;

View File

@ -2476,7 +2476,7 @@ static const char *did_set_arabic(optset_T *args)
static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'"); static char *w_arabic = N_("W17: Arabic requires UTF-8, do ':set encoding=utf-8'");
msg_source(HL_ATTR(HLF_W)); msg_source(HL_ATTR(HLF_W));
msg_attr(_(w_arabic), HL_ATTR(HLF_W)); msg(_(w_arabic), HL_ATTR(HLF_W));
set_vim_var_string(VV_WARNINGMSG, _(w_arabic), -1); set_vim_var_string(VV_WARNINGMSG, _(w_arabic), -1);
} }
@ -4058,7 +4058,7 @@ static void showoneopt(vimoption_T *p, int opt_flags)
msg_putchar('='); msg_putchar('=');
// put value string in NameBuff // put value string in NameBuff
option_value2string(p, opt_flags); option_value2string(p, opt_flags);
msg_outtrans(NameBuff); msg_outtrans(NameBuff, 0);
} }
silent_mode = save_silent; silent_mode = save_silent;

View File

@ -364,7 +364,7 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
if (!(flags & EW_SILENT)) { if (!(flags & EW_SILENT)) {
msg_putchar('\n'); // clear bottom line quickly msg_putchar('\n'); // clear bottom line quickly
cmdline_row = Rows - 1; // continue on last line cmdline_row = Rows - 1; // continue on last line
msg(_(e_wildexpand)); msg(_(e_wildexpand), 0);
msg_start(); // don't overwrite this message msg_start(); // don't overwrite this message
} }
@ -381,7 +381,7 @@ int os_expand_wildcards(int num_pat, char **pat, int *num_file, char ***file, in
if (fd == NULL) { if (fd == NULL) {
// Something went wrong, perhaps a file name with a special char. // Something went wrong, perhaps a file name with a special char.
if (!(flags & EW_SILENT)) { if (!(flags & EW_SILENT)) {
msg(_(e_wildexpand)); msg(_(e_wildexpand), 0);
msg_start(); // don't overwrite this message msg_start(); // don't overwrite this message
} }
xfree(tempname); xfree(tempname);
@ -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. // Failed, probably 'shell' is not executable.
if (!silent) { if (!silent) {
msg_puts(_("\nshell failed to start: ")); msg_puts(_("\nshell failed to start: "));
msg_outtrans(os_strerror(status)); msg_outtrans(os_strerror(status), 0);
msg_puts(": "); msg_puts(": ");
msg_outtrans(prog); msg_outtrans(prog, 0);
msg_putchar('\n'); msg_putchar('\n');
} }
multiqueue_free(events); multiqueue_free(events);
@ -1127,7 +1127,7 @@ static void out_data_append_to_screen(char *output, size_t *count, bool eof)
goto end; goto end;
} }
(void)msg_outtrans_len_attr(p, i, 0); (void)msg_outtrans_len(p, i, 0);
p += i; p += i;
} }
} }

View File

@ -3132,7 +3132,7 @@ static void qf_list_entry(qfline_T *qfp, int qf_idx, bool cursel)
} }
msg_putchar('\n'); 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) { if (qfp->qf_lnum != 0) {
msg_puts_attr(":", qfSepAttr); msg_puts_attr(":", qfSepAttr);
@ -3308,7 +3308,7 @@ static void qf_msg(qf_info_T *qi, int which, char *lead)
xstrlcat(buf, title, IOSIZE); xstrlcat(buf, title, IOSIZE);
} }
trunc_string(buf, buf, Columns - 1, IOSIZE); trunc_string(buf, buf, Columns - 1, IOSIZE);
msg(buf); msg(buf, 0);
} }
/// ":colder [count]": Up in the quickfix stack. /// ":colder [count]": Up in the quickfix stack.
@ -3367,7 +3367,7 @@ void qf_history(exarg_T *eap)
} }
if (qf_stack_empty(qi)) { if (qf_stack_empty(qi)) {
msg(_("No entries")); msg(_("No entries"), 0);
} else { } else {
for (int i = 0; i < qi->qf_listcount; i++) { for (int i = 0; i < qi->qf_listcount; i++) {
qf_msg(qi, i, i == qi->qf_curlist ? "> " : " "); qf_msg(qi, i, i == qi->qf_curlist ? "> " : " ");
@ -4317,7 +4317,7 @@ static char *make_get_fullcmd(const char *makecmd, const char *fname)
} }
msg_start(); msg_start();
msg_puts(":!"); msg_puts(":!");
msg_outtrans(cmd); // show what we are doing msg_outtrans(cmd, 0); // show what we are doing
return cmd; return cmd;
} }
@ -5168,9 +5168,9 @@ static void vgr_display_fname(char *fname)
msg_start(); msg_start();
char *p = msg_strtrunc(fname, true); char *p = msg_strtrunc(fname, true);
if (p == NULL) { if (p == NULL) {
msg_outtrans(fname); msg_outtrans(fname, 0);
} else { } else {
msg_outtrans(p); msg_outtrans(p, 0);
xfree(p); xfree(p);
} }
msg_clr_eos(); msg_clr_eos();

View File

@ -2329,7 +2329,7 @@ void ex_scriptnames(exarg_T *eap)
vim_snprintf(IObuff, IOSIZE, "%3d: %s", i, NameBuff); vim_snprintf(IObuff, IOSIZE, "%3d: %s", i, NameBuff);
if (!message_filtered(IObuff)) { if (!message_filtered(IObuff)) {
msg_putchar('\n'); msg_putchar('\n');
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
line_breakcheck(); line_breakcheck();
} }
} }

View File

@ -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)); memset(msgbuf + pat_len, ' ', (size_t)(r - msgbuf));
} }
} }
msg_outtrans(msgbuf); msg_outtrans(msgbuf, 0);
msg_clr_eos(); msg_clr_eos();
msg_check(); 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) { if (new_fname != NULL) {
// using "new_fname" is more reliable, e.g., when // using "new_fname" is more reliable, e.g., when
// 'includeexpr' is set. // 'includeexpr' is set.
msg_outtrans_attr(new_fname, HL_ATTR(HLF_D)); msg_outtrans(new_fname, HL_ATTR(HLF_D));
} else { } else {
// Isolate the file name. // Isolate the file name.
// Include the surrounding "" or <> if present. // 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]; save_char = p[i];
p[i] = NUL; p[i] = NUL;
msg_outtrans_attr(p, HL_ATTR(HLF_D)); msg_outtrans(p, HL_ATTR(HLF_D));
p[i] = save_char; p[i] = save_char;
} }
@ -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].lnum = 0;
files[depth].matched = false; files[depth].matched = false;
if (action == ACTION_EXPAND) { 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, vim_snprintf(IObuff, IOSIZE,
_("Scanning included file: %s"), _("Scanning included file: %s"),
new_fname); new_fname);
msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R)); msg_trunc(IObuff, true, HL_ATTR(HLF_R));
} else if (p_verbose >= 5) { } else if (p_verbose >= 5) {
verbose_enter(); verbose_enter();
smsg(_("Searching included file %s"), new_fname); smsg(_("Searching included file %s"), new_fname);
@ -4116,9 +4116,9 @@ exit_matched:
if (type == CHECK_PATH) { if (type == CHECK_PATH) {
if (!did_show) { if (!did_show) {
if (action != ACTION_SHOW_ALL) { if (action != ACTION_SHOW_ALL) {
msg(_("All included files were found")); msg(_("All included files were found"), 0);
} else { } else {
msg(_("No included files")); msg(_("No included files"), 0);
} }
} }
} else if (!found } else if (!found

View File

@ -1663,12 +1663,12 @@ static void sign_list_defined(sign_T *sp)
smsg("sign %s", sp->sn_name); smsg("sign %s", sp->sn_name);
if (sp->sn_icon != NULL) { if (sp->sn_icon != NULL) {
msg_puts(" icon="); msg_puts(" icon=");
msg_outtrans(sp->sn_icon); msg_outtrans(sp->sn_icon, 0);
msg_puts(_(" (not supported)")); msg_puts(_(" (not supported)"));
} }
if (sp->sn_text != NULL) { if (sp->sn_text != NULL) {
msg_puts(" text="); msg_puts(" text=");
msg_outtrans(sp->sn_text); msg_outtrans(sp->sn_text, 0);
} }
if (sp->sn_line_hl > 0) { if (sp->sn_line_hl > 0) {
msg_puts(" linehl="); msg_puts(" linehl=");

View File

@ -1955,9 +1955,9 @@ static void spell_print_node(wordnode_T *node, int depth)
PRINTSOME(line1, depth, "(%d)", node->wn_nr, 0); PRINTSOME(line1, depth, "(%d)", node->wn_nr, 0);
PRINTSOME(line2, depth, " ", 0, 0); PRINTSOME(line2, depth, " ", 0, 0);
PRINTSOME(line3, depth, " ", 0, 0); PRINTSOME(line3, depth, " ", 0, 0);
msg(line1); msg(line1, 0);
msg(line2); msg(line2, 0);
msg(line3); msg(line3, 0);
} else { } else {
node->wn_u1.index = true; node->wn_u1.index = true;
@ -1981,9 +1981,9 @@ static void spell_print_node(wordnode_T *node, int depth)
} }
if (node->wn_byte == NUL) { if (node->wn_byte == NUL) {
msg(line1); msg(line1, 0);
msg(line2); msg(line2, 0);
msg(line3); msg(line3, 0);
} }
// do the children // do the children
@ -2726,11 +2726,11 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char *fname)
// Check that we didn't use too many renumbered flags. // Check that we didn't use too many renumbered flags.
if (spin->si_newcompID < spin->si_newprefID) { if (spin->si_newcompID < spin->si_newprefID) {
if (spin->si_newcompID == 127 || spin->si_newcompID == 255) { if (spin->si_newcompID == 127 || spin->si_newcompID == 255) {
msg(_("Too many postponed prefixes")); msg(_("Too many postponed prefixes"), 0);
} else if (spin->si_newprefID == 0 || spin->si_newprefID == 127) { } else if (spin->si_newprefID == 0 || spin->si_newprefID == 127) {
msg(_("Too many compound flags")); msg(_("Too many compound flags"), 0);
} else { } else {
msg(_("Too many postponed prefixes and/or compound flags")); msg(_("Too many postponed prefixes and/or compound flags"), 0);
} }
} }
@ -5398,7 +5398,7 @@ static void mkspell(int fcount, char **fnames, bool ascii, bool over_write, bool
} }
if (spin.si_compflags != NULL && spin.si_nobreak) { if (spin.si_compflags != NULL && spin.si_nobreak) {
msg(_("Warning: both compounding and NOBREAK specified")); msg(_("Warning: both compounding and NOBREAK specified"), 0);
} }
if (!error && !got_int) { if (!error && !got_int) {
@ -5468,7 +5468,7 @@ static void spell_message(const spellinfo_T *spin, char *str)
if (!spin->si_verbose) { if (!spin->si_verbose) {
verbose_enter(); verbose_enter();
} }
msg(str); msg(str, 0);
ui_flush(); ui_flush();
if (!spin->si_verbose) { if (!spin->si_verbose) {
verbose_leave(); verbose_leave();

View File

@ -526,7 +526,7 @@ void spell_suggest(int count)
true, need_cap, true); true, need_cap, true);
if (GA_EMPTY(&sug.su_ga)) { if (GA_EMPTY(&sug.su_ga)) {
msg(_("Sorry, no suggestions")); msg(_("Sorry, no suggestions"), 0);
} else if (count > 0) { } else if (count > 0) {
if (count > sug.su_ga.ga_len) { if (count > sug.su_ga.ga_len) {
smsg(_("Sorry, only %" PRId64 " suggestions"), smsg(_("Sorry, only %" PRId64 " suggestions"),

View File

@ -2713,7 +2713,7 @@ static int syn_regexec(regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T
} }
if (timed_out && !syn_win->w_s->b_syn_slow) { if (timed_out && !syn_win->w_s->b_syn_slow) {
syn_win->w_s->b_syn_slow = true; syn_win->w_s->b_syn_slow = true;
msg(_("'redrawtime' exceeded, syntax highlighting disabled")); msg(_("'redrawtime' exceeded, syntax highlighting disabled"), 0);
} }
if (r > 0) { if (r > 0) {
@ -2816,9 +2816,9 @@ static void syn_cmd_conceal(exarg_T *eap, int syncing)
next = skiptowhite(arg); next = skiptowhite(arg);
if (*arg == NUL) { if (*arg == NUL) {
if (curwin->w_s->b_syn_conceal) { if (curwin->w_s->b_syn_conceal) {
msg("syntax conceal on"); msg("syntax conceal on", 0);
} else { } else {
msg("syntax conceal off"); msg("syntax conceal off", 0);
} }
} else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2) { } else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2) {
curwin->w_s->b_syn_conceal = true; curwin->w_s->b_syn_conceal = true;
@ -2843,9 +2843,9 @@ static void syn_cmd_case(exarg_T *eap, int syncing)
next = skiptowhite(arg); next = skiptowhite(arg);
if (*arg == NUL) { if (*arg == NUL) {
if (curwin->w_s->b_syn_ic) { if (curwin->w_s->b_syn_ic) {
msg("syntax case ignore"); msg("syntax case ignore", 0);
} else { } else {
msg("syntax case match"); msg("syntax case match", 0);
} }
} else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5) { } else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5) {
curwin->w_s->b_syn_ic = false; curwin->w_s->b_syn_ic = false;
@ -2870,9 +2870,9 @@ static void syn_cmd_foldlevel(exarg_T *eap, int syncing)
if (*arg == NUL) { if (*arg == NUL) {
switch (curwin->w_s->b_syn_foldlevel) { switch (curwin->w_s->b_syn_foldlevel) {
case SYNFLD_START: case SYNFLD_START:
msg("syntax foldlevel start"); break; msg("syntax foldlevel start", 0); break;
case SYNFLD_MINIMUM: case SYNFLD_MINIMUM:
msg("syntax foldlevel minimum"); break; msg("syntax foldlevel minimum", 0); break;
default: default:
break; break;
} }
@ -2909,11 +2909,11 @@ static void syn_cmd_spell(exarg_T *eap, int syncing)
next = skiptowhite(arg); next = skiptowhite(arg);
if (*arg == NUL) { if (*arg == NUL) {
if (curwin->w_s->b_syn_spell == SYNSPL_TOP) { if (curwin->w_s->b_syn_spell == SYNSPL_TOP) {
msg("syntax spell toplevel"); msg("syntax spell toplevel", 0);
} else if (curwin->w_s->b_syn_spell == SYNSPL_NOTOP) { } else if (curwin->w_s->b_syn_spell == SYNSPL_NOTOP) {
msg("syntax spell notoplevel"); msg("syntax spell notoplevel", 0);
} else { } else {
msg("syntax spell default"); msg("syntax spell default", 0);
} }
} else if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8) { } else if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8) {
curwin->w_s->b_syn_spell = SYNSPL_TOP; curwin->w_s->b_syn_spell = SYNSPL_TOP;
@ -2946,9 +2946,9 @@ static void syn_cmd_iskeyword(exarg_T *eap, int syncing)
msg_puts("\n"); msg_puts("\n");
if (curwin->w_s->b_syn_isk != empty_option) { if (curwin->w_s->b_syn_isk != empty_option) {
msg_puts("syntax iskeyword "); msg_puts("syntax iskeyword ");
msg_outtrans(curwin->w_s->b_syn_isk); msg_outtrans(curwin->w_s->b_syn_isk, 0);
} else { } else {
msg_outtrans(_("syntax iskeyword not set")); msg_outtrans(_("syntax iskeyword not set"), 0);
} }
} else { } else {
if (STRNICMP(arg, "clear", 5) == 0) { if (STRNICMP(arg, "clear", 5) == 0) {
@ -3235,7 +3235,7 @@ static void syn_cmd_list(exarg_T *eap, int syncing)
} }
if (!syntax_present(curwin)) { if (!syntax_present(curwin)) {
msg(_(msg_no_items)); msg(_(msg_no_items), 0);
return; return;
} }
@ -3427,7 +3427,7 @@ static void syn_list_one(const int id, const bool syncing, const bool link_only)
msg_putchar(' '); msg_putchar(' ');
if (spp->sp_sync_idx >= 0) { if (spp->sp_sync_idx >= 0) {
msg_outtrans(highlight_group_name(SYN_ITEMS(curwin->w_s) 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 { } else {
msg_puts("NONE"); 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); (void)syn_list_header(did_header, 0, id, true);
msg_puts_attr("links to", attr); msg_puts_attr("links to", attr);
msg_putchar(' '); 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() // slight hack: roughly duplicate the guts of syn_list_header()
msg_putchar('\n'); 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 if (msg_col >= endcol) { // output at least one space
endcol = msg_col + 1; 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; int scl_id = *p - SYNID_CLUSTER;
msg_putchar('@'); 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 { } else {
msg_outtrans(highlight_group_name(*p - 1)); msg_outtrans(highlight_group_name(*p - 1), 0);
} }
if (p[1]) { if (p[1]) {
msg_putchar(','); 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_puts_attr("matchgroup", attr);
msg_putchar('='); msg_putchar('=');
if (last_matchgroup == 0) { if (last_matchgroup == 0) {
msg_outtrans("NONE"); msg_outtrans("NONE", 0);
} else { } else {
msg_outtrans(highlight_group_name(last_matchgroup - 1)); msg_outtrans(highlight_group_name(last_matchgroup - 1), 0);
} }
msg_putchar(' '); 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_putchar(sepchars[i]);
msg_outtrans(spp->sp_pattern); msg_outtrans(spp->sp_pattern, 0);
msg_putchar(sepchars[i]); msg_putchar(sepchars[i]);
// output any pattern options // 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); prev_skipempty = (kp->flags & HL_SKIPEMPTY);
} }
} }
msg_outtrans(kp->keyword); msg_outtrans(kp->keyword, 0);
} }
} }
} }
@ -5590,7 +5590,7 @@ static void syntime_clear(void)
synpat_T *spp; synpat_T *spp;
if (!syntax_present(curwin)) { if (!syntax_present(curwin)) {
msg(_(msg_no_items)); msg(_(msg_no_items), 0);
return; return;
} }
for (int idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; idx++) { for (int idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; idx++) {
@ -5628,7 +5628,7 @@ static int syn_compare_syntime(const void *v1, const void *v2)
static void syntime_report(void) static void syntime_report(void)
{ {
if (!syntax_present(curwin)) { if (!syntax_present(curwin)) {
msg(_(msg_no_items)); msg(_(msg_no_items), 0);
return; return;
} }
@ -5682,7 +5682,7 @@ static void syntime_report(void)
msg_puts(profile_msg(p->average)); msg_puts(profile_msg(p->average));
msg_puts(" "); msg_puts(" ");
msg_advance(50); msg_advance(50);
msg_outtrans(highlight_group_name(p->id - 1)); msg_outtrans(highlight_group_name(p->id - 1), 0);
msg_puts(" "); msg_puts(" ");
msg_advance(69); msg_advance(69);
@ -5695,7 +5695,7 @@ static void syntime_report(void)
if (len > (int)strlen(p->pattern)) { if (len > (int)strlen(p->pattern)) {
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"); msg_puts("\n");
} }
ga_clear(&ga); ga_clear(&ga);

View File

@ -736,11 +736,7 @@ void do_tag(char *tag, int type, int count, int forceit, int verbose)
} }
if ((num_matches > prev_num_matches || new_tag) if ((num_matches > prev_num_matches || new_tag)
&& num_matches > 1) { && num_matches > 1) {
if (ic) { msg(IObuff, ic ? HL_ATTR(HLF_W) : 0);
msg_attr(IObuff, HL_ATTR(HLF_W));
} else {
msg(IObuff);
}
msg_scroll = true; // Don't overwrite this message. msg_scroll = true; // Don't overwrite this message.
} else { } else {
give_warning(IObuff, ic); give_warning(IObuff, ic);
@ -847,13 +843,10 @@ static void print_tag_list(int new_tag, int use_tagstack, int num_matches, char
mt_names[matches[i][0] & MT_MASK]); mt_names[matches[i][0] & MT_MASK]);
msg_puts(IObuff); msg_puts(IObuff);
if (tagp.tagkind != NULL) { if (tagp.tagkind != NULL) {
msg_outtrans_len(tagp.tagkind, msg_outtrans_len(tagp.tagkind, (int)(tagp.tagkind_end - tagp.tagkind), 0);
(int)(tagp.tagkind_end - tagp.tagkind));
} }
msg_advance(13); msg_advance(13);
msg_outtrans_len_attr(tagp.tagname, msg_outtrans_len(tagp.tagname, (int)(tagp.tagname_end - tagp.tagname), HL_ATTR(HLF_T));
(int)(tagp.tagname_end - tagp.tagname),
HL_ATTR(HLF_T));
msg_putchar(' '); msg_putchar(' ');
taglen_advance(taglen); taglen_advance(taglen);
@ -861,7 +854,7 @@ static void print_tag_list(int new_tag, int use_tagstack, int num_matches, char
// it and put "..." in the middle // it and put "..." in the middle
p = tag_full_fname(&tagp); p = tag_full_fname(&tagp);
if (p != NULL) { if (p != NULL) {
msg_outtrans_attr(p, HL_ATTR(HLF_D)); msg_outtrans(p, HL_ATTR(HLF_D));
XFREE_CLEAR(p); XFREE_CLEAR(p);
} }
if (msg_col > 0) { if (msg_col > 0) {
@ -1149,9 +1142,8 @@ void do_tags(exarg_T *eap)
tagstack[i].cur_match + 1, tagstack[i].cur_match + 1,
tagstack[i].tagname, tagstack[i].tagname,
tagstack[i].fmark.mark.lnum); tagstack[i].fmark.mark.lnum);
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
msg_outtrans_attr(name, tagstack[i].fmark.fnum == curbuf->b_fnum msg_outtrans(name, tagstack[i].fmark.fnum == curbuf->b_fnum ? HL_ATTR(HLF_D) : 0);
? HL_ATTR(HLF_D) : 0);
xfree(name); xfree(name);
} }
} }
@ -3019,7 +3011,7 @@ static int jumpto_tag(const char *lbuf_arg, int forceit, int keep_help)
// Only give a message when really guessed, not when 'ic' // Only give a message when really guessed, not when 'ic'
// is set and match found while ignoring case. // is set and match found while ignoring case.
if (found == 2 || !save_p_ic) { if (found == 2 || !save_p_ic) {
msg(_("E435: Couldn't find tag, just guessing!")); msg(_("E435: Couldn't find tag, just guessing!"), 0);
if (!msg_scrolled && msg_silent == 0) { if (!msg_scrolled && msg_silent == 0) {
ui_flush(); ui_flush();
os_delay(1010L, true); os_delay(1010L, true);

View File

@ -332,7 +332,7 @@ void vim_beep(unsigned val)
// comes from. // comes from.
if (vim_strchr(p_debug, 'e') != NULL) { if (vim_strchr(p_debug, 'e') != NULL) {
msg_source(HL_ATTR(HLF_W)); msg_source(HL_ATTR(HLF_W));
msg_attr(_("Beep!"), HL_ATTR(HLF_W)); msg(_("Beep!"), HL_ATTR(HLF_W));
} }
} }

View File

@ -1883,7 +1883,7 @@ static void u_doit(int startcount, bool quiet, bool do_buf_event)
curbuf->b_u_curhead = curbuf->b_u_oldhead; curbuf->b_u_curhead = curbuf->b_u_oldhead;
beep_flush(); beep_flush();
if (count == startcount - 1) { if (count == startcount - 1) {
msg(_("Already at oldest change")); msg(_("Already at oldest change"), 0);
return; return;
} }
break; break;
@ -1894,7 +1894,7 @@ static void u_doit(int startcount, bool quiet, bool do_buf_event)
if (curbuf->b_u_curhead == NULL || get_undolevel(curbuf) <= 0) { if (curbuf->b_u_curhead == NULL || get_undolevel(curbuf) <= 0) {
beep_flush(); // nothing to redo beep_flush(); // nothing to redo
if (count == startcount - 1) { if (count == startcount - 1) {
msg(_("Already at newest change")); msg(_("Already at newest change"), 0);
return; return;
} }
break; break;
@ -2118,9 +2118,9 @@ void undo_time(long step, bool sec, bool file, bool absolute)
if (closest == closest_start) { if (closest == closest_start) {
if (step < 0) { if (step < 0) {
msg(_("Already at oldest change")); msg(_("Already at oldest change"), 0);
} else { } else {
msg(_("Already at newest change")); msg(_("Already at newest change"), 0);
} }
return; return;
} }
@ -2719,7 +2719,7 @@ void ex_undolist(exarg_T *eap)
} }
if (GA_EMPTY(&ga)) { if (GA_EMPTY(&ga)) {
msg(_("Nothing to undo")); msg(_("Nothing to undo"), 0);
} else { } else {
sort_strings(ga.ga_data, ga.ga_len); sort_strings(ga.ga_data, ga.ga_len);

View File

@ -495,7 +495,7 @@ static void uc_list(char *name, size_t name_len)
msg_putchar(' '); 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; len = strlen(cmd->uc_name) + 4;
do { do {
@ -582,7 +582,7 @@ static void uc_list(char *name, size_t name_len)
} while ((int64_t)len < 25 - over); } while ((int64_t)len < 25 - over);
IObuff[len] = '\0'; IObuff[len] = '\0';
msg_outtrans(IObuff); msg_outtrans(IObuff, 0);
if (cmd->uc_luaref != LUA_NOREF) { if (cmd->uc_luaref != LUA_NOREF) {
char *fn = nlua_funcref_str(cmd->uc_luaref); char *fn = nlua_funcref_str(cmd->uc_luaref);
@ -611,7 +611,7 @@ static void uc_list(char *name, size_t name_len)
} }
if (!found) { if (!found) {
msg(_("No user-defined commands found")); msg(_("No user-defined commands found"), 0);
} }
} }

View File

@ -2691,19 +2691,19 @@ void list_lua_version(void)
Object ret = nlua_exec(cstr_as_string(code), (Array)ARRAY_DICT_INIT, &err); Object ret = nlua_exec(cstr_as_string(code), (Array)ARRAY_DICT_INIT, &err);
assert(!ERROR_SET(&err)); assert(!ERROR_SET(&err));
assert(ret.type == kObjectTypeString); assert(ret.type == kObjectTypeString);
msg(ret.data.string.data); msg(ret.data.string.data, 0);
api_free_object(ret); api_free_object(ret);
} }
void list_version(void) void list_version(void)
{ {
msg(longVersion); msg(longVersion, 0);
msg(version_buildtype); msg(version_buildtype, 0);
list_lua_version(); list_lua_version();
if (p_verbose > 0) { if (p_verbose > 0) {
#ifndef NDEBUG #ifndef NDEBUG
msg(version_cflags); msg(version_cflags, 0);
#endif #endif
version_msg("\n\n"); version_msg("\n\n");

View File

@ -380,7 +380,7 @@ newwindow:
case 'T': case 'T':
CHECK_CMDWIN; CHECK_CMDWIN;
if (one_window(curwin)) { if (one_window(curwin)) {
msg(_(m_onlyone)); msg(_(m_onlyone), 0);
} else { } else {
tabpage_T *oldtab = curtab; tabpage_T *oldtab = curtab;
@ -3972,7 +3972,7 @@ void close_others(int message, int forceit)
if (one_nonfloat() && !lastwin->w_floating) { if (one_nonfloat() && !lastwin->w_floating) {
if (message if (message
&& !autocmd_busy) { && !autocmd_busy) {
msg(_(m_onlyone)); msg(_(m_onlyone), 0);
} }
return; return;
} }