aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2021-10-23 16:04:37 -0400
committerJames McCoy <jamessan@jamessan.com>2021-11-01 06:41:29 -0400
commite6ff154be6da8bd53b604fb6e38686acae75b24f (patch)
tree8424fa376151d9eabfe5a23c54f19ec4e22ba7ea
parentefa924f66b183d9cf2404ce91c4f009c27e0515a (diff)
downloadrneovim-e6ff154be6da8bd53b604fb6e38686acae75b24f.tar.gz
rneovim-e6ff154be6da8bd53b604fb6e38686acae75b24f.tar.bz2
rneovim-e6ff154be6da8bd53b604fb6e38686acae75b24f.zip
vim-patch:8.1.0779: argument for message functions is inconsistent
Problem: Argument for message functions is inconsistent. Solution: Make first argument to msg() "char *". https://github.com/vim/vim/commit/32526b3c1846025f0e655f41efd4e5428da16b6c
-rw-r--r--src/nvim/autocmd.c4
-rw-r--r--src/nvim/buffer.c24
-rw-r--r--src/nvim/change.c2
-rw-r--r--src/nvim/debugger.c8
-rw-r--r--src/nvim/edit.c10
-rw-r--r--src/nvim/eval.c8
-rw-r--r--src/nvim/eval/userfunc.c6
-rw-r--r--src/nvim/ex_cmds.c20
-rw-r--r--src/nvim/ex_cmds2.c2
-rw-r--r--src/nvim/ex_docmd.c304
-rw-r--r--src/nvim/ex_getln.c14
-rw-r--r--src/nvim/fileio.c20
-rw-r--r--src/nvim/getchar.c6
-rw-r--r--src/nvim/hardcopy.c2
-rw-r--r--src/nvim/if_cscope.c26
-rw-r--r--src/nvim/lua/executor.c4
-rw-r--r--src/nvim/mark.c10
-rw-r--r--src/nvim/mbyte.c4
-rw-r--r--src/nvim/memline.c118
-rw-r--r--src/nvim/menu.c10
-rw-r--r--src/nvim/message.c80
-rw-r--r--src/nvim/message.h23
-rw-r--r--src/nvim/misc1.c8
-rw-r--r--src/nvim/normal.c4
-rw-r--r--src/nvim/ops.c16
-rw-r--r--src/nvim/option.c14
-rw-r--r--src/nvim/os/shell.c10
-rw-r--r--src/nvim/quickfix.c8
-rw-r--r--src/nvim/regexp.c4
-rw-r--r--src/nvim/screen.c40
-rw-r--r--src/nvim/search.c24
-rw-r--r--src/nvim/sign.c6
-rw-r--r--src/nvim/spell.c2
-rw-r--r--src/nvim/spellfile.c12
-rw-r--r--src/nvim/syntax.c100
-rw-r--r--src/nvim/tag.c8
-rw-r--r--src/nvim/undo.c10
-rw-r--r--src/nvim/version.c18
-rw-r--r--src/nvim/window.c4
39 files changed, 485 insertions, 508 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c
index b1d22ffc74..2d0c0f3fd5 100644
--- a/src/nvim/autocmd.c
+++ b/src/nvim/autocmd.c
@@ -691,7 +691,7 @@ void do_autocmd(char_u *arg_in, int forceit)
// Print header when showing autocommands.
if (!forceit && *cmd == NUL) {
// Highlight title
- MSG_PUTS_TITLE(_("\n--- Autocommands ---"));
+ msg_puts_title(_("\n--- Autocommands ---"));
}
// Loop over the events.
@@ -996,7 +996,7 @@ int do_doautocmd(char_u *arg, bool do_msg, bool *did_something)
}
if (nothing_done && do_msg) {
- MSG(_("No matching autocommands"));
+ msg(_("No matching autocommands"));
}
if (did_something != NULL) {
*did_something = !nothing_done;
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index db436c0afc..4692f9e722 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -918,7 +918,7 @@ void handle_swap_exists(bufref_T *old_curbuf)
// User selected Recover at ATTENTION prompt.
msg_scroll = true;
ml_recover(false);
- MSG_PUTS("\n"); // don't overwrite the last message
+ msg_puts("\n"); // don't overwrite the last message
cmdline_row = msg_row;
do_modelines(0);
@@ -3039,14 +3039,14 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate)
{
char_u *name;
int n;
- char_u *p;
- char_u *buffer;
+ char *p;
+ char *buffer;
size_t len;
buffer = xmalloc(IOSIZE);
if (fullname > 1) { // 2 CTRL-G: include buffer number
- vim_snprintf((char *)buffer, IOSIZE, "buf %d: ", curbuf->b_fnum);
+ vim_snprintf(buffer, IOSIZE, "buf %d: ", curbuf->b_fnum);
p = buffer + STRLEN(buffer);
} else {
p = buffer;
@@ -3061,12 +3061,12 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate)
} else {
name = curbuf->b_ffname;
}
- home_replace(shorthelp ? curbuf : NULL, name, p,
+ home_replace(shorthelp ? curbuf : NULL, name, (char_u *)p,
(size_t)(IOSIZE - (p - buffer)), true);
}
bool dontwrite = bt_dontwrite(curbuf);
- vim_snprintf_add((char *)buffer, IOSIZE, "\"%s%s%s%s%s%s",
+ vim_snprintf_add(buffer, IOSIZE, "\"%s%s%s%s%s%s",
curbufIsChanged()
? (shortmess(SHM_MOD) ? " [+]" : _(" [Modified]")) : " ",
(curbuf->b_flags & BF_NOTEDITED) && !dontwrite
@@ -3091,27 +3091,27 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate)
(long)curbuf->b_ml.ml_line_count);
}
if (curbuf->b_ml.ml_flags & ML_EMPTY) {
- vim_snprintf_add((char *)buffer, IOSIZE, "%s", _(no_lines_msg));
+ vim_snprintf_add(buffer, IOSIZE, "%s", _(no_lines_msg));
} else if (p_ru) {
// Current line and column are already on the screen -- webb
- vim_snprintf_add((char *)buffer, IOSIZE,
+ vim_snprintf_add(buffer, IOSIZE,
NGETTEXT("%" PRId64 " line --%d%%--",
"%" PRId64 " lines --%d%%--",
(unsigned long)curbuf->b_ml.ml_line_count),
(int64_t)curbuf->b_ml.ml_line_count, n);
} else {
- vim_snprintf_add((char *)buffer, IOSIZE,
+ vim_snprintf_add(buffer, IOSIZE,
_("line %" PRId64 " of %" PRId64 " --%d%%-- col "),
(int64_t)curwin->w_cursor.lnum,
(int64_t)curbuf->b_ml.ml_line_count,
n);
validate_virtcol();
len = STRLEN(buffer);
- col_print(buffer + len, IOSIZE - len,
+ col_print((char_u *)buffer + len, IOSIZE - len,
(int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1);
}
- (void)append_arg_number(curwin, buffer, IOSIZE, !shortmess(SHM_FILE));
+ (void)append_arg_number(curwin, (char_u *)buffer, IOSIZE, !shortmess(SHM_FILE));
if (dont_truncate) {
// Temporarily set msg_scroll to avoid the message being truncated.
@@ -3129,7 +3129,7 @@ void fileinfo(int fullname, int shorthelp, int dont_truncate)
// before redrawing).
// - When the screen was scrolled but there is no wait-return
// prompt.
- set_keep_msg(p, 0);
+ set_keep_msg((char_u *)p, 0);
}
}
diff --git a/src/nvim/change.c b/src/nvim/change.c
index 21a4798bfe..7925c6b1ba 100644
--- a/src/nvim/change.c
+++ b/src/nvim/change.c
@@ -63,7 +63,7 @@ void change_warning(buf_T *buf, int col)
}
msg_source(HL_ATTR(HLF_W));
msg_ext_set_kind("wmsg");
- MSG_PUTS_ATTR(_(w_readonly), HL_ATTR(HLF_W) | MSG_HIST);
+ msg_puts_attr(_(w_readonly), HL_ATTR(HLF_W) | MSG_HIST);
set_vim_var_string(VV_WARNINGMSG, _(w_readonly), -1);
msg_clr_eos();
(void)msg_end();
diff --git a/src/nvim/debugger.c b/src/nvim/debugger.c
index 9657e903d1..3ac128a20f 100644
--- a/src/nvim/debugger.c
+++ b/src/nvim/debugger.c
@@ -88,7 +88,7 @@ void do_debug(char_u *cmd)
debug_mode = true;
if (!debug_did_msg) {
- MSG(_("Entering Debug mode. Type \"cont\" to continue."));
+ msg(_("Entering Debug mode. Type \"cont\" to continue."));
}
if (debug_oldval != NULL) {
smsg(_("Oldval = \"%s\""), debug_oldval);
@@ -101,7 +101,7 @@ void do_debug(char_u *cmd)
debug_newval = NULL;
}
if (sourcing_name != NULL) {
- msg(sourcing_name);
+ msg((char *)sourcing_name);
}
if (sourcing_lnum != 0) {
smsg(_("line %" PRId64 ": %s"), (int64_t)sourcing_lnum, cmd);
@@ -321,7 +321,7 @@ static void do_checkbacktracelevel(void)
{
if (debug_backtrace_level < 0) {
debug_backtrace_level = 0;
- MSG(_("frame is zero"));
+ msg(_("frame is zero"));
} else {
int max = get_maxbacktrace_level();
if (debug_backtrace_level > max) {
@@ -696,7 +696,7 @@ void ex_breaklist(exarg_T *eap)
struct debuggy *bp;
if (GA_EMPTY(&dbg_breakp)) {
- MSG(_("No breakpoints defined"));
+ msg(_("No breakpoints defined"));
} else {
for (int i = 0; i < dbg_breakp.ga_len; i++) {
bp = &BREAKP(i);
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 60f2d0b2ec..9c333f5760 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -3005,7 +3005,7 @@ static void ins_compl_files(int count, char_u **files, int thesaurus, int flags,
msg_hist_off = true; // reset in msg_trunc_attr()
vim_snprintf((char *)IObuff, IOSIZE,
_("Scanning dictionary: %s"), (char *)files[i]);
- (void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R));
+ (void)msg_trunc_attr((char *)IObuff, true, HL_ATTR(HLF_R));
}
if (fp == NULL) {
@@ -4209,7 +4209,7 @@ static int ins_compl_get_exp(pos_T *ini)
: ins_buf->b_sfname == NULL
? ins_buf->b_fname
: ins_buf->b_sfname);
- (void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R));
+ (void)msg_trunc_attr((char *)IObuff, true, HL_ATTR(HLF_R));
} else if (*e_cpt == NUL) {
break;
} else {
@@ -4233,7 +4233,7 @@ static int ins_compl_get_exp(pos_T *ini)
msg_hist_off = true; // reset in msg_trunc_attr()
type = CTRL_X_TAGS;
vim_snprintf((char *)IObuff, IOSIZE, "%s", _("Scanning tags."));
- (void)msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R));
+ (void)msg_trunc_attr((char *)IObuff, true, HL_ATTR(HLF_R));
} else {
type = -1;
}
@@ -4836,7 +4836,7 @@ static int ins_compl_next(int allow_get_expansion, int count, int insert_match,
msg_hist_off = true;
vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead,
s > compl_shown_match->cp_fname ? "<" : "", s);
- msg(IObuff);
+ msg((char *)IObuff);
msg_hist_off = false;
redraw_cmdline = false; // don't overwrite!
}
@@ -7966,7 +7966,7 @@ static bool ins_esc(long *count, int cmdchar, bool nomove)
if (reg_recording != 0 || restart_edit != NUL) {
showmode();
} else if (p_smd) {
- MSG("");
+ msg("");
}
// Exit Insert mode
return true;
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 9570ec0649..b27a11c248 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -9927,7 +9927,7 @@ void ex_execute(exarg_T *eap)
if (eap->cmdidx == CMD_echomsg) {
msg_ext_set_kind("echomsg");
- MSG_ATTR(ga.ga_data, echo_attr);
+ msg_attr(ga.ga_data, echo_attr);
ui_flush();
} else if (eap->cmdidx == CMD_echoerr) {
// We don't want to abort following commands, restore did_emsg.
@@ -10433,10 +10433,10 @@ void option_last_set_msg(LastSet last_set)
bool should_free;
char_u *p = get_scriptname(last_set, &should_free);
verbose_enter();
- MSG_PUTS(_("\n\tLast set from "));
- MSG_PUTS(p);
+ msg_puts(_("\n\tLast set from "));
+ msg_puts((char *)p);
if (last_set.script_ctx.sc_lnum > 0) {
- MSG_PUTS(_(line_msg));
+ msg_puts(_(line_msg));
msg_outnum((long)last_set.script_ctx.sc_lnum);
}
if (should_free) {
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index c8a8e074b8..6fe75e5e1f 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -1635,11 +1635,11 @@ static void list_func_head(ufunc_T *fp, int indent, bool force)
{
msg_start();
if (indent) {
- MSG_PUTS(" ");
+ msg_puts(" ");
}
- MSG_PUTS(force ? "function! " : "function ");
+ msg_puts(force ? "function! " : "function ");
if (fp->uf_name[0] == K_SPECIAL) {
- MSG_PUTS_ATTR("<SNR>", HL_ATTR(HLF_8));
+ msg_puts_attr("<SNR>", HL_ATTR(HLF_8));
msg_puts((const char *)fp->uf_name + 3);
} else {
msg_puts((const char *)fp->uf_name);
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 1a81d0a206..1bd9411fa5 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -120,7 +120,7 @@ void do_ascii(const exarg_T *const eap)
int cc[MAX_MCO];
int c = utfc_ptr2char(get_cursor_pos_ptr(), cc);
if (c == NUL) {
- MSG("NUL");
+ msg("NUL");
return;
}
@@ -222,7 +222,7 @@ void do_ascii(const exarg_T *const eap)
xstrlcpy((char *)IObuff + iobuff_len, " ...", sizeof(IObuff) - iobuff_len);
}
- msg(IObuff);
+ msg((char *)IObuff);
}
/*
@@ -1438,7 +1438,7 @@ static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd,
if (do_in) {
vim_snprintf(msg_buf, sizeof(msg_buf),
_("%" PRId64 " lines filtered"), (int64_t)linecount);
- if (msg((char_u *)msg_buf) && !msg_scroll) {
+ if (msg(msg_buf) && !msg_scroll) {
// save message to display it after redraw
set_keep_msg((char_u *)msg_buf, 0);
}
@@ -1497,7 +1497,7 @@ void do_shell(char_u *cmd, int flags)
&& msg_silent == 0) {
FOR_ALL_BUFFERS(buf) {
if (bufIsChanged(buf)) {
- MSG_PUTS(_("[No write since last change]\n"));
+ msg_puts(_("[No write since last change]\n"));
break;
}
}
@@ -4366,7 +4366,7 @@ skip:
}
}
if (!preview && !do_sub_msg(subflags.do_count) && subflags.do_ask) {
- MSG("");
+ msg("");
}
} else {
global_need_beginline = true;
@@ -4380,7 +4380,7 @@ skip:
emsg(_(e_interr));
} else if (got_match) {
// did find something but nothing substituted
- MSG("");
+ msg("");
} else if (subflags.do_error) {
// nothing found
semsg(_(e_patnotf2), get_search_pat());
@@ -4466,7 +4466,7 @@ bool do_sub_msg(bool count_only)
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
NGETTEXT(msg_single, msg_plural, sub_nlines),
(int64_t)sub_nsubs, (int64_t)sub_nlines);
- if (msg((char_u *)msg_buf)) {
+ if (msg(msg_buf)) {
// save message to display it after redraw
set_keep_msg((char_u *)msg_buf, 0);
}
@@ -4598,7 +4598,7 @@ void ex_global(exarg_T *eap)
// pass 2: execute the command for each line that has been marked
if (got_int) {
- MSG(_(e_interr));
+ msg(_(e_interr));
} else if (ndone == 0) {
if (type == 'v') {
smsg(_("Pattern found in every line: %s"), pat);
@@ -6125,7 +6125,7 @@ void ex_oldfiles(exarg_T *eap)
long nr = 0;
if (l == NULL) {
- msg((char_u *)_("No old files"));
+ msg(_("No old files"));
} else {
msg_start();
msg_scroll = true;
@@ -6137,7 +6137,7 @@ void ex_oldfiles(exarg_T *eap)
const char *fname = tv_get_string(TV_LIST_ITEM_TV(li));
if (!message_filtered((char_u *)fname)) {
msg_outnum(nr);
- MSG_PUTS(": ");
+ msg_puts(": ");
msg_outtrans((char_u *)tv_get_string(TV_LIST_ITEM_TV(li)));
msg_clr_eos();
msg_putchar('\n');
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 8cb4a3924c..f1d0cbc8bd 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -809,7 +809,7 @@ int buf_write_all(buf_T *buf, int forceit)
false, forceit, true, false));
if (curbuf != old_curbuf) {
msg_source(HL_ATTR(HLF_W));
- MSG(_("Warning: Entered other buffer unexpectedly (check autocommands)"));
+ msg(_("Warning: Entered other buffer unexpectedly (check autocommands)"));
}
return retval;
}
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index b0d44651fc..503af2d681 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -207,7 +207,7 @@ void do_exmode(void)
RedrawingDisabled++; // don't redisplay the window
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."));
while (exmode_active) {
// Check for a ":normal" command and no more characters left.
if (ex_normal_busy > 0 && typebuf.tb_len == 0) {
@@ -5340,7 +5340,7 @@ static void uc_list(char_u *name, size_t name_len)
// Put out the title first time
if (!found) {
- MSG_PUTS_TITLE(_("\n Name Args Address "
+ msg_puts_title(_("\n Name Args Address "
"Complete Definition"));
}
found = true;
@@ -5475,7 +5475,7 @@ static void uc_list(char_u *name, size_t name_len)
}
if (!found) {
- MSG(_("No user-defined commands found"));
+ msg(_("No user-defined commands found"));
}
}
@@ -6432,10 +6432,10 @@ static void ex_colorscheme(exarg_T *eap)
xfree(expr);
if (p != NULL) {
- MSG(p);
+ msg((char *)p);
xfree(p);
} else {
- MSG("default");
+ msg("default");
}
} else if (load_colors(eap->arg) == FAIL) {
semsg(_("E185: Cannot find color scheme '%s'"), eap->arg);
@@ -6445,7 +6445,7 @@ static void ex_colorscheme(exarg_T *eap)
static void ex_highlight(exarg_T *eap)
{
if (*eap->arg == NUL && eap->cmd[2] == '!') {
- MSG(_("Greetings, Vim user!"));
+ msg(_("Greetings, Vim user!"));
}
do_highlight((const char *)eap->arg, eap->forceit, false);
}
@@ -6707,7 +6707,7 @@ static void ex_tabonly(exarg_T *eap)
if (cmdwin_type != 0) {
cmdwin_result = K_IGNORE;
} else if (first_tabpage->tp_next == NULL) {
- MSG(_("Already only one tab page"));
+ msg(_("Already only one tab page"));
} else {
int tab_number = get_tabpage_arg(eap);
if (eap->errmsg == NULL) {
@@ -7557,9 +7557,9 @@ static void ex_nogui(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) {
- MSG(_("No swap file"));
+ msg(_("No swap file"));
} else {
- msg(curbuf->b_ml.ml_mfp->mf_fname);
+ msg((char *)curbuf->b_ml.ml_mfp->mf_fname);
}
}
@@ -7877,7 +7877,7 @@ static void ex_pwd(exarg_T *eap)
}
smsg("[%s] %s", context, (char *)NameBuff);
} else {
- msg(NameBuff);
+ msg((char *)NameBuff);
}
} else {
emsg(_("E187: Unknown"));
@@ -9864,287 +9864,287 @@ void verify_command(char_u *cmd)
if (strcmp("smile", (char *)cmd)) {
return; // acceptable non-existing command
}
- MSG(" #xxn` #xnxx` ,+x@##@Mz;` .xxx"
+ msg(" #xxn` #xnxx` ,+x@##@Mz;` .xxx"
"xxxxxxnz+, znnnnnnnnnnnnnnnn.");
- MSG(" n###z x####` :x##########W+` ,###"
+ msg(" n###z x####` :x##########W+` ,###"
"##########M; W################.");
- MSG(" n####; x####` `z##############W: ,###"
+ msg(" n####; x####` `z##############W: ,###"
"############# W################.");
- MSG(" n####W. x####` ,W#################+ ,###"
+ msg(" n####W. x####` ,W#################+ ,###"
"############## W################.");
- MSG(" n#####n x####` @################### ,###"
+ msg(" n#####n x####` @################### ,###"
"##############i W################.");
- MSG(" n######i x####` .#########@W@########* ,###"
+ msg(" n######i x####` .#########@W@########* ,###"
"##############W`W################.");
- MSG(" n######@. x####` x######W*. `;n#######: ,###"
+ msg(" n######@. x####` x######W*. `;n#######: ,###"
"#x,,,,:*M######iW###@:,,,,,,,,,,,`");
- MSG(" n#######n x####` *######+` :M#####M ,###"
+ msg(" n#######n x####` *######+` :M#####M ,###"
"#n `x#####xW###@`");
- MSG(" n########* x####``@####@; `x#####i ,###"
+ msg(" n########* x####``@####@; `x#####i ,###"
"#n ,#####@W###@`");
- MSG(" n########@ x####`*#####i `M####M ,###"
+ msg(" n########@ x####`*#####i `M####M ,###"
"#n x#########@`");
- MSG(" n######### x####`M####z :#####:,###"
+ msg(" n######### x####`M####z :#####:,###"
"#n z#########@`");
- MSG(" n#########* x####,#####. n####+,###"
+ msg(" n#########* x####,#####. n####+,###"
"#n n#########@`");
- MSG(" n####@####@, x####i####x ;####x,###"
+ msg(" n####@####@, x####i####x ;####x,###"
"#n `W#####@####+++++++++++i");
- MSG(" n####*#####M` x#########* `####@,###"
+ msg(" n####*#####M` x#########* `####@,###"
"#n i#####MW###############W");
- MSG(" n####.######+ x####z####; W####,###"
+ msg(" n####.######+ x####z####; W####,###"
"#n i@######W###############W");
- MSG(" n####.`W#####: x####n####: M####:###"
+ msg(" n####.`W#####: x####n####: M####:###"
"#@nnnnnW#######,W###############W");
- MSG(" n####. :#####M`x####z####; W####,###"
+ msg(" n####. :#####M`x####z####; W####,###"
"##############z W###############W");
- MSG(" n####. #######x#########* `####W,###"
+ msg(" n####. #######x#########* `####W,###"
"#############W` W###############W");
- MSG(" n####. `M#####W####i####x ;####x,###"
+ msg(" n####. `M#####W####i####x ;####x,###"
"############W, W####+**********i");
- MSG(" n####. ,##########,#####. n####+,###"
+ msg(" n####. ,##########,#####. n####+,###"
"###########n. W###@`");
- MSG(" n####. ##########`M####z :#####:,###"
+ msg(" n####. ##########`M####z :#####:,###"
"########Wz: W###@`");
- MSG(" n####. x#########`*#####i `M####M ,###"
+ msg(" n####. x#########`*#####i `M####M ,###"
"#x.....` W###@`");
- MSG(" n####. ,@########``@####@; `x#####i ,###"
+ msg(" n####. ,@########``@####@; `x#####i ,###"
"#n W###@`");
- MSG(" n####. *########` *#####@+` ,M#####M ,###"
+ msg(" n####. *########` *#####@+` ,M#####M ,###"
"#n W###@`");
- MSG(" n####. x#######` x######W*. `;n######@: ,###"
+ msg(" n####. x#######` x######W*. `;n######@: ,###"
"#n W###@,,,,,,,,,,,,`");
- MSG(" n####. .@######` .#########@W@########* ,###"
+ msg(" n####. .@######` .#########@W@########* ,###"
"#n W################,");
- MSG(" n####. i######` @################### ,###"
+ msg(" n####. i######` @################### ,###"
"#n W################,");
- MSG(" n####. n#####` ,W#################+ ,###"
+ msg(" n####. n#####` ,W#################+ ,###"
"#n W################,");
- MSG(" n####. .@####` .n##############W; ,###"
+ msg(" n####. .@####` .n##############W; ,###"
"#n W################,");
- MSG(" n####. i####` :x##########W+` ,###"
+ msg(" n####. i####` :x##########W+` ,###"
"#n W################,");
- MSG(" +nnnn` +nnn` ,+x@##@Mz;` .nnn"
+ msg(" +nnnn` +nnn` ,+x@##@Mz;` .nnn"
"n+ zxxxxxxxxxxxxxxxx.");
- MSG(" ");
- MSG(" "
+ msg(" ");
+ msg(" "
" ,+M@#Mi");
- MSG(" "
+ msg(" "
" .z########");
- MSG(" "
+ msg(" "
" i@#########i");
- MSG(" "
+ msg(" "
" `############W`");
- MSG(" "
+ msg(" "
" `n#############i");
- MSG(" "
+ msg(" "
" `n##############n");
- MSG(" `` "
+ msg(" `` "
" z###############@`");
- MSG(" `W@z, "
+ msg(" `W@z, "
" ##################,");
- MSG(" *#####` "
+ msg(" *#####` "
" i############@x@###i");
- MSG(" ######M. "
+ msg(" ######M. "
" :#############n`,W##+");
- MSG(" +######@: "
+ msg(" +######@: "
" .W#########M@##+ *##z");
- MSG(" :#######@: "
+ msg(" :#######@: "
" `x########@#x###* ,##n");
- MSG(" `@#######@; "
+ msg(" `@#######@; "
" z#########M*@nW#i .##x");
- MSG(" z########@i "
+ msg(" z########@i "
" *###########WM#@#, `##x");
- MSG(" i##########+ "
+ msg(" i##########+ "
" ;###########*n###@ `##x");
- MSG(" `@#MM#######x, "
+ msg(" `@#MM#######x, "
" ,@#########zM,`z##M `@#x");
- MSG(" n##M#W#######n. "
+ msg(" n##M#W#######n. "
" `.:i*+#zzzz##+i:.` ,W#########Wii,`n@#@` n@##n");
- MSG(" ;###@#x#######n `,i"
+ msg(" ;###@#x#######n `,i"
"#nW@#####@@WWW@@####@Mzi. ,W##########@z.. ;zM#+i####z");
- MSG(" x####nz######## .;#x@##"
+ msg(" x####nz######## .;#x@##"
"@Wn#*;,.` ``,:*#x@##M+, ;@########xz@WM+#` `n@#######");
- MSG(" ,@####M########xi#@##@Mzi,"
+ msg(" ,@####M########xi#@##@Mzi,"
"` .+x###Mi:n##########Mz```.:i *@######*");
- MSG(" *#####W#########ix+:` "
+ msg(" *#####W#########ix+:` "
" :n#############z: `*.`M######i");
- MSG(" i#W##nW@+@##@#M@; "
+ msg(" i#W##nW@+@##@#M@; "
" ;W@@##########W, i`x@#####,");
- MSG(" `@@n@Wn#@iMW*#*: "
+ msg(" `@@n@Wn#@iMW*#*: "
" `iz#z@######x. M######`");
- MSG(" z##zM###x`*, .` "
+ msg(" z##zM###x`*, .` "
" `iW#####W;:` +#####M");
- MSG(" ,###nn##n` "
+ msg(" ,###nn##n` "
" ,#####x;` ,;@######");
- MSG(" x###xz#. "
+ msg(" x###xz#. "
" in###+ `:######@.");
- MSG(" ;####n+ "
+ msg(" ;####n+ "
" `Mnx##xi` , zM#######");
- MSG(" `W####+ "
+ msg(" `W####+ "
"i. `.+x###@#. :n,z######:");
- MSG(" z####@` ;"
+ msg(" z####@` ;"
"#: .ii@###@;.*M*z####@`");
- MSG(" i####M ` `i@"
+ msg(" i####M ` `i@"
"#, :: +#n##@+@##W####n");
- MSG(" :####x ,i. ##xzM###"
+ msg(" :####x ,i. ##xzM###"
"@` i. .@@, .z####x#######*");
- MSG(" ,###W; i##Wz########"
+ msg(" ,###W; i##Wz########"
"# :## z##n ,@########x###:");
- MSG(" n##n `W###########M"
+ msg(" n##n `W###########M"
"`;n, i#x ,###@i *W########W#@`");
- MSG(" .@##+ `x###########@."
+ msg(" .@##+ `x###########@."
" z#+ .M#W``x#####n` `;#######@z#x");
- MSG(" n###z :W############@ "
+ msg(" n###z :W############@ "
" z#* @##xM#######@n; `########nW+");
- MSG(" ;####nW##############W "
+ msg(" ;####nW##############W "
":@#* `@#############* :########z@i`");
- MSG(" M##################### "
+ msg(" M##################### "
"M##: @#############@: *W########M#");
- MSG(" ;#####################i."
+ msg(" ;#####################i."
"##x` W#############W, :n########zx");
- MSG(" x####################@.`"
+ msg(" x####################@.`"
"x; @#############z. .@########W#");
- MSG(" ,######################` "
+ msg(" ,######################` "
" W###############x*,` W######zM#i");
- MSG(" #######################: "
+ msg(" #######################: "
" z##################@x+*#zzi `@#########.");
- MSG(" W########W#z#M#########; "
+ msg(" W########W#z#M#########; "
" *##########################z :@#######@`");
- MSG(" `@#######x`;#z ,x#######; "
+ msg(" `@#######x`;#z ,x#######; "
" z###########M###xnM@########* :M######@");
- MSG(" i########, x#@` z######; "
+ msg(" i########, x#@` z######; "
" *##########i *#@` `+########+` n######.");
- MSG(" n#######@` M##, `W#####. "
+ msg(" n#######@` M##, `W#####. "
" *#########z ###; z########M: :W####n");
- MSG(" M#######M n##. x####x "
+ msg(" M#######M n##. x####x "
" `x########: z##+ M#########@; .n###+");
- MSG(" W#######@` :#W `@####: "
+ msg(" W#######@` :#W `@####: "
" `@######W i### ;###########@. n##n");
- MSG(" W########z` ,, .x####z "
+ msg(" W########z` ,, .x####z "
" @######@` `W#; `W############* *###;");
- MSG(" `@#########Mi,:*n@####W` "
+ msg(" `@#########Mi,:*n@####W` "
" W#######* .. `n#############i i###x");
- MSG(" .#####################z "
+ msg(" .#####################z "
" `@#######@*` .x############n:` ;####.");
- MSG(" :####################x`,,` "
+ msg(" :####################x`,,` "
" `W#########@x#+#@#############i ,####:");
- MSG(" ;###################x#@###x"
+ msg(" ;###################x#@###x"
"i` *############################: `####i");
- MSG(" i##################+#######"
+ msg(" i##################+#######"
"#M, x##########################@` W###i");
- MSG(" *################@; @######"
+ msg(" *################@; @######"
"##@, .W#########################@ x###:");
- MSG(" .+M#############z. M######"
+ msg(" .+M#############z. M######"
"###x ,W########################@` ####.");
- MSG(" *M*;z@########x: :W#####"
+ msg(" *M*;z@########x: :W#####"
"##i .M########################i i###:");
- MSG(" *##@z;#@####x: :z###"
+ msg(" *##@z;#@####x: :z###"
"@i `########################x .###;");
- MSG(" *#####n;#@## ;##"
+ msg(" *#####n;#@## ;##"
"* ,x#####################@` W##*");
- MSG(" *#######n;* :M##"
+ msg(" *#######n;* :M##"
"W*, *W####################` n##z");
- MSG(" i########@. ,*n####"
+ msg(" i########@. ,*n####"
"###M*` `###################M *##M");
- MSG(" i########n `z#####@@"
+ msg(" i########n `z#####@@"
"#####Wi ,M################; ,##@`");
- MSG(" ;WMWW@###* .x##@ni.``"
+ msg(" ;WMWW@###* .x##@ni.``"
".:+zW##z` `n##############z @##,");
- MSG(" .*++*i;;;. .M#@+` "
+ msg(" .*++*i;;;. .M#@+` "
" .##n `x############x` n##i");
- MSG(" :########* x#W, "
+ msg(" :########* x#W, "
" *#+ *###########M` +##+");
- MSG(" ,######### :#@: "
+ msg(" ,######### :#@: "
" ##: #nzzzzzzzzzz. :##x");
- MSG(" .#####Wz+` ##+ "
+ msg(" .#####Wz+` ##+ "
" `MM` .znnnnnnnnn. `@#@`");
- MSG(" `@@ni;*nMz` @W` "
+ msg(" `@@ni;*nMz` @W` "
" :#+ .x#######n x##,");
- MSG(" i;z@#####, .#* "
+ msg(" i;z@#####, .#* "
" z#: ;;;*zW##; ###i");
- MSG(" z########: :#; "
+ msg(" z########: :#; "
" `Wx +###Wni;n. ;##z");
- MSG(" n########W: .#* "
+ msg(" n########W: .#* "
" ,#, ;#######@+ `@#M");
- MSG(" .###########n;.MM "
+ msg(" .###########n;.MM "
" n* ;iM#######* x#@`");
- MSG(" :#############@;; "
+ msg(" :#############@;; "
" .n` ,#W*iW#####W` +##,");
- MSG(" ,##############. "
+ msg(" ,##############. "
" ix. `x###M;####### ,##i");
- MSG(" .#############@` "
+ msg(" .#############@` "
" x@n**#W######z;M###@. W##");
- MSG(" .##############W: "
+ msg(" .##############W: "
" .x############@*;zW#; z#x");
- MSG(" ,###############@; "
+ msg(" ,###############@; "
" `##############@n*;. i#@");
- MSG(" ,#################i "
+ msg(" ,#################i "
" :n##############W` .##,");
- MSG(" ,###################` "
+ msg(" ,###################` "
" .+W##########W, `##i");
- MSG(" :###################@zi,` "
+ msg(" :###################@zi,` "
" ;zM@@@WMn*` @#z");
- MSG(" :#######################@x+"
+ msg(" :#######################@x+"
"*i;;:i#M, `` M#W");
- MSG(" ;##########################"
+ msg(" ;##########################"
"######@x. n##,");
- MSG(" i#####################@W@@@"
+ msg(" i#####################@W@@@"
"@Wxz*:` *##+");
- MSG(" *######################+```"
+ msg(" *######################+```"
" :##M");
- MSG(" ########################M; "
+ msg(" ########################M; "
" `@##,");
- MSG(" z#########################x"
+ msg(" z#########################x"
", z###");
- MSG(" n##########################"
+ msg(" n##########################"
"#n: ;##W`");
- MSG(" x##########################"
+ msg(" x##########################"
"###Mz#++##* `W##i");
- MSG(" M##########################"
+ msg(" M##########################"
"##########@` ###x");
- MSG(" W##########################"
+ msg(" W##########################"
"###########` .###,");
- MSG(" @##########################"
+ msg(" @##########################"
"##########M n##z");
- MSG(" @##################z*i@WMMM"
+ msg(" @##################z*i@WMMM"
"x#x@#####,. :##@.");
- MSG(" `#####################@xi` "
+ msg(" `#####################@xi` "
" `::,* x##+");
- MSG(" .#####################@#M. "
+ msg(" .#####################@#M. "
" ;##@`");
- MSG(" ,#####################:. "
+ msg(" ,#####################:. "
" M##i");
- MSG(" ;###################ni` "
+ msg(" ;###################ni` "
" i##M");
- MSG(" *#################W#` "
+ msg(" *#################W#` "
" `W##,");
- MSG(" z#################@Wx+. "
+ msg(" z#################@Wx+. "
" +###");
- MSG(" x######################z. "
+ msg(" x######################z. "
" .@#@`");
- MSG(" `@#######################@; "
+ msg(" `@#######################@; "
" z##;");
- MSG(" :##########################: "
+ msg(" :##########################: "
" :##z");
- MSG(" +#########################W# "
+ msg(" +#########################W# "
" M#W");
- MSG(" W################@n+*i;:,` "
+ msg(" W################@n+*i;:,` "
" +##,");
- MSG(" :##################WMxz+, "
+ msg(" :##################WMxz+, "
" ,##i");
- MSG(" n#######################W.., "
+ msg(" n#######################W.., "
" W##");
- MSG(" +#########################WW@+. .:. "
+ msg(" +#########################WW@+. .:. "
" z#x");
- MSG(" `@#############################@@###: "
+ msg(" `@#############################@@###: "
" *#W");
- MSG(" #################################Wz: "
+ msg(" #################################Wz: "
" :#@");
- MSG(",@###############################i "
+ msg(",@###############################i "
" .##");
- MSG("n@@@@@@@#########################+ "
+ msg("n@@@@@@@#########################+ "
" `##");
- MSG("` `.:.`.,:iii;;;;;;;;iii;;;:` `.`` "
+ msg("` `.:.`.,:iii;;;;;;;;iii;;;:` `.`` "
" `nW");
}
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 9c976d0cd2..165bfd1677 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -2372,7 +2372,7 @@ static void abandon_cmdline(void)
if (msg_scrolled == 0) {
compute_cmdrow();
}
- MSG("");
+ msg("");
redraw_cmdline = true;
}
@@ -3764,7 +3764,7 @@ static int nextwild(expand_T *xp, int type, int options, int escape)
}
if (!(ui_has(kUICmdline) || ui_has(kUIWildmenu))) {
- MSG_PUTS("..."); // show that we are busy
+ msg_puts("..."); // show that we are busy
ui_flush();
}
@@ -4367,10 +4367,10 @@ static int showmatches(expand_T *xp, int wildmenu)
attr = HL_ATTR(HLF_D); // find out highlighting for directories
if (xp->xp_context == EXPAND_TAGS_LISTFILES) {
- MSG_PUTS_ATTR(_("tagname"), HL_ATTR(HLF_T));
+ msg_puts_attr(_("tagname"), HL_ATTR(HLF_T));
msg_clr_eos();
msg_advance(maxlen - 3);
- MSG_PUTS_ATTR(_(" kind file\n"), HL_ATTR(HLF_T));
+ msg_puts_attr(_(" kind file\n"), HL_ATTR(HLF_T));
}
// list the files line by line
@@ -4383,7 +4383,7 @@ static int showmatches(expand_T *xp, int wildmenu)
msg_advance(maxlen + 1);
msg_puts((const char *)p);
msg_advance(maxlen + 3);
- msg_puts_long_attr(p + 2, HL_ATTR(HLF_D));
+ msg_outtrans_long_attr(p + 2, HL_ATTR(HLF_D));
break;
}
for (j = maxlen - lastlen; --j >= 0; ) {
@@ -6222,7 +6222,7 @@ void ex_history(exarg_T *eap)
char_u *arg = eap->arg;
if (hislen == 0) {
- MSG(_("'history' option is zero"));
+ msg(_("'history' option is zero"));
return;
}
@@ -6256,7 +6256,7 @@ void ex_history(exarg_T *eap)
STRCPY(IObuff, "\n # ");
assert(history_names[histype1] != NULL);
STRCAT(STRCAT(IObuff, history_names[histype1]), " history");
- MSG_PUTS_TITLE(IObuff);
+ msg_puts_title((char *)IObuff);
idx = hisidx[histype1];
hist = history[histype1];
j = hisidx1;
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index d499815ea6..cf4037308b 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -1847,7 +1847,7 @@ failed:
msg_scrolled_ign = true;
if (!read_stdin && !read_buffer) {
- p = msg_trunc_attr(IObuff, FALSE, 0);
+ p = (char_u *)msg_trunc_attr((char *)IObuff, FALSE, 0);
}
if (read_stdin || read_buffer || restart_edit != 0
@@ -2109,27 +2109,27 @@ static char_u *next_fenc(char_u **pp, bool *alloced)
static char_u *readfile_charconvert(char_u *fname, char_u *fenc, int *fdp)
{
char_u *tmpname;
- char_u *errmsg = NULL;
+ char *errmsg = NULL;
tmpname = vim_tempname();
if (tmpname == NULL) {
- errmsg = (char_u *)_("Can't find temp file for conversion");
+ errmsg = _("Can't find temp file for conversion");
} else {
close(*fdp); // close the input file, ignore errors
*fdp = -1;
if (eval_charconvert((char *)fenc, "utf-8",
(char *)fname, (char *)tmpname) == FAIL) {
- errmsg = (char_u *)_("Conversion with 'charconvert' failed");
+ errmsg = _("Conversion with 'charconvert' failed");
}
if (errmsg == NULL && (*fdp = os_open((char *)tmpname, O_RDONLY, 0)) < 0) {
- errmsg = (char_u *)_("can't read output of 'charconvert'");
+ errmsg = _("can't read output of 'charconvert'");
}
}
if (errmsg != NULL) {
// Don't use emsg(), it breaks mappings, the retry with
// another type of conversion might still work.
- MSG(errmsg);
+ msg(errmsg);
if (tmpname != NULL) {
os_remove((char *)tmpname); // delete converted file
XFREE_CLEAR(tmpname);
@@ -3471,7 +3471,7 @@ restore_backup:
// This may take a while, if we were interrupted let the user
// know we got the message.
if (got_int) {
- MSG(_(e_interr));
+ msg(_(e_interr));
ui_flush();
}
@@ -3536,7 +3536,7 @@ restore_backup:
}
}
- set_keep_msg(msg_trunc_attr(IObuff, FALSE, 0), 0);
+ set_keep_msg((char_u *)msg_trunc_attr((char *)IObuff, FALSE, 0), 0);
}
/* When written everything correctly: reset 'modified'. Unless not
@@ -3676,9 +3676,9 @@ nofail:
retval = FAIL;
if (end == 0) {
const int attr = HL_ATTR(HLF_E); // Set highlight for error messages.
- MSG_PUTS_ATTR(_("\nWARNING: Original file may be lost or damaged\n"),
+ msg_puts_attr(_("\nWARNING: Original file may be lost or damaged\n"),
attr | MSG_HIST);
- MSG_PUTS_ATTR(_("don't quit the editor until the file is successfully written!"),
+ msg_puts_attr(_("don't quit the editor until the file is successfully written!"),
attr | MSG_HIST);
/* Update the timestamp to avoid an "overwrite changed file"
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index f871d19917..a374406716 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1689,7 +1689,7 @@ void vungetc(int c)
old_mouse_col = mouse_col;
}
-/// Gets a character:
+/// Gets a byte:
/// 1. from the stuffbuffer
/// This is used for abbreviated commands like "D" -> "d$".
/// Also used to redo a command for ".".
@@ -3090,9 +3090,9 @@ int buf_do_map(int maptype, MapArguments *args, int mode, bool is_abbrev, buf_T
if (!has_lhs || !has_rhs) { // print entries
if (!did_it && !did_local) {
if (is_abbrev) {
- MSG(_("No abbreviation found"));
+ msg(_("No abbreviation found"));
} else {
- MSG(_("No mapping found"));
+ msg(_("No mapping found"));
}
}
goto theend; // listing finished
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index 38bd914558..a6cbfa7a72 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -684,7 +684,7 @@ void ex_hardcopy(exarg_T *eap)
bytes_to_print += STRLEN(skipwhite(ml_get(lnum)));
}
if (bytes_to_print == 0) {
- MSG(_("No text to be printed"));
+ msg(_("No text to be printed"));
goto print_fail_no_begin;
}
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 4ed7ddc38a..24a85e9595 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -184,7 +184,7 @@ static void do_cscope_general(exarg_T *eap, int make_split)
if (make_split) {
if (!cmdp->cansplit) {
- (void)MSG_PUTS(_("This cscope command does not support splitting the window.\n"));
+ (void)msg_puts(_("This cscope command does not support splitting the window.\n"));
return;
}
postponed_split = -1;
@@ -1106,7 +1106,7 @@ static int cs_help(exarg_T *eap)
{
cscmd_T *cmdp = cs_cmds;
- (void)MSG_PUTS(_("cscope commands:\n"));
+ (void)msg_puts(_("cscope commands:\n"));
while (cmdp->name != NULL) {
char *help = _(cmdp->help);
int space_cnt = 30 - vim_strsize((char_u *)help);
@@ -1120,7 +1120,7 @@ static int cs_help(exarg_T *eap)
help, space_cnt, " ",
cmdp->usage);
if (strcmp(cmdp->name, "find") == 0) {
- MSG_PUTS(_("\n"
+ msg_puts(_("\n"
" a: Find assignments to this symbol\n"
" c: Find functions calling this function\n"
" d: Find functions called by this function\n"
@@ -1653,16 +1653,16 @@ static void cs_print_tags_priv(char **matches, char **cntxts,
char *buf = xmalloc(newsize);
size_t bufsize = newsize; // Track available bufsize
(void)snprintf(buf, bufsize, cstag_msg, ptag);
- MSG_PUTS_ATTR(buf, HL_ATTR(HLF_T));
+ msg_puts_attr(buf, HL_ATTR(HLF_T));
msg_clr_eos();
// restore matches[0]
*ptag_end = '\t';
// Column headers for match number, line number and filename.
- MSG_PUTS_ATTR(_("\n # line"), HL_ATTR(HLF_T));
+ msg_puts_attr(_("\n # line"), HL_ATTR(HLF_T));
msg_advance(msg_col + 2);
- MSG_PUTS_ATTR(_("filename / context / line\n"), HL_ATTR(HLF_T));
+ msg_puts_attr(_("filename / context / line\n"), HL_ATTR(HLF_T));
for (size_t i = 0; i < num_matches; i++) {
assert(strcnt(matches[i], '\t') >= 2);
@@ -1689,8 +1689,8 @@ static void cs_print_tags_priv(char **matches, char **cntxts,
bufsize = newsize;
}
(void)snprintf(buf, bufsize, csfmt_str, i + 1, lno);
- MSG_PUTS_ATTR(buf, HL_ATTR(HLF_CM));
- MSG_PUTS_LONG_ATTR(cs_pathcomponents(fname), HL_ATTR(HLF_CM));
+ msg_puts_attr(buf, HL_ATTR(HLF_CM));
+ msg_outtrans_long_attr((char_u *)cs_pathcomponents(fname), HL_ATTR(HLF_CM));
// compute the required space for the context
char *context = cntxts[i] ? cntxts[i] : globalcntx;
@@ -1712,11 +1712,11 @@ static void cs_print_tags_priv(char **matches, char **cntxts,
msg_putchar('\n');
}
msg_advance(12);
- MSG_PUTS_LONG(buf);
+ msg_outtrans_long_attr((char_u *)buf, 0);
msg_putchar('\n');
if (extra != NULL) {
msg_advance(13);
- MSG_PUTS_LONG(extra);
+ msg_outtrans_long_attr((char_u *)extra, 0);
}
// restore matches[i]
@@ -1986,7 +1986,7 @@ static int cs_reset(exarg_T *eap)
// connection number in the same line as
// "Added cscope database..."
snprintf(buf, ARRAY_SIZE(buf), " (#%zu)", i);
- MSG_PUTS_ATTR(buf, HL_ATTR(HLF_R));
+ msg_puts_attr(buf, HL_ATTR(HLF_R));
}
}
xfree(dblist[i]);
@@ -2059,9 +2059,9 @@ static char *cs_resolve_file(size_t i, char *name)
static int cs_show(exarg_T *eap)
{
if (cs_cnt_connections() == 0) {
- MSG_PUTS(_("no cscope connections\n"));
+ msg_puts(_("no cscope connections\n"));
} else {
- MSG_PUTS_ATTR(_(" # pid database name prepend path\n"),
+ msg_puts_attr(_(" # pid database name prepend path\n"),
HL_ATTR(HLF_T));
for (size_t i = 0; i < csinfo_size; i++) {
if (csinfo[i].fname == NULL) {
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index f3888c7a90..6120deb77a 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -519,10 +519,10 @@ static void nlua_print_event(void **argv)
}
break;
}
- msg((char_u *)str + start);
+ msg(str + start);
}
if (len && str[len - 1] == NUL) { // Last was newline
- msg((char_u *)"");
+ msg("");
}
xfree(str);
}
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index e351697643..51f4ba635f 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -711,7 +711,7 @@ static void show_one_mark(int c, char_u *arg, pos_T *p, char_u *name_arg, int cu
did_title = false;
} else {
if (arg == NULL) {
- MSG(_("No marks set"));
+ msg(_("No marks set"));
} else {
semsg(_("E283: No marks matching \"%s\""), arg);
}
@@ -839,7 +839,7 @@ void ex_jumps(exarg_T *eap)
cleanup_jumplist(curwin, true);
// Highlight title
- MSG_PUTS_TITLE(_("\n jump line col file/text"));
+ msg_puts_title(_("\n jump line col file/text"));
for (i = 0; i < curwin->w_jumplistlen && !got_int; ++i) {
if (curwin->w_jumplist[i].fmark.mark.lnum != 0) {
name = fm_getname(&curwin->w_jumplist[i].fmark, 16);
@@ -871,7 +871,7 @@ void ex_jumps(exarg_T *eap)
ui_flush();
}
if (curwin->w_jumplistidx == curwin->w_jumplistlen) {
- MSG_PUTS("\n>");
+ msg_puts("\n>");
}
}
@@ -891,7 +891,7 @@ void ex_changes(exarg_T *eap)
char_u *name;
// Highlight title
- MSG_PUTS_TITLE(_("\nchange line col text"));
+ msg_puts_title(_("\nchange line col text"));
for (i = 0; i < curbuf->b_changelistlen && !got_int; ++i) {
if (curbuf->b_changelist[i].mark.lnum != 0) {
@@ -914,7 +914,7 @@ void ex_changes(exarg_T *eap)
ui_flush();
}
if (curwin->w_changelistidx == curbuf->b_changelistlen) {
- MSG_PUTS("\n>");
+ msg_puts("\n>");
}
}
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index da3f38bc94..cc488d486f 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -1586,7 +1586,7 @@ void show_utf8(void)
line = get_cursor_pos_ptr();
len = utfc_ptr2len(line);
if (len == 0) {
- MSG("NUL");
+ msg("NUL");
return;
}
@@ -1609,7 +1609,7 @@ void show_utf8(void)
}
}
- msg(IObuff);
+ msg((char *)IObuff);
}
/// Return offset from "p" to the first byte of the character it points into.
diff --git a/src/nvim/memline.c b/src/nvim/memline.c
index b8f0cde70e..456b1013c1 100644
--- a/src/nvim/memline.c
+++ b/src/nvim/memline.c
@@ -823,7 +823,7 @@ void ml_recover(bool checkext)
// list the names of the swap files
(void)recover_names(fname, TRUE, 0, NULL);
msg_putchar('\n');
- MSG_PUTS(_("Enter number of swap file to use (0 to quit): "));
+ msg_puts(_("Enter number of swap file to use (0 to quit): "));
i = get_number(FALSE, NULL);
if (i < 1 || i > len) {
goto theend;
@@ -883,9 +883,9 @@ void ml_recover(bool checkext)
*/
if ((hp = mf_get(mfp, 0, 1)) == NULL) {
msg_start();
- MSG_PUTS_ATTR(_("Unable to read block 0 from "), attr | MSG_HIST);
+ msg_puts_attr(_("Unable to read block 0 from "), attr | MSG_HIST);
msg_outtrans_attr(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);
msg_end();
goto theend;
@@ -894,9 +894,9 @@ void ml_recover(bool checkext)
if (STRNCMP(b0p->b0_version, "VIM 3.0", 7) == 0) {
msg_start();
msg_outtrans_attr(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_PUTS_ATTR(_("Use Vim version 3.0.\n"), MSG_HIST);
+ msg_puts_attr(_("Use Vim version 3.0.\n"), MSG_HIST);
msg_end();
goto theend;
}
@@ -907,13 +907,13 @@ void ml_recover(bool checkext)
if (b0_magic_wrong(b0p)) {
msg_start();
msg_outtrans_attr(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);
- MSG_PUTS_ATTR(_("The file was created on "), attr | MSG_HIST);
+ msg_puts_attr(_("The file was created on "), attr | MSG_HIST);
// avoid going past the end of a corrupted hostname
b0p->b0_fname[0] = NUL;
- MSG_PUTS_ATTR(b0p->b0_hname, attr | MSG_HIST);
- MSG_PUTS_ATTR(_(",\nor the file has been damaged."), attr | MSG_HIST);
+ msg_puts_attr((char *)b0p->b0_hname, attr | MSG_HIST);
+ msg_puts_attr(_(",\nor the file has been damaged."), attr | MSG_HIST);
msg_end();
goto theend;
}
@@ -929,7 +929,7 @@ void ml_recover(bool checkext)
if (mfp->mf_page_size < previous_page_size) {
msg_start();
msg_outtrans_attr(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);
msg_end();
goto theend;
@@ -1235,20 +1235,20 @@ void ml_recover(bool checkext)
emsg(_("E311: Recovery Interrupted"));
} else if (error) {
++no_wait_return;
- MSG(">>>>>>>>>>>>>");
+ msg(">>>>>>>>>>>>>");
emsg(_( "E312: Errors detected while recovering; look for lines starting with ???"));
--no_wait_return;
- MSG(_("See \":help E312\" for more information."));
- MSG(">>>>>>>>>>>>>");
+ msg(_("See \":help E312\" for more information."));
+ msg(">>>>>>>>>>>>>");
} else {
if (curbuf->b_changed) {
- MSG(_("Recovery completed. You should check if everything is OK."));
- 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(_("Recovery completed. You should check if everything is OK."));
+ 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)"));
} else {
- MSG(_("Recovery completed. Buffer contents equals file contents."));
+ msg(_("Recovery completed. Buffer contents equals file contents."));
}
- MSG_PUTS(_("\nYou may want to delete the .swp file now.\n\n"));
+ msg_puts(_("\nYou may want to delete the .swp file now.\n\n"));
cmdline_row = msg_row;
}
redraw_curbuf_later(NOT_VALID);
@@ -1316,7 +1316,7 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
if (list) {
// use msg() to start the scrolling properly
- msg((char_u *)_("Swap files found:"));
+ msg(_("Swap files found:"));
msg_putchar('\n');
}
@@ -1424,14 +1424,14 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
} else if (list) {
if (dir_name[0] == '.' && dir_name[1] == NUL) {
if (fname == NULL) {
- MSG_PUTS(_(" In current directory:\n"));
+ msg_puts(_(" In current directory:\n"));
} else {
- MSG_PUTS(_(" Using specified name:\n"));
+ msg_puts(_(" Using specified name:\n"));
}
} else {
- MSG_PUTS(_(" In directory "));
+ msg_puts(_(" In directory "));
msg_home_replace(dir_name);
- MSG_PUTS(":\n");
+ msg_puts(":\n");
}
if (num_files) {
@@ -1444,7 +1444,7 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
(void)swapfile_info(files[i]);
}
} else {
- MSG_PUTS(_(" -- none --\n"));
+ msg_puts(_(" -- none --\n"));
}
ui_flush();
} else {
@@ -1542,15 +1542,15 @@ static time_t swapfile_info(char_u *fname)
#ifdef UNIX
// print name of owner of the file
if (os_get_uname(file_info.stat.st_uid, uname, B0_UNAME_SIZE) == OK) {
- MSG_PUTS(_(" owned by: "));
+ msg_puts(_(" owned by: "));
msg_outtrans((char_u *)uname);
- MSG_PUTS(_(" dated: "));
+ msg_puts(_(" dated: "));
} else
#endif
- MSG_PUTS(_(" dated: "));
+ msg_puts(_(" dated: "));
x = file_info.stat.st_mtim.tv_sec;
char ctime_buf[50];
- MSG_PUTS(os_ctime_r(&x, ctime_buf, sizeof(ctime_buf)));
+ msg_puts(os_ctime_r(&x, ctime_buf, sizeof(ctime_buf)));
}
/*
@@ -1560,55 +1560,55 @@ static time_t swapfile_info(char_u *fname)
if (fd >= 0) {
if (read_eintr(fd, &b0, sizeof(b0)) == sizeof(b0)) {
if (STRNCMP(b0.b0_version, "VIM 3.0", 7) == 0) {
- MSG_PUTS(_(" [from Vim version 3.0]"));
+ msg_puts(_(" [from Vim version 3.0]"));
} else if (ml_check_b0_id(&b0) == FAIL) {
- MSG_PUTS(_(" [does not look like a Vim swap file]"));
+ msg_puts(_(" [does not look like a Vim swap file]"));
} else if (!ml_check_b0_strings(&b0)) {
- MSG_PUTS(_(" [garbled strings (not nul terminated)]"));
+ msg_puts(_(" [garbled strings (not nul terminated)]"));
} else {
- MSG_PUTS(_(" file name: "));
+ msg_puts(_(" file name: "));
if (b0.b0_fname[0] == NUL) {
- MSG_PUTS(_("[No Name]"));
+ msg_puts(_("[No Name]"));
} else {
msg_outtrans(b0.b0_fname);
}
- MSG_PUTS(_("\n modified: "));
- MSG_PUTS(b0.b0_dirty ? _("YES") : _("no"));
+ msg_puts(_("\n modified: "));
+ msg_puts(b0.b0_dirty ? _("YES") : _("no"));
if (*(b0.b0_uname) != NUL) {
- MSG_PUTS(_("\n user name: "));
+ msg_puts(_("\n user name: "));
msg_outtrans(b0.b0_uname);
}
if (*(b0.b0_hname) != NUL) {
if (*(b0.b0_uname) != NUL) {
- MSG_PUTS(_(" host name: "));
+ msg_puts(_(" host name: "));
} else {
- MSG_PUTS(_("\n host name: "));
+ msg_puts(_("\n host name: "));
}
msg_outtrans(b0.b0_hname);
}
if (char_to_long(b0.b0_pid) != 0L) {
- MSG_PUTS(_("\n process ID: "));
+ msg_puts(_("\n process ID: "));
msg_outnum(char_to_long(b0.b0_pid));
if (os_proc_running((int)char_to_long(b0.b0_pid))) {
- MSG_PUTS(_(" (STILL RUNNING)"));
+ msg_puts(_(" (STILL RUNNING)"));
process_still_running = true;
}
}
if (b0_magic_wrong(&b0)) {
- MSG_PUTS(_("\n [not usable on this computer]"));
+ msg_puts(_("\n [not usable on this computer]"));
}
}
} else {
- MSG_PUTS(_(" [cannot be read]"));
+ msg_puts(_(" [cannot be read]"));
}
close(fd);
} else {
- MSG_PUTS(_(" [cannot be opened]"));
+ msg_puts(_(" [cannot be opened]"));
}
msg_putchar('\n');
@@ -1807,7 +1807,7 @@ theend:
if (message) {
if (status == OK) {
- MSG(_("File preserved"));
+ msg(_("File preserved"));
} else {
emsg(_("E314: Preserve failed"));
}
@@ -3357,38 +3357,38 @@ static void attention_message(buf_T *buf, char_u *fname)
++no_wait_return;
(void)emsg(_("E325: ATTENTION"));
- MSG_PUTS(_("\nFound a swap file by the name \""));
+ msg_puts(_("\nFound a swap file by the name \""));
msg_home_replace(fname);
- MSG_PUTS("\"\n");
+ msg_puts("\"\n");
const time_t swap_mtime = swapfile_info(fname);
- MSG_PUTS(_("While opening file \""));
+ msg_puts(_("While opening file \""));
msg_outtrans(buf->b_fname);
- MSG_PUTS("\"\n");
+ msg_puts("\"\n");
FileInfo file_info;
if (!os_fileinfo((char *)buf->b_fname, &file_info)) {
- MSG_PUTS(_(" CANNOT BE FOUND"));
+ msg_puts(_(" CANNOT BE FOUND"));
} else {
- MSG_PUTS(_(" dated: "));
+ msg_puts(_(" dated: "));
time_t x = file_info.stat.st_mtim.tv_sec;
char ctime_buf[50];
- MSG_PUTS(os_ctime_r(&x, ctime_buf, sizeof(ctime_buf)));
+ msg_puts(os_ctime_r(&x, ctime_buf, sizeof(ctime_buf)));
if (swap_mtime != 0 && x > swap_mtime) {
- MSG_PUTS(_(" NEWER than swap file!\n"));
+ msg_puts(_(" NEWER than swap file!\n"));
}
}
// Some of these messages are long to allow translation to
// other languages.
- MSG_PUTS(_("\n(1) Another program may be editing the same file. If this is"
+ msg_puts(_("\n(1) Another program may be editing the same file. If this is"
" the case,\n be careful not to end up with two different"
" instances of the same\n file when making changes."
" Quit, or continue with caution.\n"));
- MSG_PUTS(_("(2) An edit session for this file crashed.\n"));
- MSG_PUTS(_(" If this is the case, use \":recover\" or \"vim -r "));
+ msg_puts(_("(2) An edit session for this file crashed.\n"));
+ msg_puts(_(" If this is the case, use \":recover\" or \"vim -r "));
msg_outtrans(buf->b_fname);
- MSG_PUTS(_("\"\n to recover the changes (see \":help recovery\").\n"));
- MSG_PUTS(_(" If you did this already, delete the swap file \""));
+ msg_puts(_("\"\n to recover the changes (see \":help recovery\").\n"));
+ msg_puts(_(" If you did this already, delete the swap file \""));
msg_outtrans(fname);
- MSG_PUTS(_("\"\n to avoid this message.\n"));
+ msg_puts(_("\"\n to avoid this message.\n"));
cmdline_row = msg_row;
--no_wait_return;
}
@@ -3647,7 +3647,7 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname, bool *found_
break;
}
} else {
- MSG_PUTS("\n");
+ msg_puts("\n");
if (msg_silent == 0) {
// call wait_return() later
need_wait_return = true;
diff --git a/src/nvim/menu.c b/src/nvim/menu.c
index 2ec68fe032..c2b6a5e402 100644
--- a/src/nvim/menu.c
+++ b/src/nvim/menu.c
@@ -830,7 +830,7 @@ static int show_menus(char_u *const path_name, int modes)
// Now we have found the matching menu, and we list the mappings
// Highlight title
- MSG_PUTS_TITLE(_("\n--- Menus ---"));
+ msg_puts_title(_("\n--- Menus ---"));
show_menus_recursive(menu->parent, modes, 0);
return OK;
@@ -852,11 +852,11 @@ static void show_menus_recursive(vimmenu_T *menu, int modes, int depth)
return;
}
for (i = 0; i < depth; i++) {
- MSG_PUTS(" ");
+ msg_puts(" ");
}
if (menu->priority) {
msg_outnum(menu->priority);
- MSG_PUTS(" ");
+ msg_puts(" ");
}
// Same highlighting as for directories!?
msg_outtrans_attr(menu->name, HL_ATTR(HLF_D));
@@ -870,7 +870,7 @@ static void show_menus_recursive(vimmenu_T *menu, int modes, int depth)
return;
}
for (i = 0; i < depth + 2; i++) {
- MSG_PUTS(" ");
+ msg_puts(" ");
}
msg_putchar(menu_mode_chars[bit]);
if (menu->noremap[bit] == REMAP_NONE) {
@@ -890,7 +890,7 @@ static void show_menus_recursive(vimmenu_T *menu, int modes, int depth)
} else {
msg_putchar(' ');
}
- MSG_PUTS(" ");
+ msg_puts(" ");
if (*menu->strings[bit] == NUL) {
msg_puts_attr("<Nop>", HL_ATTR(HLF_8));
} else {
diff --git a/src/nvim/message.c b/src/nvim/message.c
index adadfde1b6..b0b38875c7 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -209,7 +209,7 @@ void msg_grid_validate(void)
* When terminal not initialized (yet) mch_errmsg(..) is used.
* return TRUE if wait_return not called
*/
-int msg(char_u *s)
+int msg(char *s)
{
return msg_attr_keep(s, 0, false, false);
}
@@ -218,7 +218,7 @@ int msg(char_u *s)
int verb_msg(char *s)
{
verbose_enter();
- int n = msg_attr_keep((char_u *)s, 0, false, false);
+ int n = msg_attr_keep(s, 0, false, false);
verbose_leave();
return n;
@@ -227,7 +227,7 @@ int verb_msg(char *s)
int msg_attr(const char *s, const int attr)
FUNC_ATTR_NONNULL_ARG(1)
{
- return msg_attr_keep((char_u *)s, attr, false, false);
+ return msg_attr_keep(s, attr, false, false);
}
/// similar to msg_outtrans_attr, but support newlines and tabs.
@@ -265,7 +265,7 @@ void msg_multiline_attr(const char *s, int attr, bool check_int, bool *need_clea
/// @param keep set keep_msg if it doesn't scroll
-bool msg_attr_keep(char_u *s, int attr, bool keep, bool multiline)
+bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline)
FUNC_ATTR_NONNULL_ALL
{
static int entered = 0;
@@ -281,12 +281,12 @@ bool msg_attr_keep(char_u *s, int attr, bool keep, bool multiline)
// Skip messages not match ":filter pattern".
// Don't filter when there is an error.
- if (!emsg_on_display && message_filtered(s)) {
+ if (!emsg_on_display && message_filtered((char_u *)s)) {
return true;
}
if (attr == 0) {
- set_vim_var_string(VV_STATUSMSG, (char *)s, -1);
+ set_vim_var_string(VV_STATUSMSG, s, -1);
}
/*
@@ -301,35 +301,35 @@ bool msg_attr_keep(char_u *s, int attr, bool keep, bool multiline)
// Add message to history (unless it's a repeated kept message or a
// truncated message)
- if (s != keep_msg
+ if ((const char_u *)s != keep_msg
|| (*s != '<'
&& last_msg_hist != NULL
&& last_msg_hist->msg != NULL
&& STRCMP(s, last_msg_hist->msg))) {
- add_msg_hist((const char *)s, -1, attr, multiline);
+ add_msg_hist(s, -1, attr, multiline);
}
// Truncate the message if needed.
msg_start();
- buf = msg_strtrunc(s, FALSE);
+ buf = msg_strtrunc((char_u *)s, FALSE);
if (buf != NULL) {
- s = buf;
+ s = (const char *)buf;
}
bool need_clear = true;
if (multiline) {
- msg_multiline_attr((char *)s, attr, false, &need_clear);
+ msg_multiline_attr(s, attr, false, &need_clear);
} else {
- msg_outtrans_attr(s, attr);
+ msg_outtrans_attr((char_u *)s, attr);
}
if (need_clear) {
msg_clr_eos();
}
retval = msg_end();
- if (keep && retval && vim_strsize(s) < (int)(Rows - cmdline_row - 1)
+ if (keep && retval && vim_strsize((char_u *)s) < (int)(Rows - cmdline_row - 1)
* Columns + sc_col) {
- set_keep_msg(s, 0);
+ set_keep_msg((char_u *)s, 0);
}
xfree(buf);
@@ -465,7 +465,7 @@ int smsg(const char *s, ...)
va_start(arglist, s);
vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist);
va_end(arglist);
- return msg(IObuff);
+ return msg((char *)IObuff);
}
int smsg_attr(int attr, const char *s, ...)
@@ -487,7 +487,7 @@ int smsg_attr_keep(int attr, const char *s, ...)
va_start(arglist, s);
vim_vsnprintf((char *)IObuff, IOSIZE, s, arglist);
va_end(arglist);
- return msg_attr_keep(IObuff, attr, true, false);
+ return msg_attr_keep((const char *)IObuff, attr, true, false);
}
/*
@@ -721,7 +721,7 @@ static bool emsg_multiline(const char *s, bool multiline)
// Display the error message itself.
msg_nowait = false; // Wait for this msg.
- return msg_attr_keep((char_u *)s, attr, false, multiline);
+ return msg_attr_keep(s, attr, false, multiline);
}
/// emsg() - display an error message
@@ -845,21 +845,21 @@ void msg_schedule_semsg(const char *const fmt, ...)
* Careful: The string may be changed by msg_may_trunc()!
* Returns a pointer to the printed message, if wait_return() not called.
*/
-char_u *msg_trunc_attr(char_u *s, int force, int attr)
+char *msg_trunc_attr(char *s, int force, int attr)
{
int n;
// Add message to history before truncating.
- add_msg_hist((const char *)s, -1, attr, false);
+ add_msg_hist(s, -1, attr, false);
- s = msg_may_trunc(force, s);
+ char *ts = (char *)msg_may_trunc(force, (char_u *)s);
msg_hist_off = true;
- n = msg_attr((const char *)s, attr);
+ n = msg_attr(ts, attr);
msg_hist_off = false;
if (n) {
- return s;
+ return ts;
}
return NULL;
}
@@ -1050,7 +1050,7 @@ void ex_messages(void *const eap_p)
msg_hist_off = true;
for (; p != NULL && !got_int; p = p->next) {
if (p->msg != NULL) {
- msg_attr_keep(p->msg, p->attr, false, p->multiline);
+ msg_attr_keep((char *)p->msg, p->attr, false, p->multiline);
}
}
msg_hist_off = false;
@@ -1072,11 +1072,11 @@ void msg_end_prompt(void)
lines_left = -1;
}
-/// wait for the user to hit a key (normally a return)
+/// Wait for the user to hit a key (normally Enter)
///
-/// if 'redraw' is true, redraw the entire screen NOT_VALID
-/// if 'redraw' is false, do a normal redraw
-/// if 'redraw' is -1, don't redraw at all
+/// If 'redraw' is true, redraw the entire screen NOT_VALID
+/// If 'redraw' is false, do a normal redraw
+/// If 'redraw' is -1, don't redraw at all
void wait_return(int redraw)
{
int c;
@@ -1119,7 +1119,7 @@ void wait_return(int redraw)
quit_more = FALSE;
got_int = FALSE;
} else if (exmode_active) {
- MSG_PUTS(" "); // make sure the cursor is on the right line
+ msg_puts(" "); // make sure the cursor is on the right line
c = CAR; // no need for a return in ex mode
got_int = FALSE;
} else {
@@ -1275,10 +1275,10 @@ static void hit_return_msg(void)
}
msg_ext_set_kind("return_prompt");
if (got_int) {
- MSG_PUTS(_("Interrupt: "));
+ msg_puts(_("Interrupt: "));
}
- MSG_PUTS_ATTR(_("Press ENTER or type command to continue"), HL_ATTR(HLF_R));
+ msg_puts_attr(_("Press ENTER or type command to continue"), HL_ATTR(HLF_R));
if (!msg_use_printf()) {
msg_clr_eos();
}
@@ -1569,22 +1569,22 @@ int msg_outtrans_special(const char_u *strstart, bool from, int maxlen)
int attr = HL_ATTR(HLF_8);
while (*str != NUL) {
- const char *string;
+ const char *text;
// Leading and trailing spaces need to be displayed in <> form.
if ((str == strstart || str[1] == NUL) && *str == ' ') {
- string = "<Space>";
+ text = "<Space>";
str++;
} else {
- string = str2special((const char **)&str, from, false);
+ text = str2special((const char **)&str, from, false);
}
- const int len = vim_strsize((char_u *)string);
+ const int len = vim_strsize((char_u *)text);
if (maxlen > 0 && retval + len >= maxlen) {
break;
}
// Highlight special keys
- msg_puts_attr(string, (len > 1
- && (*mb_ptr2len)((char_u *)string) <= 1
- ? attr : 0));
+ msg_puts_attr(text, (len > 1
+ && (*mb_ptr2len)((char_u *)text) <= 1
+ ? attr : 0));
retval += len;
}
return retval;
@@ -1909,12 +1909,12 @@ void msg_puts_title(const char *s)
* part in the middle and replace it with "..." when necessary.
* Does not handle multi-byte characters!
*/
-void msg_puts_long_attr(char_u *longstr, int attr)
+void msg_outtrans_long_attr(char_u *longstr, int attr)
{
- msg_puts_long_len_attr(longstr, (int)STRLEN(longstr), attr);
+ msg_outtrans_long_len_attr(longstr, (int)STRLEN(longstr), attr);
}
-void msg_puts_long_len_attr(char_u *longstr, int len, int attr)
+void msg_outtrans_long_len_attr(char_u *longstr, int len, int attr)
{
int slen = len;
int room;
diff --git a/src/nvim/message.h b/src/nvim/message.h
index e22c2e1e3f..316b2df7a4 100644
--- a/src/nvim/message.h
+++ b/src/nvim/message.h
@@ -30,29 +30,6 @@
#define VIM_ALL 5
#define VIM_DISCARDALL 6
-/// Show plain message
-#define MSG(s) msg((char_u *)(s))
-
-/// Show message highlighted according to the attr
-#define MSG_ATTR(s, attr) msg_attr((const char *)(s), (attr))
-
-/// Display error message
-///
-/// Display message at the recorded position
-#define MSG_PUTS(s) msg_puts((const char *)(s))
-
-/// Display message at the recorded position, highlighted
-#define MSG_PUTS_ATTR(s, a) msg_puts_attr((const char *)(s), (a))
-
-/// Like #MSG_PUTS, but highlight like title
-#define MSG_PUTS_TITLE(s) msg_puts_title((const char *)(s))
-
-/// Like #MSG_PUTS, but if middle part of too long messages it will be replaced
-#define MSG_PUTS_LONG(s) msg_puts_long_attr((char_u *)(s), 0)
-
-/// Like #MSG_PUTS_ATTR, but if middle part of long messages will be replaced
-#define MSG_PUTS_LONG_ATTR(s, a) msg_puts_long_attr((char_u *)(s), (a))
-
typedef struct {
String text;
int attr;
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index a412078721..faf0b0f633 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -589,7 +589,7 @@ int get_number(int colon, int *mouse_used)
++typed;
} else if (c == K_DEL || c == K_KDEL || c == K_BS || c == Ctrl_H) {
if (typed > 0) {
- MSG_PUTS("\b \b");
+ msg_puts("\b \b");
--typed;
}
n /= 10;
@@ -629,10 +629,10 @@ int prompt_for_number(int *mouse_used)
// When using ":silent" assume that <CR> was entered.
if (mouse_used != NULL) {
- MSG_PUTS(_("Type number and <Enter> or click with the mouse "
+ msg_puts(_("Type number and <Enter> or click with the mouse "
"(q or empty cancels): "));
} else {
- MSG_PUTS(_("Type number and <Enter> (q or empty cancels): "));
+ msg_puts(_("Type number and <Enter> (q or empty cancels): "));
}
/* Set the state such that text can be selected/copied/pasted and we still
@@ -698,7 +698,7 @@ void msgmore(long n)
if (got_int) {
xstrlcat(msg_buf, _(" (Interrupted)"), MSG_BUF_LEN);
}
- if (msg((char_u *)msg_buf)) {
+ if (msg(msg_buf)) {
set_keep_msg((char_u *)msg_buf, 0);
keep_msg_more = true;
}
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index daff0697a6..6f1cc494b2 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -7848,10 +7848,10 @@ static void nv_esc(cmdarg_T *cap)
&& !VIsual_active
&& no_reason) {
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"));
} else {
- MSG(_("Type :qa and press <Enter> to exit Nvim"));
+ msg(_("Type :qa and press <Enter> to exit Nvim"));
}
}
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 1805d62e9c..a4b554601e 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -262,7 +262,7 @@ void op_shift(oparg_T *oap, int curs_top, int amount)
vim_snprintf((char *)IObuff, IOSIZE,
NGETTEXT(msg_line_single, msg_line_plural, oap->line_count),
(int64_t)oap->line_count, op, amount);
- msg_attr_keep(IObuff, 0, true, false);
+ msg_attr_keep((char *)IObuff, 0, true, false);
}
/*
@@ -921,7 +921,7 @@ int do_record(int c)
if (ui_has(kUIMessages)) {
showmode();
} else {
- MSG("");
+ msg("");
}
p = get_recorded();
if (p == NULL) {
@@ -3694,12 +3694,12 @@ void ex_display(exarg_T *eap)
msg_puts(" ");
msg_putchar('"');
msg_putchar(name);
- MSG_PUTS(" ");
+ msg_puts(" ");
int n = Columns - 11;
for (size_t j = 0; j < yb->y_size && n > 1; j++) {
if (j) {
- MSG_PUTS_ATTR("^J", attr);
+ msg_puts_attr("^J", attr);
n -= 2;
}
for (p = yb->y_array[j]; *p && (n -= ptr2cells(p)) >= 0; p++) { // -V1019 NOLINT(whitespace/line_length)
@@ -3709,7 +3709,7 @@ void ex_display(exarg_T *eap)
}
}
if (n > 1 && yb->y_type == kMTLineWise) {
- MSG_PUTS_ATTR("^J", attr);
+ msg_puts_attr("^J", attr);
}
ui_flush(); // show one line at a time
}
@@ -5687,7 +5687,7 @@ void cursor_pos_info(dict_T *dict)
// Compute the length of the file in characters.
if (curbuf->b_ml.ml_flags & ML_EMPTY) {
if (dict == NULL) {
- MSG(_(no_lines_msg));
+ msg(_(no_lines_msg));
return;
}
} else {
@@ -5885,7 +5885,7 @@ void cursor_pos_info(dict_T *dict)
// Don't shorten this message, the user asked for it.
p = p_shm;
p_shm = (char_u *)"";
- msg(IObuff);
+ msg((char *)IObuff);
p_shm = p;
}
}
@@ -5947,7 +5947,7 @@ static yankreg_T *adjust_clipboard_name(int *name, bool quiet, bool writing)
clipboard_didwarn = true;
// Do NOT error (emsg()) here--if it interrupts :redir we get into
// a weird state, stuck in "redirect mode".
- msg((char_u *)MSG_NO_CLIP);
+ msg(MSG_NO_CLIP);
}
// ... else, be silent (don't flood during :while, :redir, etc.).
goto end;
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 4e99e781f8..064a0f33ad 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -5016,11 +5016,11 @@ static void showoptions(int all, int opt_flags)
// Highlight title
if (opt_flags & OPT_GLOBAL) {
- MSG_PUTS_TITLE(_("\n--- Global option values ---"));
+ msg_puts_title(_("\n--- Global option values ---"));
} else if (opt_flags & OPT_LOCAL) {
- MSG_PUTS_TITLE(_("\n--- Local option values ---"));
+ msg_puts_title(_("\n--- Local option values ---"));
} else {
- MSG_PUTS_TITLE(_("\n--- Options ---"));
+ msg_puts_title(_("\n--- Options ---"));
}
// Do the loop two times:
@@ -5151,13 +5151,13 @@ static void showoneopt(vimoption_T *p, int opt_flags)
// for 'modified' we also need to check if 'ff' or 'fenc' changed.
if ((p->flags & P_BOOL) && ((int *)varp == &curbuf->b_changed
? !curbufIsChanged() : !*(int *)varp)) {
- MSG_PUTS("no");
+ msg_puts("no");
} else if ((p->flags & P_BOOL) && *(int *)varp < 0) {
- MSG_PUTS("--");
+ msg_puts("--");
} else {
- MSG_PUTS(" ");
+ msg_puts(" ");
}
- MSG_PUTS(p->fullname);
+ msg_puts(p->fullname);
if (!(p->flags & P_BOOL)) {
msg_putchar('=');
// put value string in NameBuff
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 1399fc758c..6ef0aa1091 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -341,7 +341,7 @@ int os_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file
if (!(flags & EW_SILENT)) {
msg_putchar('\n'); // clear bottom line quickly
cmdline_row = Rows - 1; // continue on last line
- MSG(_(e_wildexpand));
+ msg(_(e_wildexpand));
msg_start(); // don't overwrite this message
}
@@ -358,7 +358,7 @@ int os_expand_wildcards(int num_pat, char_u **pat, int *num_file, char_u ***file
if (fd == NULL) {
// Something went wrong, perhaps a file name with a special char.
if (!(flags & EW_SILENT)) {
- MSG(_(e_wildexpand));
+ msg(_(e_wildexpand));
msg_start(); // don't overwrite this message
}
xfree(tempname);
@@ -670,7 +670,7 @@ int os_call_shell(char_u *cmd, ShellOpts opts, char_u *extra_args)
}
if (!emsg_silent && exitcode != 0 && !(opts & kShellOptSilent)) {
- MSG_PUTS(_("\nshell returned "));
+ msg_puts(_("\nshell returned "));
msg_outnum(exitcode);
msg_putchar('\n');
}
@@ -742,9 +742,9 @@ static int do_os_system(char **argv, const char *input, size_t len, char **outpu
loop_poll_events(&main_loop, 0);
// Failed, probably 'shell' is not executable.
if (!silent) {
- MSG_PUTS(_("\nshell failed to start: "));
+ msg_puts(_("\nshell failed to start: "));
msg_outtrans((char_u *)os_strerror(status));
- MSG_PUTS(": ");
+ msg_puts(": ");
msg_outtrans((char_u *)prog);
msg_putchar('\n');
}
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 54da291bab..950d187ad5 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -2790,7 +2790,7 @@ static void qf_jump_print_msg(qf_info_T *qi, int qf_index, qfline_T *qf_ptr, buf
msg_scroll = false;
}
msg_ext_set_kind("quickfix");
- msg_attr_keep(IObuff, 0, true, false);
+ msg_attr_keep((char *)IObuff, 0, true, false);
msg_scroll = (int)i;
}
@@ -3234,7 +3234,7 @@ static void qf_msg(qf_info_T *qi, int which, char *lead)
xstrlcat((char *)buf, title, IOSIZE);
}
trunc_string(buf, buf, Columns - 1, IOSIZE);
- msg(buf);
+ msg((char *)buf);
}
/// ":colder [count]": Up in the quickfix stack.
@@ -3300,7 +3300,7 @@ void qf_history(exarg_T *eap)
}
if (qf_stack_empty(qi)) {
- MSG(_("No entries"));
+ msg(_("No entries"));
} else {
for (i = 0; i < qi->qf_listcount; i++) {
qf_msg(qi, i, i == qi->qf_curlist ? "> " : " ");
@@ -4273,7 +4273,7 @@ static char *make_get_fullcmd(const char_u *makecmd, const char_u *fname)
msg_didout = false;
}
msg_start();
- MSG_PUTS(":!");
+ msg_puts(":!");
msg_outtrans((char_u *)cmd); // show what we are doing
return cmd;
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 72c64ec2df..7bc1af9004 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -7302,8 +7302,8 @@ static void report_re_switch(char_u *pat)
{
if (p_verbose > 0) {
verbose_enter();
- MSG_PUTS(_("Switching to backtracking RE engine for pattern: "));
- MSG_PUTS(pat);
+ msg_puts(_("Switching to backtracking RE engine for pattern: "));
+ msg_puts((char *)pat);
verbose_leave();
}
}
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 2939ea1206..d14e0c83a6 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -6961,7 +6961,7 @@ int showmode(void)
lines_left = 0;
if (do_mode) {
- MSG_PUTS_ATTR("--", attr);
+ msg_puts_attr("--", attr);
// CTRL-X in Insert mode
if (edit_submode != NULL && !shortmess(SHM_COMPLETIONMENU)) {
// These messages can get long, avoid a wrap in a narrow window.
@@ -6986,7 +6986,7 @@ int showmode(void)
msg_puts_attr((const char *)edit_submode, attr);
}
if (edit_submode_extra != NULL) {
- MSG_PUTS_ATTR(" ", attr); // Add a space in between.
+ msg_puts_attr(" ", attr); // Add a space in between.
if ((int)edit_submode_highl < HLF_COUNT) {
sub_attr = win_hl_attr(curwin, edit_submode_highl);
} else {
@@ -6997,37 +6997,37 @@ int showmode(void)
}
} else {
if (State & TERM_FOCUS) {
- MSG_PUTS_ATTR(_(" TERMINAL"), attr);
+ msg_puts_attr(_(" TERMINAL"), attr);
} else if (State & VREPLACE_FLAG) {
- MSG_PUTS_ATTR(_(" VREPLACE"), attr);
+ msg_puts_attr(_(" VREPLACE"), attr);
} else if (State & REPLACE_FLAG) {
- MSG_PUTS_ATTR(_(" REPLACE"), attr);
+ msg_puts_attr(_(" REPLACE"), attr);
} else if (State & INSERT) {
if (p_ri) {
- MSG_PUTS_ATTR(_(" REVERSE"), attr);
+ msg_puts_attr(_(" REVERSE"), attr);
}
- MSG_PUTS_ATTR(_(" INSERT"), attr);
+ msg_puts_attr(_(" INSERT"), attr);
} else if (restart_edit == 'I' || restart_edit == 'i'
|| restart_edit == 'a') {
- MSG_PUTS_ATTR(_(" (insert)"), attr);
+ msg_puts_attr(_(" (insert)"), attr);
} else if (restart_edit == 'R') {
- MSG_PUTS_ATTR(_(" (replace)"), attr);
+ msg_puts_attr(_(" (replace)"), attr);
} else if (restart_edit == 'V') {
- MSG_PUTS_ATTR(_(" (vreplace)"), attr);
+ msg_puts_attr(_(" (vreplace)"), attr);
}
if (p_hkmap) {
- MSG_PUTS_ATTR(_(" Hebrew"), attr);
+ msg_puts_attr(_(" Hebrew"), attr);
}
if (State & LANGMAP) {
if (curwin->w_p_arab) {
- MSG_PUTS_ATTR(_(" Arabic"), attr);
+ msg_puts_attr(_(" Arabic"), attr);
} else if (get_keymap_str(curwin, (char_u *)" (%s)",
NameBuff, MAXPATHL)) {
- MSG_PUTS_ATTR(NameBuff, attr);
+ msg_puts_attr((char *)NameBuff, attr);
}
}
if ((State & INSERT) && p_paste) {
- MSG_PUTS_ATTR(_(" (paste)"), attr);
+ msg_puts_attr(_(" (paste)"), attr);
}
if (VIsual_active) {
@@ -7051,9 +7051,9 @@ int showmode(void)
default:
p = N_(" SELECT BLOCK"); break;
}
- MSG_PUTS_ATTR(_(p), attr);
+ msg_puts_attr(_(p), attr);
}
- MSG_PUTS_ATTR(" --", attr);
+ msg_puts_attr(" --", attr);
}
need_clear = TRUE;
@@ -7142,11 +7142,11 @@ void clearmode(void)
static void recording_mode(int attr)
{
- MSG_PUTS_ATTR(_("recording"), attr);
+ msg_puts_attr(_("recording"), attr);
if (!shortmess(SHM_RECORDING)) {
- char_u s[4];
- snprintf((char *)s, ARRAY_SIZE(s), " @%c", reg_recording);
- MSG_PUTS_ATTR(s, attr);
+ char s[4];
+ snprintf(s, ARRAY_SIZE(s), " @%c", reg_recording);
+ msg_puts_attr(s, attr);
}
}
diff --git a/src/nvim/search.c b/src/nvim/search.c
index c9c75c787e..32bb0cb55a 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -4878,7 +4878,7 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo
if (!got_int) { // don't display if 'q' typed at "--more--"
// message
msg_home_replace_hl(new_fname);
- MSG_PUTS(_(" (includes previously listed match)"));
+ msg_puts(_(" (includes previously listed match)"));
prev_fname = NULL;
}
}
@@ -4895,25 +4895,25 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo
msg_putchar('\n'); // cursor below last one
} else {
gotocmdline(true); // cursor at status line
- MSG_PUTS_TITLE(_("--- Included files "));
+ msg_puts_title(_("--- Included files "));
if (action != ACTION_SHOW_ALL) {
- MSG_PUTS_TITLE(_("not found "));
+ msg_puts_title(_("not found "));
}
- MSG_PUTS_TITLE(_("in path ---\n"));
+ msg_puts_title(_("in path ---\n"));
}
did_show = true;
while (depth_displayed < depth && !got_int) {
++depth_displayed;
for (i = 0; i < depth_displayed; i++) {
- MSG_PUTS(" ");
+ msg_puts(" ");
}
msg_home_replace(files[depth_displayed].name);
- MSG_PUTS(" -->\n");
+ msg_puts(" -->\n");
}
if (!got_int) { // don't display if 'q' typed
// for "--more--" message
for (i = 0; i <= depth_displayed; i++) {
- MSG_PUTS(" ");
+ msg_puts(" ");
}
if (new_fname != NULL) {
// using "new_fname" is more reliable, e.g., when
@@ -4962,9 +4962,9 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo
if (new_fname == NULL && action == ACTION_SHOW_ALL) {
if (already_searched) {
- MSG_PUTS(_(" (Already listed)"));
+ msg_puts(_(" (Already listed)"));
} else {
- MSG_PUTS(_(" NOT FOUND"));
+ msg_puts(_(" NOT FOUND"));
}
}
}
@@ -5009,7 +5009,7 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo
vim_snprintf((char *)IObuff, IOSIZE,
_("Scanning included file: %s"),
(char *)new_fname);
- msg_trunc_attr(IObuff, true, HL_ATTR(HLF_R));
+ msg_trunc_attr((char *)IObuff, true, HL_ATTR(HLF_R));
} else if (p_verbose >= 5) {
verbose_enter();
smsg(_("Searching included file %s"),
@@ -5339,9 +5339,9 @@ exit_matched:
if (type == CHECK_PATH) {
if (!did_show) {
if (action != ACTION_SHOW_ALL) {
- MSG(_("All included files were found"));
+ msg(_("All included files were found"));
} else {
- MSG(_("No included files"));
+ msg(_("No included files"));
}
}
} else if (!found
diff --git a/src/nvim/sign.c b/src/nvim/sign.c
index 1c28c0b218..29b608154b 100644
--- a/src/nvim/sign.c
+++ b/src/nvim/sign.c
@@ -680,7 +680,7 @@ void sign_list_placed(buf_T *rbuf, char_u *sign_group)
char lbuf[MSG_BUF_LEN];
char group[MSG_BUF_LEN];
- MSG_PUTS_TITLE(_("\n--- Signs ---"));
+ msg_puts_title(_("\n--- Signs ---"));
msg_putchar('\n');
if (rbuf == NULL) {
buf = firstbuf;
@@ -690,7 +690,7 @@ void sign_list_placed(buf_T *rbuf, char_u *sign_group)
while (buf != NULL && !got_int) {
if (buf->b_signlist != NULL) {
vim_snprintf(lbuf, MSG_BUF_LEN, _("Signs for %s:"), buf->b_fname);
- MSG_PUTS_ATTR(lbuf, HL_ATTR(HLF_D));
+ msg_puts_attr(lbuf, HL_ATTR(HLF_D));
msg_putchar('\n');
}
FOR_ALL_SIGNS_IN_BUF(buf, sign) {
@@ -710,7 +710,7 @@ void sign_list_placed(buf_T *rbuf, char_u *sign_group)
_(" line=%ld id=%d%s name=%s priority=%d"),
(long)sign->se_lnum, sign->se_id, group,
sign_typenr2name(sign->se_typenr), sign->se_priority);
- MSG_PUTS(lbuf);
+ msg_puts(lbuf);
msg_putchar('\n');
}
if (rbuf != NULL) {
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 4f1a296ac4..013cc1e594 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -2934,7 +2934,7 @@ void spell_suggest(int count)
true, need_cap, true);
if (GA_EMPTY(&sug.su_ga)) {
- MSG(_("Sorry, no suggestions"));
+ msg(_("Sorry, no suggestions"));
} else if (count > 0) {
if (count > sug.su_ga.ga_len) {
smsg(_("Sorry, only %" PRId64 " suggestions"),
diff --git a/src/nvim/spellfile.c b/src/nvim/spellfile.c
index 86e426217d..cddf3fe855 100644
--- a/src/nvim/spellfile.c
+++ b/src/nvim/spellfile.c
@@ -2748,11 +2748,11 @@ static afffile_T *spell_read_aff(spellinfo_T *spin, char_u *fname)
// Check that we didn't use too many renumbered flags.
if (spin->si_newcompID < spin->si_newprefID) {
if (spin->si_newcompID == 127 || spin->si_newcompID == 255) {
- MSG(_("Too many postponed prefixes"));
+ msg(_("Too many postponed prefixes"));
} else if (spin->si_newprefID == 0 || spin->si_newprefID == 127) {
- MSG(_("Too many compound flags"));
+ msg(_("Too many compound flags"));
} else {
- MSG(_("Too many postponed prefixes and/or compound flags"));
+ msg(_("Too many postponed prefixes and/or compound flags"));
}
}
@@ -3209,7 +3209,7 @@ static int spell_read_dic(spellinfo_T *spin, char_u *fname, afffile_T *affile)
_("line %6d, word %6ld - %s"),
lnum, spin->si_foldwcount + spin->si_keepwcount, w);
msg_start();
- msg_puts_long_attr(message, 0);
+ msg_outtrans_long_attr(message, 0);
msg_clr_eos();
msg_didout = false;
msg_col = 0;
@@ -5417,7 +5417,7 @@ static void mkspell(int fcount, char_u **fnames, bool ascii, bool over_write, bo
}
if (spin.si_compflags != NULL && spin.si_nobreak) {
- MSG(_("Warning: both compounding and NOBREAK specified"));
+ msg(_("Warning: both compounding and NOBREAK specified"));
}
if (!error && !got_int) {
@@ -5487,7 +5487,7 @@ static void spell_message(const spellinfo_T *spin, char_u *str)
if (!spin->si_verbose) {
verbose_enter();
}
- MSG(str);
+ msg((char *)str);
ui_flush();
if (!spin->si_verbose) {
verbose_leave();
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 110c4664ca..d134870138 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -3005,7 +3005,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) {
syn_win->w_s->b_syn_slow = true;
- MSG(_("'redrawtime' exceeded, syntax highlighting disabled"));
+ msg(_("'redrawtime' exceeded, syntax highlighting disabled"));
}
if (r > 0) {
@@ -3110,9 +3110,9 @@ static void syn_cmd_conceal(exarg_T *eap, int syncing)
next = skiptowhite(arg);
if (*arg == NUL) {
if (curwin->w_s->b_syn_conceal) {
- MSG(_("syntax conceal on"));
+ msg(_("syntax conceal on"));
} else {
- MSG(_("syntax conceal off"));
+ msg(_("syntax conceal off"));
}
} else if (STRNICMP(arg, "on", 2) == 0 && next - arg == 2) {
curwin->w_s->b_syn_conceal = true;
@@ -3139,9 +3139,9 @@ static void syn_cmd_case(exarg_T *eap, int syncing)
next = skiptowhite(arg);
if (*arg == NUL) {
if (curwin->w_s->b_syn_ic) {
- MSG(_("syntax case ignore"));
+ msg(_("syntax case ignore"));
} else {
- MSG(_("syntax case match"));
+ msg(_("syntax case match"));
}
} else if (STRNICMP(arg, "match", 5) == 0 && next - arg == 5) {
curwin->w_s->b_syn_ic = false;
@@ -3166,9 +3166,9 @@ static void syn_cmd_foldlevel(exarg_T *eap, int syncing)
if (*arg == NUL) {
switch (curwin->w_s->b_syn_foldlevel) {
case SYNFLD_START:
- MSG(_("syntax foldlevel start")); break;
+ msg(_("syntax foldlevel start")); break;
case SYNFLD_MINIMUM:
- MSG(_("syntax foldlevel minimum")); break;
+ msg(_("syntax foldlevel minimum")); break;
default:
break;
}
@@ -3207,11 +3207,11 @@ static void syn_cmd_spell(exarg_T *eap, int syncing)
next = skiptowhite(arg);
if (*arg == NUL) {
if (curwin->w_s->b_syn_spell == SYNSPL_TOP) {
- MSG(_("syntax spell toplevel"));
+ msg(_("syntax spell toplevel"));
} else if (curwin->w_s->b_syn_spell == SYNSPL_NOTOP) {
- MSG(_("syntax spell notoplevel"));
+ msg(_("syntax spell notoplevel"));
} else {
- MSG(_("syntax spell default"));
+ msg(_("syntax spell default"));
}
} else if (STRNICMP(arg, "toplevel", 8) == 0 && next - arg == 8) {
curwin->w_s->b_syn_spell = SYNSPL_TOP;
@@ -3241,9 +3241,9 @@ static void syn_cmd_iskeyword(exarg_T *eap, int syncing)
arg = skipwhite(arg);
if (*arg == NUL) {
- MSG_PUTS("\n");
+ msg_puts("\n");
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);
} else {
msg_outtrans((char_u *)_("syntax iskeyword not set"));
@@ -3566,41 +3566,41 @@ static void syn_cmd_list(exarg_T *eap, int syncing)
}
if (!syntax_present(curwin)) {
- MSG(_(msg_no_items));
+ msg(_(msg_no_items));
return;
}
if (syncing) {
if (curwin->w_s->b_syn_sync_flags & SF_CCOMMENT) {
- MSG_PUTS(_("syncing on C-style comments"));
+ msg_puts(_("syncing on C-style comments"));
syn_lines_msg();
syn_match_msg();
return;
} else if (!(curwin->w_s->b_syn_sync_flags & SF_MATCH)) {
if (curwin->w_s->b_syn_sync_minlines == 0) {
- MSG_PUTS(_("no syncing"));
+ msg_puts(_("no syncing"));
} else {
if (curwin->w_s->b_syn_sync_minlines == MAXLNUM) {
- MSG_PUTS(_("syncing starts at the first line"));
+ msg_puts(_("syncing starts at the first line"));
} else {
- MSG_PUTS(_("syncing starts "));
+ msg_puts(_("syncing starts "));
msg_outnum(curwin->w_s->b_syn_sync_minlines);
- MSG_PUTS(_(" lines before top line"));
+ msg_puts(_(" lines before top line"));
}
syn_match_msg();
}
return;
}
- MSG_PUTS_TITLE(_("\n--- Syntax sync items ---"));
+ msg_puts_title(_("\n--- Syntax sync items ---"));
if (curwin->w_s->b_syn_sync_minlines > 0
|| curwin->w_s->b_syn_sync_maxlines > 0
|| curwin->w_s->b_syn_sync_linebreaks > 0) {
- MSG_PUTS(_("\nsyncing on items"));
+ msg_puts(_("\nsyncing on items"));
syn_lines_msg();
syn_match_msg();
}
} else {
- MSG_PUTS_TITLE(_("\n--- Syntax items ---"));
+ msg_puts_title(_("\n--- Syntax items ---"));
}
if (ends_excmd(*arg)) {
/*
@@ -3643,22 +3643,22 @@ static void syn_lines_msg(void)
{
if (curwin->w_s->b_syn_sync_maxlines > 0
|| curwin->w_s->b_syn_sync_minlines > 0) {
- MSG_PUTS("; ");
+ msg_puts("; ");
if (curwin->w_s->b_syn_sync_minlines == MAXLNUM) {
- MSG_PUTS(_("from the first line"));
+ msg_puts(_("from the first line"));
} else {
if (curwin->w_s->b_syn_sync_minlines > 0) {
- MSG_PUTS(_("minimal "));
+ msg_puts(_("minimal "));
msg_outnum(curwin->w_s->b_syn_sync_minlines);
if (curwin->w_s->b_syn_sync_maxlines) {
- MSG_PUTS(", ");
+ msg_puts(", ");
}
}
if (curwin->w_s->b_syn_sync_maxlines > 0) {
- MSG_PUTS(_("maximal "));
+ msg_puts(_("maximal "));
msg_outnum(curwin->w_s->b_syn_sync_maxlines);
}
- MSG_PUTS(_(" lines before top line"));
+ msg_puts(_(" lines before top line"));
}
}
}
@@ -3666,9 +3666,9 @@ static void syn_lines_msg(void)
static void syn_match_msg(void)
{
if (curwin->w_s->b_syn_sync_linebreaks > 0) {
- MSG_PUTS(_("; match "));
+ msg_puts(_("; match "));
msg_outnum(curwin->w_s->b_syn_sync_linebreaks);
- MSG_PUTS(_(" line breaks"));
+ msg_puts(_(" line breaks"));
}
}
@@ -3767,7 +3767,7 @@ static void syn_list_one(const int id, const bool syncing, const bool link_only)
msg_outtrans(HL_TABLE()[SYN_ITEMS(curwin->w_s)
[spp->sp_sync_idx].sp_syn.id - 1].sg_name);
} else {
- MSG_PUTS("NONE");
+ msg_puts("NONE");
}
msg_putchar(' ');
}
@@ -6022,7 +6022,7 @@ static void syntime_clear(void)
synpat_T *spp;
if (!syntax_present(curwin)) {
- MSG(_(msg_no_items));
+ msg(_(msg_no_items));
return;
}
for (int idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx) {
@@ -6064,7 +6064,7 @@ static int syn_compare_syntime(const void *v1, const void *v2)
static void syntime_report(void)
{
if (!syntax_present(curwin)) {
- MSG(_(msg_no_items));
+ msg(_(msg_no_items));
return;
}
@@ -6098,28 +6098,28 @@ static void syntime_report(void)
syn_compare_syntime);
}
- MSG_PUTS_TITLE(_(" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN"));
- MSG_PUTS("\n");
+ msg_puts_title(_(" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN"));
+ msg_puts("\n");
for (int idx = 0; idx < ga.ga_len && !got_int; ++idx) {
p = ((time_entry_T *)ga.ga_data) + idx;
- MSG_PUTS(profile_msg(p->total));
- MSG_PUTS(" "); // make sure there is always a separating space
+ msg_puts(profile_msg(p->total));
+ msg_puts(" "); // make sure there is always a separating space
msg_advance(13);
msg_outnum(p->count);
- MSG_PUTS(" ");
+ msg_puts(" ");
msg_advance(20);
msg_outnum(p->match);
- MSG_PUTS(" ");
+ msg_puts(" ");
msg_advance(26);
- MSG_PUTS(profile_msg(p->slowest));
- MSG_PUTS(" ");
+ msg_puts(profile_msg(p->slowest));
+ msg_puts(" ");
msg_advance(38);
- MSG_PUTS(profile_msg(p->average));
- MSG_PUTS(" ");
+ msg_puts(profile_msg(p->average));
+ msg_puts(" ");
msg_advance(50);
msg_outtrans(HL_TABLE()[p->id - 1].sg_name);
- MSG_PUTS(" ");
+ msg_puts(" ");
msg_advance(69);
int len;
@@ -6132,15 +6132,15 @@ static void syntime_report(void)
len = (int)STRLEN(p->pattern);
}
msg_outtrans_len(p->pattern, len);
- MSG_PUTS("\n");
+ msg_puts("\n");
}
ga_clear(&ga);
if (!got_int) {
- MSG_PUTS("\n");
- MSG_PUTS(profile_msg(total_total));
+ msg_puts("\n");
+ msg_puts(profile_msg(total_total));
msg_advance(13);
msg_outnum(total_count);
- MSG_PUTS("\n");
+ msg_puts("\n");
}
}
@@ -7416,8 +7416,8 @@ static bool highlight_list_arg(const int id, bool didh, const int type, int iarg
didh = true;
if (!got_int) {
if (*name != NUL) {
- MSG_PUTS_ATTR(name, HL_ATTR(HLF_D));
- MSG_PUTS_ATTR("=", HL_ATTR(HLF_D));
+ msg_puts_attr(name, HL_ATTR(HLF_D));
+ msg_puts_attr("=", HL_ATTR(HLF_D));
}
msg_outtrans((char_u *)ts);
}
@@ -7705,7 +7705,7 @@ static int syn_add_group(char_u *name)
/* This is an error, but since there previously was no check only
* give a warning. */
msg_source(HL_ATTR(HLF_W));
- MSG(_("W18: Invalid character in group name"));
+ msg(_("W18: Invalid character in group name"));
break;
}
}
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index d1676ec658..673ebc2668 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -621,7 +621,7 @@ int do_tag(char_u *tag, int type, int count, int forceit, int verbose)
if (ic) {
msg_attr((const char *)IObuff, HL_ATTR(HLF_W));
} else {
- msg(IObuff);
+ msg((char *)IObuff);
}
msg_scroll = true; // Don't overwrite this message.
} else {
@@ -1038,7 +1038,7 @@ void do_tags(exarg_T *eap)
int tagstacklen = curwin->w_tagstacklen;
// Highlight title
- MSG_PUTS_TITLE(_("\n # TO tag FROM line in file/text"));
+ msg_puts_title(_("\n # TO tag FROM line in file/text"));
for (i = 0; i < tagstacklen; ++i) {
if (tagstack[i].tagname != NULL) {
name = fm_getname(&(tagstack[i].fmark), 30);
@@ -1061,7 +1061,7 @@ void do_tags(exarg_T *eap)
ui_flush(); // show one line at a time
}
if (tagstackidx == tagstacklen) { // idx at top of stack
- MSG_PUTS("\n>");
+ msg_puts("\n>");
}
}
@@ -2889,7 +2889,7 @@ static int jumpto_tag(const char_u *lbuf_arg, int forceit, int keep_help)
* is set and match found while ignoring case.
*/
if (found == 2 || !save_p_ic) {
- MSG(_("E435: Couldn't find tag, just guessing!"));
+ msg(_("E435: Couldn't find tag, just guessing!"));
if (!msg_scrolled && msg_silent == 0) {
ui_flush();
os_delay(1010L, true);
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 9fd0012aac..7eb76abd2c 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -1904,7 +1904,7 @@ static void u_doit(int startcount, bool quiet, bool do_buf_event)
curbuf->b_u_curhead = curbuf->b_u_oldhead;
beep_flush();
if (count == startcount - 1) {
- MSG(_("Already at oldest change"));
+ msg(_("Already at oldest change"));
return;
}
break;
@@ -1915,7 +1915,7 @@ static void u_doit(int startcount, bool quiet, bool do_buf_event)
if (curbuf->b_u_curhead == NULL || get_undolevel(curbuf) <= 0) {
beep_flush(); // nothing to redo
if (count == startcount - 1) {
- MSG(_("Already at newest change"));
+ msg(_("Already at newest change"));
return;
}
break;
@@ -2146,9 +2146,9 @@ void undo_time(long step, bool sec, bool file, bool absolute)
if (closest == closest_start) {
if (step < 0) {
- MSG(_("Already at oldest change"));
+ msg(_("Already at oldest change"));
} else {
- MSG(_("Already at newest change"));
+ msg(_("Already at newest change"));
}
return;
}
@@ -2730,7 +2730,7 @@ void ex_undolist(exarg_T *eap)
}
if (GA_EMPTY(&ga)) {
- MSG(_("Nothing to undo"));
+ msg(_("Nothing to undo"));
} else {
sort_strings((char_u **)ga.ga_data, ga.ga_len);
diff --git a/src/nvim/version.c b/src/nvim/version.c
index dea21fcf04..1fcbae8be3 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -2138,32 +2138,32 @@ void list_lua_version(void)
Object ret = nlua_exec(cstr_as_string(code), (Array)ARRAY_DICT_INIT, &err);
assert(!ERROR_SET(&err));
assert(ret.type == kObjectTypeString);
- MSG(ret.data.string.data);
+ msg(ret.data.string.data);
api_free_object(ret);
}
void list_version(void)
{
- MSG(longVersion);
- MSG(version_buildtype);
+ msg(longVersion);
+ msg(version_buildtype);
list_lua_version();
#ifndef NDEBUG
- MSG(version_cflags);
+ msg(version_cflags);
#endif
#ifdef HAVE_PATHDEF
if ((*compiled_user != NUL) || (*compiled_sys != NUL)) {
- MSG_PUTS(_("\nCompiled "));
+ msg_puts(_("\nCompiled "));
if (*compiled_user != NUL) {
- MSG_PUTS(_("by "));
- MSG_PUTS(compiled_user);
+ msg_puts(_("by "));
+ msg_puts((const char *)compiled_user);
}
if (*compiled_sys != NUL) {
- MSG_PUTS("@");
- MSG_PUTS(compiled_sys);
+ msg_puts("@");
+ msg_puts((const char *)compiled_sys);
}
}
#endif // ifdef HAVE_PATHDEF
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 8a33525338..be49d3e574 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -292,7 +292,7 @@ newwindow:
// move window to new tab page
case 'T':
if (one_window()) {
- MSG(_(m_onlyone));
+ msg(_(m_onlyone));
} else {
tabpage_T *oldtab = curtab;
tabpage_T *newtab;
@@ -3529,7 +3529,7 @@ void close_others(int message, int forceit)
if (one_window() && !lastwin->w_floating) {
if (message
&& !autocmd_busy) {
- MSG(_(m_onlyone));
+ msg(_(m_onlyone));
}
return;
}