aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 62a4d48645..165bfd1677 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -362,7 +362,7 @@ static bool do_incsearch_highlighting(int firstc, int *search_delim, incsearch_s
bool delim_optional = false;
int delim;
char_u *end;
- char_u *dummy;
+ char *dummy;
exarg_T ea;
pos_T save_cursor;
bool use_last_pat;
@@ -2036,7 +2036,6 @@ static int command_line_handle_key(CommandLineState *s)
return command_line_not_changed(s);
-
case K_SELECT: // end of Select mode mapping - ignore
return command_line_not_changed(s);
@@ -2373,7 +2372,7 @@ static void abandon_cmdline(void)
if (msg_scrolled == 0) {
compute_cmdrow();
}
- MSG("");
+ msg("");
redraw_cmdline = true;
}
@@ -2462,7 +2461,8 @@ char *getcmdline_prompt(const char firstc, const char *const prompt, const int a
* Return TRUE when the text must not be changed and we can't switch to
* another window or buffer. Used when editing the command line etc.
*/
-int text_locked(void) {
+int text_locked(void)
+{
if (cmdwin_type != 0) {
return TRUE;
}
@@ -2475,10 +2475,11 @@ int text_locked(void) {
*/
void text_locked_msg(void)
{
- EMSG(_(get_text_locked_msg()));
+ emsg(_(get_text_locked_msg()));
}
-char_u *get_text_locked_msg(void) {
+char *get_text_locked_msg(void)
+{
if (cmdwin_type != 0) {
return e_cmdwin;
} else {
@@ -2491,7 +2492,7 @@ char_u *get_text_locked_msg(void) {
int curbuf_locked(void)
{
if (curbuf->b_ro_locked > 0) {
- EMSG(_("E788: Not allowed to edit another buffer now"));
+ emsg(_("E788: Not allowed to edit another buffer now"));
return TRUE;
}
return allbuf_locked();
@@ -2504,7 +2505,7 @@ int curbuf_locked(void)
int allbuf_locked(void)
{
if (allbuf_lock > 0) {
- EMSG(_("E811: Not allowed to change buffer information now"));
+ emsg(_("E811: Not allowed to change buffer information now"));
return TRUE;
}
return FALSE;
@@ -2625,8 +2626,8 @@ static void realloc_cmdbuff(int len)
char_u *p = ccline.cmdbuff;
alloc_cmdbuff(len); // will get some more
- /* There isn't always a NUL after the command, but it may need to be
- * there, thus copy up to the NUL and add a NUL. */
+ // There isn't always a NUL after the command, but it may need to be
+ // there, thus copy up to the NUL and add a NUL.
memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen);
ccline.cmdbuff[ccline.cmdlen] = NUL;
xfree(p);
@@ -2655,7 +2656,7 @@ void free_arshape_buf(void)
#endif
-enum { MAX_CB_ERRORS = 1 };
+enum { MAX_CB_ERRORS = 1, };
/// Color expression cmdline using built-in expressions parser
///
@@ -3427,24 +3428,24 @@ static bool cmdline_paste(int regname, bool literally, bool remcr)
bool allocated;
struct cmdline_info save_ccline;
- /* check for valid regname; also accept special characters for CTRL-R in
- * the command line */
+ // check for valid regname; also accept special characters for CTRL-R in
+ // the command line
if (regname != Ctrl_F && regname != Ctrl_P && regname != Ctrl_W
&& regname != Ctrl_A && regname != Ctrl_L
&& !valid_yank_reg(regname, false)) {
return FAIL;
}
- /* A register containing CTRL-R can cause an endless loop. Allow using
- * CTRL-C to break the loop. */
+ // A register containing CTRL-R can cause an endless loop. Allow using
+ // CTRL-C to break the loop.
line_breakcheck();
if (got_int) {
return FAIL;
}
- /* Need to save and restore ccline. And set "textlock" to avoid nasty
- * things like going to another buffer when evaluating an expression. */
+ // Need to save and restore ccline. And set "textlock" to avoid nasty
+ // things like going to another buffer when evaluating an expression.
save_cmdline(&save_ccline);
textlock++;
const bool i = get_spec_reg(regname, &arg, &allocated, true);
@@ -3763,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();
}
@@ -3968,12 +3969,12 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
* causing the pattern to be added, which has illegal characters.
*/
if (!(options & WILD_SILENT) && (options & WILD_LIST_NOTFOUND)) {
- EMSG2(_(e_nomatch2), str);
+ semsg(_(e_nomatch2), str);
}
#endif
} else if (xp->xp_numfiles == 0) {
if (!(options & WILD_SILENT)) {
- EMSG2(_(e_nomatch2), str);
+ semsg(_(e_nomatch2), str);
}
} else {
// Escape the matches for use on the command line.
@@ -4011,7 +4012,7 @@ char_u *ExpandOne(expand_T *xp, char_u *str, char_u *orig, int options, int mode
* (and possibly have to hit return to continue!).
*/
if (!(options & WILD_SILENT)) {
- EMSG(_(e_toomany));
+ emsg(_(e_toomany));
} else if (!(options & WILD_NO_BEEP)) {
beep_flush();
}
@@ -4366,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
@@ -4382,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; ) {
@@ -5606,7 +5607,6 @@ void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options)
}
-
/*********************************
* Command line history stuff *
*********************************/
@@ -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;
}
@@ -6238,7 +6238,7 @@ void ex_history(exarg_T *eap)
histype1 = 0;
histype2 = HIST_COUNT-1;
} else {
- EMSG(_(e_trailing));
+ emsg(_(e_trailing));
return;
}
} else {
@@ -6248,7 +6248,7 @@ void ex_history(exarg_T *eap)
end = arg;
}
if (!get_list_range(&end, &hisidx1, &hisidx2) || *end != NUL) {
- EMSG(_(e_trailing));
+ emsg(_(e_trailing));
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;
@@ -6411,8 +6411,8 @@ static int open_cmdwin(void)
}
}
- /* Replace the empty last line with the current command-line and put the
- * cursor there. */
+ // Replace the empty last line with the current command-line and put the
+ // cursor there.
ml_replace(curbuf->b_ml.ml_line_count, ccline.cmdbuff, true);
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
curwin->w_cursor.col = ccline.cmdpos;
@@ -6475,7 +6475,7 @@ static int open_cmdwin(void)
// this happens!
if (!win_valid(old_curwin) || !bufref_valid(&old_curbuf)) {
cmdwin_result = Ctrl_C;
- EMSG(_("E199: Active window or buffer deleted"));
+ emsg(_("E199: Active window or buffer deleted"));
} else {
// autocmds may abort script processing
if (aborting() && cmdwin_result != K_IGNORE) {