refactor: replace char_u #18429
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -413,7 +413,7 @@ String nvim_cmd(uint64_t channel_id, Dict(cmd) *cmd, Dict(cmd_opts) *opts, Error
|
||||
|
||||
// Simply pass the first argument (if it exists) as the arg pointer to `set_cmd_addr_type()`
|
||||
// since it only ever checks the first argument.
|
||||
set_cmd_addr_type(&ea, argc > 0 ? (char_u *)args[0] : NULL);
|
||||
set_cmd_addr_type(&ea, argc > 0 ? args[0] : NULL);
|
||||
|
||||
if (HAS_KEY(cmd->range)) {
|
||||
if (!(ea.argt & EX_RANGE)) {
|
||||
|
||||
+1
-1
@@ -2109,7 +2109,7 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
|
||||
bool highlights = false;
|
||||
|
||||
if (str.size < 2 || memcmp(str.data, "%!", 2)) {
|
||||
const char *const errmsg = check_stl_option((char_u *)str.data);
|
||||
const char *const errmsg = check_stl_option(str.data);
|
||||
if (errmsg) {
|
||||
api_set_error(err, kErrorTypeValidation, "%s", errmsg);
|
||||
return result;
|
||||
|
||||
+6
-6
@@ -174,7 +174,7 @@ static void aupat_show(AutoPat *ap, event_T event, int previous_group)
|
||||
}
|
||||
|
||||
msg_col = 4;
|
||||
msg_outtrans((char_u *)ap->pat);
|
||||
msg_outtrans(ap->pat);
|
||||
|
||||
for (AutoCmd *ac = ap->cmds; ac != NULL; ac = ac->next) {
|
||||
// skip removed commands
|
||||
@@ -195,10 +195,10 @@ static void aupat_show(AutoPat *ap, event_T event, int previous_group)
|
||||
size_t msglen = 100;
|
||||
char *msg = (char *)xmallocz(msglen);
|
||||
snprintf(msg, msglen, "%s [%s]", exec_to_string, ac->desc);
|
||||
msg_outtrans((char_u *)msg);
|
||||
msg_outtrans(msg);
|
||||
XFREE_CLEAR(msg);
|
||||
} else {
|
||||
msg_outtrans((char_u *)exec_to_string);
|
||||
msg_outtrans(exec_to_string);
|
||||
}
|
||||
XFREE_CLEAR(exec_to_string);
|
||||
if (p_verbose > 0) {
|
||||
@@ -471,7 +471,7 @@ void augroup_del(char *name, bool stupid_legacy_mode)
|
||||
FOR_ALL_AUEVENTS(event) {
|
||||
FOR_ALL_AUPATS_IN_EVENT(event, ap) {
|
||||
if (ap->group == i && ap->pat != NULL) {
|
||||
give_warning((char_u *)_("W19: Deleting augroup that is still in use"), true);
|
||||
give_warning(_("W19: Deleting augroup that is still in use"), true);
|
||||
map_put(String, int)(&map_augroup_name_to_id, cstr_as_string(name), AUGROUP_DELETED);
|
||||
augroup_map_del(ap->group, NULL);
|
||||
return;
|
||||
@@ -717,7 +717,7 @@ char *au_event_disable(char *what)
|
||||
} else {
|
||||
STRCAT(new_ei, what);
|
||||
}
|
||||
set_string_option_direct("ei", -1, (char_u *)new_ei, OPT_FREE, SID_NONE);
|
||||
set_string_option_direct("ei", -1, new_ei, OPT_FREE, SID_NONE);
|
||||
xfree(new_ei);
|
||||
|
||||
return save_ei;
|
||||
@@ -726,7 +726,7 @@ char *au_event_disable(char *what)
|
||||
void au_event_restore(char *old_ei)
|
||||
{
|
||||
if (old_ei != NULL) {
|
||||
set_string_option_direct("ei", -1, (char_u *)old_ei, OPT_FREE, SID_NONE);
|
||||
set_string_option_direct("ei", -1, old_ei, OPT_FREE, SID_NONE);
|
||||
xfree(old_ei);
|
||||
}
|
||||
}
|
||||
|
||||
+178
-189
File diff suppressed because it is too large
Load Diff
@@ -373,7 +373,7 @@ struct mapblock {
|
||||
/// Used for highlighting in the status line.
|
||||
typedef struct stl_hlrec stl_hlrec_t;
|
||||
struct stl_hlrec {
|
||||
char_u *start;
|
||||
char *start;
|
||||
int userhl; // 0: no HL, 1-9: User HL, < 0 for syn ID
|
||||
};
|
||||
|
||||
@@ -381,7 +381,7 @@ struct stl_hlrec {
|
||||
typedef struct stl_item stl_item_t;
|
||||
struct stl_item {
|
||||
// Where the item starts in the status line output buffer
|
||||
char_u *start;
|
||||
char *start;
|
||||
// Function to run for ClickFunc items.
|
||||
char *cmd;
|
||||
// The minimum width of the item
|
||||
|
||||
+3
-3
@@ -1393,7 +1393,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
|
||||
|
||||
while (old_size < repl_size && p > leader) {
|
||||
MB_PTR_BACK(leader, p);
|
||||
old_size += ptr2cells(p);
|
||||
old_size += ptr2cells((char *)p);
|
||||
}
|
||||
l = lead_repl_len - (int)(endp - p);
|
||||
if (l != 0) {
|
||||
@@ -1413,7 +1413,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
|
||||
|
||||
if (l > 1) {
|
||||
p -= l;
|
||||
if (ptr2cells(p) > 1) {
|
||||
if (ptr2cells((char *)p) > 1) {
|
||||
p[1] = ' ';
|
||||
l--;
|
||||
}
|
||||
@@ -1463,7 +1463,7 @@ int open_line(int dir, int flags, int second_line_indent, bool *did_do_comment)
|
||||
int l = utfc_ptr2len((char *)p);
|
||||
|
||||
if (l > 1) {
|
||||
if (ptr2cells(p) > 1) {
|
||||
if (ptr2cells((char *)p) > 1) {
|
||||
// Replace a double-wide char with
|
||||
// two spaces
|
||||
l--;
|
||||
|
||||
+9
-8
@@ -687,11 +687,12 @@ int char2cells(int c)
|
||||
/// @param p
|
||||
///
|
||||
/// @return number of display cells.
|
||||
int ptr2cells(const char_u *p)
|
||||
int ptr2cells(const char *p_in)
|
||||
{
|
||||
uint8_t *p = (uint8_t *)p_in;
|
||||
// For UTF-8 we need to look at more bytes if the first byte is >= 0x80.
|
||||
if (*p >= 0x80) {
|
||||
return utf_ptr2cells((char *)p);
|
||||
return utf_ptr2cells(p_in);
|
||||
}
|
||||
|
||||
// For DBCS we can tell the cell count from the first byte.
|
||||
@@ -706,9 +707,9 @@ int ptr2cells(const char_u *p)
|
||||
/// @param s
|
||||
///
|
||||
/// @return number of character cells.
|
||||
int vim_strsize(char_u *s)
|
||||
int vim_strsize(char *s)
|
||||
{
|
||||
return vim_strnsize(s, MAXCOL);
|
||||
return vim_strnsize((char_u *)s, MAXCOL);
|
||||
}
|
||||
|
||||
/// Return the number of character cells string "s[len]" will take on the
|
||||
@@ -726,7 +727,7 @@ int vim_strnsize(char_u *s, int len)
|
||||
int size = 0;
|
||||
while (*s != NUL && --len >= 0) {
|
||||
int l = utfc_ptr2len((char *)s);
|
||||
size += ptr2cells(s);
|
||||
size += ptr2cells((char *)s);
|
||||
s += l;
|
||||
len -= l - 1;
|
||||
}
|
||||
@@ -1332,10 +1333,10 @@ char_u *skip_to_newline(const char_u *const p)
|
||||
/// @param[out] nr Number read from the string.
|
||||
///
|
||||
/// @return true on success, false on error/overflow
|
||||
bool try_getdigits(char_u **pp, intmax_t *nr)
|
||||
bool try_getdigits(char **pp, intmax_t *nr)
|
||||
{
|
||||
errno = 0;
|
||||
*nr = strtoimax((char *)(*pp), (char **)pp, 10);
|
||||
*nr = strtoimax(*pp, pp, 10);
|
||||
if (errno == ERANGE && (*nr == INTMAX_MIN || *nr == INTMAX_MAX)) {
|
||||
return false;
|
||||
}
|
||||
@@ -1353,7 +1354,7 @@ bool try_getdigits(char_u **pp, intmax_t *nr)
|
||||
intmax_t getdigits(char_u **pp, bool strict, intmax_t def)
|
||||
{
|
||||
intmax_t number;
|
||||
int ok = try_getdigits(pp, &number);
|
||||
int ok = try_getdigits((char **)pp, &number);
|
||||
if (strict && !ok) {
|
||||
abort();
|
||||
}
|
||||
|
||||
+1
-1
@@ -687,7 +687,7 @@ void ex_breaklist(exarg_T *eap)
|
||||
for (int i = 0; i < dbg_breakp.ga_len; i++) {
|
||||
struct debuggy *bp = &BREAKP(i);
|
||||
if (bp->dbg_type == DBG_FILE) {
|
||||
home_replace(NULL, bp->dbg_name, NameBuff, MAXPATHL, true);
|
||||
home_replace(NULL, (char *)bp->dbg_name, (char *)NameBuff, MAXPATHL, true);
|
||||
}
|
||||
if (bp->dbg_type != DBG_EXPR) {
|
||||
smsg(_("%3d %s %s line %" PRId64),
|
||||
|
||||
+1
-2
@@ -1408,8 +1408,7 @@ void diff_win_options(win_T *wp, int addbuf)
|
||||
}
|
||||
wp->w_p_fdm_save = vim_strsave(wp->w_p_fdm);
|
||||
}
|
||||
set_string_option_direct("fdm", -1, (char_u *)"diff",
|
||||
OPT_LOCAL | OPT_FREE, 0);
|
||||
set_string_option_direct("fdm", -1, "diff", OPT_LOCAL | OPT_FREE, 0);
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
|
||||
|
||||
+2
-2
@@ -1846,7 +1846,7 @@ static void printdigraph(const digr_T *dp, result_T *previous)
|
||||
*p++ = dp->char2;
|
||||
*p++ = ' ';
|
||||
*p = NUL;
|
||||
msg_outtrans(buf);
|
||||
msg_outtrans((char *)buf);
|
||||
p = buf;
|
||||
|
||||
// add a space to draw a composing char on
|
||||
@@ -1863,7 +1863,7 @@ static void printdigraph(const digr_T *dp, result_T *previous)
|
||||
}
|
||||
assert(p >= buf);
|
||||
vim_snprintf((char *)p, sizeof(buf) - (size_t)(p - buf), " %3d", dp->result);
|
||||
msg_outtrans(buf);
|
||||
msg_outtrans((char *)buf);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-16
@@ -4223,7 +4223,7 @@ static int ins_compl_get_exp(pos_T *ini)
|
||||
msg_hist_off = true; // reset in msg_trunc_attr()
|
||||
vim_snprintf((char *)IObuff, IOSIZE, _("Scanning: %s"),
|
||||
ins_buf->b_fname == NULL
|
||||
? buf_spname(ins_buf)
|
||||
? (char_u *)buf_spname(ins_buf)
|
||||
: ins_buf->b_sfname == NULL
|
||||
? (char_u *)ins_buf->b_fname
|
||||
: ins_buf->b_sfname);
|
||||
@@ -4831,15 +4831,15 @@ static int ins_compl_next(int allow_get_expansion, int count, int insert_match,
|
||||
*/
|
||||
if (compl_shown_match->cp_fname != NULL) {
|
||||
char *lead = _("match in file");
|
||||
int space = sc_col - vim_strsize((char_u *)lead) - 2;
|
||||
char_u *s;
|
||||
char_u *e;
|
||||
int space = sc_col - vim_strsize(lead) - 2;
|
||||
char *s;
|
||||
char *e;
|
||||
|
||||
if (space > 0) {
|
||||
// We need the tail that fits. With double-byte encoding going
|
||||
// back from the end is very slow, thus go from the start and keep
|
||||
// the text that fits in "space" between "s" and "e".
|
||||
for (s = e = compl_shown_match->cp_fname; *e != NUL; MB_PTR_ADV(e)) {
|
||||
for (s = e = (char *)compl_shown_match->cp_fname; *e != NUL; MB_PTR_ADV(e)) {
|
||||
space -= ptr2cells(e);
|
||||
while (space < 0) {
|
||||
space += ptr2cells(s);
|
||||
@@ -4848,7 +4848,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);
|
||||
(char_u *)s > compl_shown_match->cp_fname ? "<" : "", s);
|
||||
msg((char *)IObuff);
|
||||
msg_hist_off = false;
|
||||
redraw_cmdline = false; // don't overwrite!
|
||||
@@ -6807,15 +6807,15 @@ void beginline(int flags)
|
||||
|
||||
int oneright(void)
|
||||
{
|
||||
char_u *ptr;
|
||||
char *ptr;
|
||||
int l;
|
||||
|
||||
if (virtual_active()) {
|
||||
pos_T prevpos = curwin->w_cursor;
|
||||
|
||||
// Adjust for multi-wide char (excluding TAB)
|
||||
ptr = get_cursor_pos_ptr();
|
||||
coladvance(getviscol() + ((*ptr != TAB && vim_isprintc(utf_ptr2char((char *)ptr))) ?
|
||||
ptr = (char *)get_cursor_pos_ptr();
|
||||
coladvance(getviscol() + ((*ptr != TAB && vim_isprintc(utf_ptr2char(ptr))) ?
|
||||
ptr2cells(ptr) : 1));
|
||||
curwin->w_set_curswant = true;
|
||||
// Return OK if the cursor moved, FAIL otherwise (at window edge).
|
||||
@@ -6823,12 +6823,12 @@ int oneright(void)
|
||||
|| prevpos.coladd != curwin->w_cursor.coladd) ? OK : FAIL;
|
||||
}
|
||||
|
||||
ptr = get_cursor_pos_ptr();
|
||||
ptr = (char *)get_cursor_pos_ptr();
|
||||
if (*ptr == NUL) {
|
||||
return FAIL; // already at the very end
|
||||
}
|
||||
|
||||
l = utfc_ptr2len((char *)ptr);
|
||||
l = utfc_ptr2len(ptr);
|
||||
|
||||
// move "l" bytes right, but don't end up on the NUL, unless 'virtualedit'
|
||||
// contains "onemore".
|
||||
@@ -6865,12 +6865,9 @@ int oneleft(void)
|
||||
}
|
||||
|
||||
if (curwin->w_cursor.coladd == 1) {
|
||||
char_u *ptr;
|
||||
|
||||
// Adjust for multi-wide char (not a TAB)
|
||||
ptr = get_cursor_pos_ptr();
|
||||
if (*ptr != TAB && vim_isprintc(utf_ptr2char((char *)ptr))
|
||||
&& ptr2cells(ptr) > 1) {
|
||||
char *ptr = (char *)get_cursor_pos_ptr();
|
||||
if (*ptr != TAB && vim_isprintc(utf_ptr2char(ptr)) && ptr2cells(ptr) > 1) {
|
||||
curwin->w_cursor.coladd = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -8968,7 +8968,7 @@ static void list_one_var_a(const char *prefix, const char *name, const ptrdiff_t
|
||||
msg_putchar(' ');
|
||||
}
|
||||
|
||||
msg_outtrans((char_u *)string);
|
||||
msg_outtrans((char *)string);
|
||||
|
||||
if (type == VAR_FUNC || type == VAR_PARTIAL) {
|
||||
msg_puts("()");
|
||||
@@ -10124,7 +10124,7 @@ repeat:
|
||||
os_dirname((char_u *)dirname, MAXPATHL);
|
||||
if (has_homerelative) {
|
||||
s = xstrdup(dirname);
|
||||
home_replace(NULL, (char_u *)s, (char_u *)dirname, MAXPATHL, true);
|
||||
home_replace(NULL, s, dirname, MAXPATHL, true);
|
||||
xfree(s);
|
||||
}
|
||||
size_t namelen = STRLEN(dirname);
|
||||
@@ -10147,7 +10147,7 @@ repeat:
|
||||
}
|
||||
}
|
||||
} else {
|
||||
home_replace(NULL, (char_u *)p, (char_u *)dirname, MAXPATHL, true);
|
||||
home_replace(NULL, p, dirname, MAXPATHL, true);
|
||||
// Only replace it when it starts with '~'
|
||||
if (*dirname == '~') {
|
||||
s = xstrdup(dirname);
|
||||
|
||||
@@ -10688,7 +10688,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
// "./…" => "/home/foo/…"
|
||||
vim_FullName(cwd, (char *)NameBuff, sizeof(NameBuff), false);
|
||||
// "/home/foo/…" => "~/…"
|
||||
size_t len = home_replace(NULL, NameBuff, IObuff, sizeof(IObuff), true);
|
||||
size_t len = home_replace(NULL, (char *)NameBuff, (char *)IObuff, sizeof(IObuff), true);
|
||||
// Trim slash.
|
||||
if (len != 1 && (IObuff[len - 1] == '\\' || IObuff[len - 1] == '/')) {
|
||||
IObuff[len - 1] = '\0';
|
||||
@@ -10706,7 +10706,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
// at this point the buffer has no terminal instance associated yet, so unset
|
||||
// the 'swapfile' option to ensure no swap file will be created
|
||||
curbuf->b_p_swf = false;
|
||||
(void)setfname(curbuf, NameBuff, NULL, true);
|
||||
(void)setfname(curbuf, (char *)NameBuff, NULL, true);
|
||||
// Save the job id and pid in b:terminal_job_{id,pid}
|
||||
Error err = ERROR_INIT;
|
||||
// deprecated: use 'channel' buffer option
|
||||
|
||||
@@ -1044,9 +1044,8 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
|
||||
if (tofree != NULL) {
|
||||
char *s = tofree;
|
||||
char buf[MSG_BUF_LEN];
|
||||
if (vim_strsize((char_u *)s) > MSG_BUF_CLEN) {
|
||||
trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN,
|
||||
sizeof(buf));
|
||||
if (vim_strsize(s) > MSG_BUF_CLEN) {
|
||||
trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN, sizeof(buf));
|
||||
s = buf;
|
||||
}
|
||||
msg_puts(s);
|
||||
@@ -1159,7 +1158,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
|
||||
char *tofree = s;
|
||||
emsg_off--;
|
||||
if (s != NULL) {
|
||||
if (vim_strsize((char_u *)s) > MSG_BUF_CLEN) {
|
||||
if (vim_strsize(s) > MSG_BUF_CLEN) {
|
||||
trunc_string((char_u *)s, (char_u *)buf, MSG_BUF_CLEN, MSG_BUF_LEN);
|
||||
s = buf;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ int socket_watcher_init(Loop *loop, SocketWatcher *watcher, const char *endpoint
|
||||
char *port = host_end + 1;
|
||||
intmax_t iport;
|
||||
|
||||
int ok = try_getdigits(&(char_u *){ (char_u *)port }, &iport);
|
||||
int ok = try_getdigits(&(char *){ port }, &iport);
|
||||
if (!ok || iport < 0 || iport > UINT16_MAX) {
|
||||
ELOG("Invalid port: %s", port);
|
||||
return UV_EINVAL;
|
||||
|
||||
+14
-20
@@ -876,8 +876,7 @@ void ex_retab(exarg_T *eap)
|
||||
long *old_vts_ary = curbuf->b_p_vts_array;
|
||||
|
||||
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1) {
|
||||
set_string_option_direct("vts", -1, (char_u *)new_ts_str,
|
||||
OPT_FREE | OPT_LOCAL, 0);
|
||||
set_string_option_direct("vts", -1, new_ts_str, OPT_FREE | OPT_LOCAL, 0);
|
||||
curbuf->b_p_vts_array = new_vts_array;
|
||||
xfree(old_vts_ary);
|
||||
} else {
|
||||
@@ -1232,7 +1231,7 @@ void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out
|
||||
msg_start();
|
||||
msg_putchar(':');
|
||||
msg_putchar('!');
|
||||
msg_outtrans((char_u *)newcmd);
|
||||
msg_outtrans(newcmd);
|
||||
msg_clr_eos();
|
||||
ui_cursor_goto(msg_row, msg_col);
|
||||
|
||||
@@ -1738,7 +1737,7 @@ int rename_buffer(char *new_fname)
|
||||
xfname = curbuf->b_fname;
|
||||
curbuf->b_ffname = NULL;
|
||||
curbuf->b_sfname = NULL;
|
||||
if (setfname(curbuf, (char_u *)new_fname, NULL, true) == FAIL) {
|
||||
if (setfname(curbuf, new_fname, NULL, true) == FAIL) {
|
||||
curbuf->b_ffname = (char_u *)fname;
|
||||
curbuf->b_sfname = (char_u *)sfname;
|
||||
return FAIL;
|
||||
@@ -2218,7 +2217,7 @@ int getfile(int fnum, char *ffname_arg, char *sfname_arg, int setpm, linenr_T ln
|
||||
|
||||
if (fnum == 0) {
|
||||
// make ffname full path, set sfname
|
||||
fname_expand(curbuf, (char_u **)&ffname, (char_u **)&sfname);
|
||||
fname_expand(curbuf, &ffname, &sfname);
|
||||
other = otherfile((char_u *)ffname);
|
||||
free_me = ffname; // has been allocated, free() later
|
||||
} else {
|
||||
@@ -4453,8 +4452,7 @@ skip:
|
||||
// Show 'inccommand' preview if there are matched lines.
|
||||
if (cmdpreview && !aborting()) {
|
||||
if (got_quit || profile_passed_limit(timeout)) { // Too slow, disable.
|
||||
set_string_option_direct("icm", -1, (char_u *)"", OPT_FREE,
|
||||
SID_NONE);
|
||||
set_string_option_direct("icm", -1, "", OPT_FREE, SID_NONE);
|
||||
} else if (*p_icm != NUL && pat != NULL) {
|
||||
if (pre_hl_id == 0) {
|
||||
pre_hl_id = syn_check_group(S_LEN("Substitute"));
|
||||
@@ -4742,7 +4740,7 @@ bool prepare_tagpreview(bool undo_sync)
|
||||
and 'cursorbind' */
|
||||
curwin->w_p_diff = false; // no 'diff'
|
||||
set_string_option_direct("fdc", -1, // no 'foldcolumn'
|
||||
(char_u *)"0", OPT_FREE, SID_NONE);
|
||||
"0", OPT_FREE, SID_NONE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -5272,8 +5270,7 @@ int find_help_tags(const char *arg, int *num_matches, char ***matches, bool keep
|
||||
static void prepare_help_buffer(void)
|
||||
{
|
||||
curbuf->b_help = true;
|
||||
set_string_option_direct("buftype", -1, (char_u *)"help",
|
||||
OPT_FREE|OPT_LOCAL, 0);
|
||||
set_string_option_direct("buftype", -1, "help", OPT_FREE|OPT_LOCAL, 0);
|
||||
|
||||
// Always set these options after jumping to a help tag, because the
|
||||
// user may have an autocommand that gets in the way.
|
||||
@@ -5282,14 +5279,13 @@ static void prepare_help_buffer(void)
|
||||
// Only set it when needed, buf_init_chartab() is some work.
|
||||
char *p = "!-~,^*,^|,^\",192-255";
|
||||
if (STRCMP(curbuf->b_p_isk, p) != 0) {
|
||||
set_string_option_direct("isk", -1, (char_u *)p, OPT_FREE|OPT_LOCAL, 0);
|
||||
set_string_option_direct("isk", -1, p, OPT_FREE|OPT_LOCAL, 0);
|
||||
check_buf_options(curbuf);
|
||||
(void)buf_init_chartab(curbuf, FALSE);
|
||||
}
|
||||
|
||||
// Don't use the global foldmethod.
|
||||
set_string_option_direct("fdm", -1, (char_u *)"manual",
|
||||
OPT_FREE|OPT_LOCAL, 0);
|
||||
set_string_option_direct("fdm", -1, "manual", OPT_FREE|OPT_LOCAL, 0);
|
||||
|
||||
curbuf->b_p_ts = 8; // 'tabstop' is 8.
|
||||
curwin->w_p_list = FALSE; // No list mode.
|
||||
@@ -5375,7 +5371,7 @@ void fix_help_buffer(void)
|
||||
copy_option_part((char_u **)&p, NameBuff, MAXPATHL, ",");
|
||||
char *const rt = vim_getenv("VIMRUNTIME");
|
||||
if (rt != NULL
|
||||
&& path_full_compare((char_u *)rt, NameBuff, false, true) != kEqualFiles) {
|
||||
&& path_full_compare(rt, (char *)NameBuff, false, true) != kEqualFiles) {
|
||||
int fcount;
|
||||
char **fnames;
|
||||
char *s;
|
||||
@@ -5582,8 +5578,7 @@ static void helptags_one(char *dir, const char *ext, const char *tagfname, bool
|
||||
// add the "help-tags" tag.
|
||||
ga_init(&ga, (int)sizeof(char_u *), 100);
|
||||
if (add_help_tags
|
||||
|| path_full_compare((char_u *)"$VIMRUNTIME/doc",
|
||||
(char_u *)dir, false, true) == kEqualFiles) {
|
||||
|| path_full_compare("$VIMRUNTIME/doc", dir, false, true) == kEqualFiles) {
|
||||
size_t s_len = 18 + STRLEN(tagfname);
|
||||
s = xmalloc(s_len);
|
||||
snprintf(s, s_len, "help-tags\t%s\t1\n", tagfname);
|
||||
@@ -5874,8 +5869,7 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
|
||||
buf_T *cmdpreview_buf = NULL;
|
||||
|
||||
// disable file info message
|
||||
set_string_option_direct("shm", -1, (char_u *)"F", OPT_FREE,
|
||||
SID_NONE);
|
||||
set_string_option_direct("shm", -1, "F", OPT_FREE, SID_NONE);
|
||||
|
||||
// Update the topline to ensure that main window is on the correct line
|
||||
update_topline(curwin);
|
||||
@@ -5977,7 +5971,7 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i
|
||||
|
||||
xfree(str);
|
||||
|
||||
set_string_option_direct("shm", -1, (char_u *)save_shm_p, OPT_FREE, SID_NONE);
|
||||
set_string_option_direct("shm", -1, save_shm_p, OPT_FREE, SID_NONE);
|
||||
xfree(save_shm_p);
|
||||
|
||||
return preview ? 2 : 1;
|
||||
@@ -6077,7 +6071,7 @@ void ex_oldfiles(exarg_T *eap)
|
||||
if (!message_filtered((char_u *)fname)) {
|
||||
msg_outnum(nr);
|
||||
msg_puts(": ");
|
||||
msg_outtrans((char_u *)tv_get_string(TV_LIST_ITEM_TV(li)));
|
||||
msg_outtrans((char *)tv_get_string(TV_LIST_ITEM_TV(li)));
|
||||
msg_clr_eos();
|
||||
msg_putchar('\n');
|
||||
ui_flush(); // output one line at a time
|
||||
|
||||
+11
-11
@@ -732,7 +732,7 @@ bool check_changed_any(bool hidden, bool unload)
|
||||
if ((buf->terminal && channel_job_running((uint64_t)buf->b_p_channel))
|
||||
? semsg(_("E947: Job still running in buffer \"%s\""), buf->b_fname)
|
||||
: semsg(_("E162: No write since last change for buffer \"%s\""),
|
||||
buf_spname(buf) != NULL ? buf_spname(buf) : (char_u *)buf->b_fname)) {
|
||||
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname)) {
|
||||
save = no_wait_return;
|
||||
no_wait_return = false;
|
||||
wait_return(false);
|
||||
@@ -929,8 +929,7 @@ static int do_arglist(char *str, int what, int after, bool will_edit)
|
||||
|
||||
didone = false;
|
||||
for (match = 0; match < ARGCOUNT; match++) {
|
||||
if (vim_regexec(®match, alist_name(&ARGLIST[match]),
|
||||
(colnr_T)0)) {
|
||||
if (vim_regexec(®match, (char_u *)alist_name(&ARGLIST[match]), (colnr_T)0)) {
|
||||
didone = true;
|
||||
xfree(ARGLIST[match].ae_fname);
|
||||
memmove(ARGLIST + match, ARGLIST + match + 1,
|
||||
@@ -993,7 +992,8 @@ static bool editing_arg_idx(win_T *win)
|
||||
!= WARGLIST(win)[win->w_arg_idx].ae_fnum
|
||||
&& (win->w_buffer->b_ffname == NULL
|
||||
|| !(path_full_compare(alist_name(&WARGLIST(win)[win->w_arg_idx]),
|
||||
win->w_buffer->b_ffname, true, true) & kEqualFiles))));
|
||||
(char *)win->w_buffer->b_ffname, true,
|
||||
true) & kEqualFiles))));
|
||||
}
|
||||
|
||||
/// Check if window "win" is editing the w_arg_idx file in its argument list.
|
||||
@@ -1011,7 +1011,7 @@ void check_arg_idx(win_T *win)
|
||||
&& (win->w_buffer->b_fnum == GARGLIST[GARGCOUNT - 1].ae_fnum
|
||||
|| (win->w_buffer->b_ffname != NULL
|
||||
&& (path_full_compare(alist_name(&GARGLIST[GARGCOUNT - 1]),
|
||||
win->w_buffer->b_ffname, true, true)
|
||||
(char *)win->w_buffer->b_ffname, true, true)
|
||||
& kEqualFiles)))) {
|
||||
arg_had_last = true;
|
||||
}
|
||||
@@ -1050,7 +1050,7 @@ void ex_args(exarg_T *eap)
|
||||
// required and no wait_return().
|
||||
gotocmdline(true);
|
||||
for (int i = 0; i < ARGCOUNT; i++) {
|
||||
items[i] = (char *)alist_name(&ARGLIST[i]);
|
||||
items[i] = alist_name(&ARGLIST[i]);
|
||||
}
|
||||
list_in_columns((char_u **)items, ARGCOUNT, curwin->w_arg_idx);
|
||||
xfree(items);
|
||||
@@ -1137,7 +1137,7 @@ void do_argfile(exarg_T *eap, int argn)
|
||||
// the same buffer
|
||||
other = true;
|
||||
if (buf_hide(curbuf)) {
|
||||
p = fix_fname((char *)alist_name(&ARGLIST[argn]));
|
||||
p = fix_fname(alist_name(&ARGLIST[argn]));
|
||||
other = otherfile((char_u *)p);
|
||||
xfree(p);
|
||||
}
|
||||
@@ -1159,7 +1159,7 @@ void do_argfile(exarg_T *eap, int argn)
|
||||
// Edit the file; always use the last known line number.
|
||||
// When it fails (e.g. Abort for already edited file) restore the
|
||||
// argument index.
|
||||
if (do_ecmd(0, (char *)alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
|
||||
if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
|
||||
eap, ECMD_LAST,
|
||||
(buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0)
|
||||
+ (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL) {
|
||||
@@ -1568,7 +1568,7 @@ char *get_arglist_name(expand_T *xp FUNC_ATTR_UNUSED, int idx)
|
||||
if (idx >= ARGCOUNT) {
|
||||
return NULL;
|
||||
}
|
||||
return (char *)alist_name(&ARGLIST[idx]);
|
||||
return alist_name(&ARGLIST[idx]);
|
||||
}
|
||||
|
||||
/// ":compiler[!] {name}"
|
||||
@@ -2206,11 +2206,11 @@ void ex_scriptnames(exarg_T *eap)
|
||||
|
||||
for (int i = 1; i <= script_items.ga_len && !got_int; i++) {
|
||||
if (SCRIPT_ITEM(i).sn_name != NULL) {
|
||||
home_replace(NULL, SCRIPT_ITEM(i).sn_name, NameBuff, MAXPATHL, true);
|
||||
home_replace(NULL, (char *)SCRIPT_ITEM(i).sn_name, (char *)NameBuff, MAXPATHL, true);
|
||||
vim_snprintf((char *)IObuff, IOSIZE, "%3d: %s", i, NameBuff);
|
||||
if (!message_filtered(IObuff)) {
|
||||
msg_putchar('\n');
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
line_breakcheck();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ typedef struct {
|
||||
int cmod_verbose; ///< 0 if not set, > 0 to set 'verbose' to cmod_verbose - 1
|
||||
|
||||
// values for undo_cmdmod()
|
||||
char_u *cmod_save_ei; ///< saved value of 'eventignore'
|
||||
char *cmod_save_ei; ///< saved value of 'eventignore'
|
||||
int cmod_did_sandbox; ///< set when "sandbox" was incremented
|
||||
long cmod_verbose_save; ///< if 'verbose' was set: value of p_verbose plus one
|
||||
int cmod_save_msg_silent; ///< if non-zero: saved value of msg_silent + 1
|
||||
|
||||
+12
-12
@@ -1212,7 +1212,7 @@ static char *skip_colon_white(const char *p, bool skipleadingwhite)
|
||||
/// Set the addr type for command
|
||||
///
|
||||
/// @param p pointer to character after command name in cmdline
|
||||
void set_cmd_addr_type(exarg_T *eap, char_u *p)
|
||||
void set_cmd_addr_type(exarg_T *eap, char *p)
|
||||
{
|
||||
// ea.addr_type for user commands is set by find_ucmd
|
||||
if (IS_USER_CMDIDX(eap->cmdidx)) {
|
||||
@@ -1225,7 +1225,7 @@ void set_cmd_addr_type(exarg_T *eap, char_u *p)
|
||||
}
|
||||
// :wincmd range depends on the argument
|
||||
if (eap->cmdidx == CMD_wincmd && p != NULL) {
|
||||
get_wincmd_addr_type(skipwhite((char *)p), eap);
|
||||
get_wincmd_addr_type(skipwhite(p), eap);
|
||||
}
|
||||
// :.cc in quickfix window uses line number
|
||||
if ((eap->cmdidx == CMD_cc || eap->cmdidx == CMD_ll) && bt_quickfix(curbuf)) {
|
||||
@@ -1453,7 +1453,7 @@ bool parse_cmdline(char *cmdline, exarg_T *eap, CmdParseInfo *cmdinfo, char **er
|
||||
}
|
||||
|
||||
// Set command address type and parse command range
|
||||
set_cmd_addr_type(eap, (char_u *)p);
|
||||
set_cmd_addr_type(eap, p);
|
||||
eap->cmd = cmd;
|
||||
if (parse_cmd_address(eap, errormsg, false) == FAIL) {
|
||||
return false;
|
||||
@@ -1824,7 +1824,7 @@ static char *do_one_cmd(char **cmdlinep, int flags, cstack_T *cstack, LineGetter
|
||||
// The ea.cmd pointer is updated to point to the first character following the
|
||||
// range spec. If an initial address is found, but no second, the upper bound
|
||||
// is equal to the lower.
|
||||
set_cmd_addr_type(&ea, (char_u *)p);
|
||||
set_cmd_addr_type(&ea, p);
|
||||
|
||||
ea.cmd = cmd;
|
||||
if (parse_cmd_address(&ea, &errormsg, false) == FAIL) {
|
||||
@@ -2667,8 +2667,8 @@ static void apply_cmdmod(cmdmod_T *cmod)
|
||||
if ((cmod->cmod_flags & CMOD_NOAUTOCMD) && cmod->cmod_save_ei == NULL) {
|
||||
// Set 'eventignore' to "all".
|
||||
// First save the existing option value for restoring it later.
|
||||
cmod->cmod_save_ei = vim_strsave(p_ei);
|
||||
set_string_option_direct("ei", -1, (char_u *)"all", OPT_FREE, SID_NONE);
|
||||
cmod->cmod_save_ei = (char *)vim_strsave(p_ei);
|
||||
set_string_option_direct("ei", -1, "all", OPT_FREE, SID_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2688,7 +2688,7 @@ static void undo_cmdmod(cmdmod_T *cmod)
|
||||
|
||||
if (cmod->cmod_save_ei != NULL) {
|
||||
// Restore 'eventignore' to the value before ":noautocmd".
|
||||
set_string_option_direct("ei", -1, (char_u *)cmod->cmod_save_ei, OPT_FREE, SID_NONE);
|
||||
set_string_option_direct("ei", -1, cmod->cmod_save_ei, OPT_FREE, SID_NONE);
|
||||
free_string_option((char_u *)cmod->cmod_save_ei);
|
||||
cmod->cmod_save_ei = NULL;
|
||||
}
|
||||
@@ -5804,7 +5804,7 @@ static void uc_list(char *name, size_t name_len)
|
||||
} while (len < 25 - over);
|
||||
|
||||
IObuff[len] = '\0';
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
|
||||
msg_outtrans_special(cmd->uc_rep, false,
|
||||
name_len == 0 ? Columns - 47 : 0);
|
||||
@@ -7574,7 +7574,7 @@ static void ex_recover(exarg_T *eap)
|
||||
| CCGD_EXCMD)
|
||||
|
||||
&& (*eap->arg == NUL
|
||||
|| setfname(curbuf, (char_u *)eap->arg, NULL, true) == OK)) {
|
||||
|| setfname(curbuf, eap->arg, NULL, true) == OK)) {
|
||||
ml_recover(true);
|
||||
}
|
||||
recoverymode = false;
|
||||
@@ -7762,9 +7762,9 @@ static void ex_tabs(exarg_T *eap)
|
||||
if (buf_spname(wp->w_buffer) != NULL) {
|
||||
STRLCPY(IObuff, buf_spname(wp->w_buffer), IOSIZE);
|
||||
} else {
|
||||
home_replace(wp->w_buffer, (char_u *)wp->w_buffer->b_fname, IObuff, IOSIZE, true);
|
||||
home_replace(wp->w_buffer, wp->w_buffer->b_fname, (char *)IObuff, IOSIZE, true);
|
||||
}
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
ui_flush(); // output one line at a time
|
||||
os_breakcheck();
|
||||
}
|
||||
@@ -9646,7 +9646,7 @@ static char *arg_all(void)
|
||||
for (;;) {
|
||||
len = 0;
|
||||
for (idx = 0; idx < ARGCOUNT; idx++) {
|
||||
p = (char *)alist_name(&ARGLIST[idx]);
|
||||
p = alist_name(&ARGLIST[idx]);
|
||||
if (p == NULL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+9
-11
@@ -952,8 +952,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent, bool init
|
||||
need_wait_return = false;
|
||||
}
|
||||
|
||||
set_string_option_direct("icm", -1, s->save_p_icm, OPT_FREE,
|
||||
SID_NONE);
|
||||
set_string_option_direct("icm", -1, (char *)s->save_p_icm, OPT_FREE, SID_NONE);
|
||||
State = s->save_State;
|
||||
if (cmdpreview != save_cmdpreview) {
|
||||
cmdpreview = save_cmdpreview; // restore preview state
|
||||
@@ -2751,7 +2750,7 @@ static int cmdline_charsize(int idx)
|
||||
if (cmdline_star > 0) { // showing '*', always 1 position
|
||||
return 1;
|
||||
}
|
||||
return ptr2cells(ccline.cmdbuff + idx);
|
||||
return ptr2cells((char *)ccline.cmdbuff + idx);
|
||||
}
|
||||
|
||||
/// Compute the offset of the cursor on the command line for the prompt and
|
||||
@@ -3554,7 +3553,7 @@ void put_on_cmdline(char_u *str, int len, int redraw)
|
||||
}
|
||||
if (i != 0) {
|
||||
// Also backup the cursor position.
|
||||
i = ptr2cells(ccline.cmdbuff + ccline.cmdpos);
|
||||
i = ptr2cells((char *)ccline.cmdbuff + ccline.cmdpos);
|
||||
ccline.cmdspos -= i;
|
||||
msg_col -= i;
|
||||
if (msg_col < 0) {
|
||||
@@ -4551,10 +4550,10 @@ static int showmatches(expand_T *xp, int wildmenu)
|
||||
if (!showtail && (xp->xp_context == EXPAND_FILES
|
||||
|| xp->xp_context == EXPAND_SHELLCMD
|
||||
|| xp->xp_context == EXPAND_BUFFERS)) {
|
||||
home_replace(NULL, files_found[i], NameBuff, MAXPATHL, TRUE);
|
||||
j = vim_strsize(NameBuff);
|
||||
home_replace(NULL, (char *)files_found[i], (char *)NameBuff, MAXPATHL, true);
|
||||
j = vim_strsize((char *)NameBuff);
|
||||
} else {
|
||||
j = vim_strsize(L_SHOWFILE(i));
|
||||
j = vim_strsize((char *)L_SHOWFILE(i));
|
||||
}
|
||||
if (j > maxlen) {
|
||||
maxlen = j;
|
||||
@@ -4621,8 +4620,7 @@ static int showmatches(expand_T *xp, int wildmenu)
|
||||
if (showtail) {
|
||||
p = L_SHOWFILE(k);
|
||||
} else {
|
||||
home_replace(NULL, files_found[k], NameBuff, MAXPATHL,
|
||||
TRUE);
|
||||
home_replace(NULL, (char *)files_found[k], (char *)NameBuff, MAXPATHL, true);
|
||||
p = NameBuff;
|
||||
}
|
||||
} else {
|
||||
@@ -6536,13 +6534,13 @@ void ex_history(exarg_T *eap)
|
||||
msg_putchar('\n');
|
||||
snprintf((char *)IObuff, IOSIZE, "%c%6d ", i == idx ? '>' : ' ',
|
||||
hist[i].hisnum);
|
||||
if (vim_strsize(hist[i].hisstr) > Columns - 10) {
|
||||
if (vim_strsize((char *)hist[i].hisstr) > Columns - 10) {
|
||||
trunc_string(hist[i].hisstr, IObuff + STRLEN(IObuff),
|
||||
Columns - 10, IOSIZE - (int)STRLEN(IObuff));
|
||||
} else {
|
||||
STRCAT(IObuff, hist[i].hisstr);
|
||||
}
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
ui_flush();
|
||||
}
|
||||
if (i == idx) {
|
||||
|
||||
@@ -215,7 +215,7 @@ static int ses_arglist(FILE *fd, char *cmd, garray_T *gap, int fullname, unsigne
|
||||
}
|
||||
for (int i = 0; i < gap->ga_len; i++) {
|
||||
// NULL file names are skipped (only happens when out of memory).
|
||||
s = alist_name(&((aentry_T *)gap->ga_data)[i]);
|
||||
s = (char_u *)alist_name(&((aentry_T *)gap->ga_data)[i]);
|
||||
if (s != NULL) {
|
||||
if (fullname) {
|
||||
buf = xmalloc(MAXPATHL);
|
||||
|
||||
+4
-5
@@ -1697,7 +1697,7 @@ failed:
|
||||
save_file_ff(curbuf);
|
||||
// If editing a new file: set 'fenc' for the current buffer.
|
||||
// Also for ":read ++edit file".
|
||||
set_string_option_direct("fenc", -1, (char_u *)fenc, OPT_FREE | OPT_LOCAL, 0);
|
||||
set_string_option_direct("fenc", -1, fenc, OPT_FREE | OPT_LOCAL, 0);
|
||||
}
|
||||
if (fenc_alloced) {
|
||||
xfree(fenc);
|
||||
@@ -2057,7 +2057,7 @@ void set_forced_fenc(exarg_T *eap)
|
||||
{
|
||||
if (eap->force_enc != 0) {
|
||||
char_u *fenc = enc_canonize((char_u *)eap->cmd + eap->force_enc);
|
||||
set_string_option_direct("fenc", -1, fenc, OPT_FREE|OPT_LOCAL, 0);
|
||||
set_string_option_direct("fenc", -1, (char *)fenc, OPT_FREE|OPT_LOCAL, 0);
|
||||
xfree(fenc);
|
||||
}
|
||||
}
|
||||
@@ -3765,7 +3765,7 @@ static int set_rw_fname(char_u *fname, char_u *sfname)
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (setfname(curbuf, fname, sfname, false) == OK) {
|
||||
if (setfname(curbuf, (char *)fname, (char *)sfname, false) == OK) {
|
||||
curbuf->b_flags |= BF_NOTEDITED;
|
||||
}
|
||||
|
||||
@@ -3805,8 +3805,7 @@ static void add_quoted_fname(char *const ret_buf, const size_t buf_len, const bu
|
||||
fname = "-stdin-";
|
||||
}
|
||||
ret_buf[0] = '"';
|
||||
home_replace(buf, (const char_u *)fname, (char_u *)ret_buf + 1,
|
||||
(int)buf_len - 4, true);
|
||||
home_replace(buf, fname, ret_buf + 1, (int)buf_len - 4, true);
|
||||
xstrlcat(ret_buf, "\" ", buf_len);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1813,7 +1813,7 @@ char_u *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume, foldinfo_T foldin
|
||||
p += len - 1;
|
||||
} else if (*p == TAB) {
|
||||
*p = ' ';
|
||||
} else if (ptr2cells(p) > 1) {
|
||||
} else if (ptr2cells((char *)p) > 1) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -2501,7 +2501,7 @@ static int vgetorpeek(bool advance)
|
||||
&& State != MODE_HITRETURN) {
|
||||
// this looks nice when typing a dead character map
|
||||
if (State & MODE_INSERT
|
||||
&& ptr2cells(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len - 1) == 1) {
|
||||
&& ptr2cells((char *)typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len - 1) == 1) {
|
||||
edit_putchar(typebuf.tb_buf[typebuf.tb_off + typebuf.tb_len - 1], false);
|
||||
setcursor(); // put cursor back where it belongs
|
||||
c1 = 1;
|
||||
@@ -2524,9 +2524,9 @@ static int vgetorpeek(bool advance)
|
||||
|
||||
// this looks nice when typing a dead character map
|
||||
if ((State & MODE_CMDLINE) && cmdline_star == 0) {
|
||||
char_u *p = typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len - 1;
|
||||
if (ptr2cells(p) == 1 && *p < 128) {
|
||||
putcmdline((char)(*p), false);
|
||||
char *p = (char *)typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len - 1;
|
||||
if (ptr2cells(p) == 1 && (uint8_t)(*p) < 128) {
|
||||
putcmdline(*p, false);
|
||||
c1 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -658,7 +658,7 @@ void ex_hardcopy(exarg_T *eap)
|
||||
* PS.)
|
||||
*/
|
||||
if (mch_print_init(&settings,
|
||||
curbuf->b_fname == NULL ? buf_spname(curbuf) : curbuf->b_sfname ==
|
||||
curbuf->b_fname == NULL ? (char_u *)buf_spname(curbuf) : curbuf->b_sfname ==
|
||||
NULL ? (char_u *)curbuf->b_fname : curbuf->b_sfname, eap->forceit) == FAIL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -811,7 +811,7 @@ void do_highlight(const char *line, const bool forceit, const bool init)
|
||||
|
||||
// ":highlight {group-name}": list highlighting for one group.
|
||||
if (!doclear && !dolink && ends_excmd((uint8_t)(*linep))) {
|
||||
id = syn_name2id_len((const char_u *)line, (size_t)(name_end - line));
|
||||
id = syn_name2id_len(line, (size_t)(name_end - line));
|
||||
if (id == 0) {
|
||||
semsg(_("E411: highlight group not found: %s"), line);
|
||||
} else {
|
||||
@@ -1389,7 +1389,7 @@ static void highlight_list_one(const int id)
|
||||
didh = true;
|
||||
msg_puts_attr("links to", HL_ATTR(HLF_D));
|
||||
msg_putchar(' ');
|
||||
msg_outtrans(hl_table[hl_table[id - 1].sg_link - 1].sg_name);
|
||||
msg_outtrans((char *)hl_table[hl_table[id - 1].sg_link - 1].sg_name);
|
||||
}
|
||||
|
||||
if (!didh) {
|
||||
@@ -1450,14 +1450,14 @@ static bool highlight_list_arg(const int id, bool didh, const int type, int iarg
|
||||
}
|
||||
}
|
||||
|
||||
(void)syn_list_header(didh, vim_strsize((char_u *)ts) + (int)STRLEN(name) + 1, id, false);
|
||||
(void)syn_list_header(didh, vim_strsize((char *)ts) + (int)STRLEN(name) + 1, id, false);
|
||||
didh = true;
|
||||
if (!got_int) {
|
||||
if (*name != NUL) {
|
||||
msg_puts_attr(name, HL_ATTR(HLF_D));
|
||||
msg_puts_attr("=", HL_ATTR(HLF_D));
|
||||
}
|
||||
msg_outtrans((char_u *)ts);
|
||||
msg_outtrans((char *)ts);
|
||||
}
|
||||
}
|
||||
return didh;
|
||||
@@ -1581,7 +1581,7 @@ bool syn_list_header(const bool did_header, const int outlen, const int id, bool
|
||||
if (got_int) {
|
||||
return true;
|
||||
}
|
||||
msg_outtrans(hl_table[id - 1].sg_name);
|
||||
msg_outtrans((char *)hl_table[id - 1].sg_name);
|
||||
name_col = msg_col;
|
||||
endcol = 15;
|
||||
} else if ((ui_has(kUIMessages) || msg_silent) && !force_newline) {
|
||||
@@ -1650,14 +1650,14 @@ static void set_hl_attr(int idx)
|
||||
int syn_name2id(const char *name)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
return syn_name2id_len((char_u *)name, STRLEN(name));
|
||||
return syn_name2id_len(name, STRLEN(name));
|
||||
}
|
||||
|
||||
/// Lookup a highlight group name and return its ID.
|
||||
///
|
||||
/// @param highlight name e.g. 'Cursor', 'Normal'
|
||||
/// @return the highlight id, else 0 if \p name does not exist
|
||||
int syn_name2id_len(const char_u *name, size_t len)
|
||||
int syn_name2id_len(const char *name, size_t len)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
{
|
||||
char name_u[MAX_SYN_NAME + 1];
|
||||
@@ -1719,7 +1719,7 @@ int syn_check_group(const char *name, size_t len)
|
||||
emsg(_(e_highlight_group_name_too_long));
|
||||
return 0;
|
||||
}
|
||||
int id = syn_name2id_len((char_u *)name, len);
|
||||
int id = syn_name2id_len(name, len);
|
||||
if (id == 0) { // doesn't exist yet
|
||||
return syn_add_group(name, len);
|
||||
}
|
||||
@@ -1735,7 +1735,7 @@ static int syn_add_group(const char *name, size_t len)
|
||||
{
|
||||
// Check that the name is ASCII letters, digits and underscore.
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
int c = (int8_t)name[i];
|
||||
int c = (uint8_t)name[i];
|
||||
if (!vim_isprintc(c)) {
|
||||
emsg(_("E669: Unprintable character in group name"));
|
||||
return 0;
|
||||
|
||||
@@ -1078,7 +1078,7 @@ static int cs_help(exarg_T *eap)
|
||||
(void)msg_puts(_("cscope commands:\n"));
|
||||
while (cmdp->name != NULL) {
|
||||
char *help = _(cmdp->help);
|
||||
int space_cnt = 30 - vim_strsize((char_u *)help);
|
||||
int space_cnt = 30 - vim_strsize(help);
|
||||
|
||||
// Use %*s rather than %30s to ensure proper alignment in utf-8
|
||||
if (space_cnt < 0) {
|
||||
|
||||
+3
-3
@@ -75,7 +75,7 @@ int get_indent_str(const char_u *ptr, int ts, bool list)
|
||||
} else {
|
||||
// In list mode, when tab is not set, count screen char width
|
||||
// for Tab, displays: ^I
|
||||
count += ptr2cells(ptr);
|
||||
count += ptr2cells((char *)ptr);
|
||||
}
|
||||
} else if (*ptr == ' ') {
|
||||
// Count a space for one.
|
||||
@@ -101,7 +101,7 @@ int get_indent_str_vtab(const char_u *ptr, long ts, long *vts, bool list)
|
||||
} else {
|
||||
// In list mode, when tab is not set, count screen char width
|
||||
// for Tab, displays: ^I
|
||||
count += ptr2cells(ptr);
|
||||
count += ptr2cells((char *)ptr);
|
||||
}
|
||||
} else if (*ptr == ' ') {
|
||||
count++; // count a space for one
|
||||
@@ -481,7 +481,7 @@ int get_breakindent_win(win_T *wp, char_u *line)
|
||||
|
||||
// indent minus the length of the showbreak string
|
||||
if (wp->w_briopt_sbr) {
|
||||
bri -= vim_strsize(get_showbreak_value(wp));
|
||||
bri -= vim_strsize((char *)get_showbreak_value(wp));
|
||||
}
|
||||
|
||||
// never indent past left window margin
|
||||
|
||||
+5
-6
@@ -2049,9 +2049,9 @@ int get_c_indent(void)
|
||||
if (!cin_iscomment(theline) && comment_pos != NULL) { // XXX
|
||||
int lead_start_len = 2;
|
||||
int lead_middle_len = 1;
|
||||
char_u lead_start[COM_MAX_LEN]; // start-comment string
|
||||
char_u lead_middle[COM_MAX_LEN]; // middle-comment string
|
||||
char_u lead_end[COM_MAX_LEN]; // end-comment string
|
||||
char lead_start[COM_MAX_LEN]; // start-comment string
|
||||
char lead_middle[COM_MAX_LEN]; // middle-comment string
|
||||
char lead_end[COM_MAX_LEN]; // end-comment string
|
||||
char_u *p;
|
||||
int start_align = 0;
|
||||
int start_off = 0;
|
||||
@@ -2084,7 +2084,7 @@ int get_c_indent(void)
|
||||
if (*p == ':') {
|
||||
p++;
|
||||
}
|
||||
(void)copy_option_part(&p, lead_end, COM_MAX_LEN, ",");
|
||||
(void)copy_option_part(&p, (char_u *)lead_end, COM_MAX_LEN, ",");
|
||||
if (what == COM_START) {
|
||||
STRCPY(lead_start, lead_end);
|
||||
lead_start_len = (int)STRLEN(lead_start);
|
||||
@@ -2120,8 +2120,7 @@ int get_c_indent(void)
|
||||
if (start_off != 0) {
|
||||
amount += start_off;
|
||||
} else if (start_align == COM_RIGHT) {
|
||||
amount += vim_strsize(lead_start)
|
||||
- vim_strsize(lead_middle);
|
||||
amount += vim_strsize(lead_start) - vim_strsize(lead_middle);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+7
-11
@@ -1357,9 +1357,8 @@ scripterror:
|
||||
char_u *p = vim_strsave((char_u *)argv[0]);
|
||||
|
||||
if (parmp->diff_mode && os_isdir(p) && GARGCOUNT > 0
|
||||
&& !os_isdir(alist_name(&GARGLIST[0]))) {
|
||||
char_u *r = (char_u *)concat_fnames((char *)p,
|
||||
path_tail((char *)alist_name(&GARGLIST[0])), true);
|
||||
&& !os_isdir((char_u *)alist_name(&GARGLIST[0]))) {
|
||||
char_u *r = (char_u *)concat_fnames((char *)p, path_tail(alist_name(&GARGLIST[0])), true);
|
||||
xfree(p);
|
||||
p = r;
|
||||
}
|
||||
@@ -1477,7 +1476,7 @@ static void init_path(const char *exename)
|
||||
/// Get filename from command line, if any.
|
||||
static char_u *get_fname(mparm_T *parmp, char_u *cwd)
|
||||
{
|
||||
return alist_name(&GARGLIST[0]);
|
||||
return (char_u *)alist_name(&GARGLIST[0]);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1502,7 +1501,7 @@ static void handle_quickfix(mparm_T *paramp)
|
||||
{
|
||||
if (paramp->edit_type == EDIT_QF) {
|
||||
if (paramp->use_ef != NULL) {
|
||||
set_string_option_direct("ef", -1, (char_u *)paramp->use_ef, OPT_FREE, SID_CARG);
|
||||
set_string_option_direct("ef", -1, paramp->use_ef, OPT_FREE, SID_CARG);
|
||||
}
|
||||
vim_snprintf((char *)IObuff, IOSIZE, "cfile %s", p_ef);
|
||||
if (qf_init(NULL, (char *)p_ef, p_efm, true, (char *)IObuff, (char *)p_menc) < 0) {
|
||||
@@ -1743,7 +1742,7 @@ static void edit_buffers(mparm_T *parmp, char_u *cwd)
|
||||
// at the ATTENTION prompt close the window.
|
||||
swap_exists_did_quit = false;
|
||||
(void)do_ecmd(0, arg_idx < GARGCOUNT
|
||||
? (char *)alist_name(&GARGLIST[arg_idx])
|
||||
? alist_name(&GARGLIST[arg_idx])
|
||||
: NULL, NULL, NULL, ECMD_LASTL, ECMD_HIDE, curwin);
|
||||
if (swap_exists_did_quit) {
|
||||
// abort or quit selected
|
||||
@@ -1946,9 +1945,7 @@ static bool do_user_initialization(void)
|
||||
if (do_source((char *)user_vimrc, true, DOSO_VIMRC) != FAIL) {
|
||||
do_exrc = p_exrc;
|
||||
if (do_exrc) {
|
||||
do_exrc = (path_full_compare((char_u *)VIMRC_FILE, user_vimrc,
|
||||
false, true)
|
||||
!= kEqualFiles);
|
||||
do_exrc = (path_full_compare(VIMRC_FILE, (char *)user_vimrc, false, true) != kEqualFiles);
|
||||
}
|
||||
xfree(user_vimrc);
|
||||
return do_exrc;
|
||||
@@ -1974,8 +1971,7 @@ static bool do_user_initialization(void)
|
||||
if (do_source(vimrc, true, DOSO_VIMRC) != FAIL) {
|
||||
do_exrc = p_exrc;
|
||||
if (do_exrc) {
|
||||
do_exrc = (path_full_compare((char_u *)VIMRC_FILE, (char_u *)vimrc,
|
||||
false, true) != kEqualFiles);
|
||||
do_exrc = (path_full_compare(VIMRC_FILE, vimrc, false, true) != kEqualFiles);
|
||||
}
|
||||
xfree(vimrc);
|
||||
xfree(config_dirs);
|
||||
|
||||
+1
-1
@@ -2324,7 +2324,7 @@ void ex_map(exarg_T *eap)
|
||||
// print the mappings for security reasons.
|
||||
if (secure) {
|
||||
secure = 2;
|
||||
msg_outtrans((char_u *)eap->cmd);
|
||||
msg_outtrans(eap->cmd);
|
||||
msg_putchar('\n');
|
||||
}
|
||||
do_exmap(eap, false);
|
||||
|
||||
+5
-5
@@ -637,7 +637,7 @@ static char_u *mark_line(pos_T *mp, int lead_len)
|
||||
// Truncate the line to fit it in the window
|
||||
len = 0;
|
||||
for (p = s; *p != NUL; MB_PTR_ADV(p)) {
|
||||
len += ptr2cells(p);
|
||||
len += ptr2cells((char *)p);
|
||||
if (len >= Columns - lead_len) {
|
||||
break;
|
||||
}
|
||||
@@ -733,7 +733,7 @@ static void show_one_mark(int c, char_u *arg, pos_T *p, char_u *name_arg, int cu
|
||||
msg_putchar('\n');
|
||||
if (!got_int) {
|
||||
snprintf((char *)IObuff, IOSIZE, " %c %6" PRIdLINENR " %4d ", c, p->lnum, p->col);
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
if (name != NULL) {
|
||||
msg_outtrans_attr(name, current ? HL_ATTR(HLF_D) : 0);
|
||||
}
|
||||
@@ -864,7 +864,7 @@ void ex_jumps(exarg_T *eap)
|
||||
i == curwin->w_jumplistidx ? '>' : ' ',
|
||||
i > curwin->w_jumplistidx ? i - curwin->w_jumplistidx : curwin->w_jumplistidx - i,
|
||||
curwin->w_jumplist[i].fmark.mark.lnum, curwin->w_jumplist[i].fmark.mark.col);
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
msg_outtrans_attr(name,
|
||||
curwin->w_jumplist[i].fmark.fnum == curbuf->b_fnum
|
||||
? HL_ATTR(HLF_D) : 0);
|
||||
@@ -908,7 +908,7 @@ void ex_changes(exarg_T *eap)
|
||||
: curwin->w_changelistidx - i,
|
||||
(long)curbuf->b_changelist[i].mark.lnum,
|
||||
curbuf->b_changelist[i].mark.col);
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
name = mark_line(&curbuf->b_changelist[i].mark, 17);
|
||||
msg_outtrans_attr(name, HL_ATTR(HLF_D));
|
||||
xfree(name);
|
||||
@@ -1578,7 +1578,7 @@ void mark_mb_adjustpos(buf_T *buf, pos_T *lp)
|
||||
if (lp->coladd == 1
|
||||
&& p[lp->col] != TAB
|
||||
&& vim_isprintc(utf_ptr2char((char *)p + lp->col))
|
||||
&& ptr2cells(p + lp->col) > 1) {
|
||||
&& ptr2cells((char *)p + lp->col) > 1) {
|
||||
lp->coladd = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -2012,7 +2012,7 @@ void mb_check_adjust_col(void *win_)
|
||||
|
||||
// Column 0 is always valid.
|
||||
if (oldcol != 0) {
|
||||
char_u *p = ml_get_buf(win->w_buffer, win->w_cursor.lnum, false);
|
||||
char *p = (char *)ml_get_buf(win->w_buffer, win->w_cursor.lnum, false);
|
||||
colnr_T len = (colnr_T)STRLEN(p);
|
||||
|
||||
// Empty line or invalid column?
|
||||
@@ -2024,13 +2024,13 @@ void mb_check_adjust_col(void *win_)
|
||||
win->w_cursor.col = len - 1;
|
||||
}
|
||||
// Move the cursor to the head byte.
|
||||
win->w_cursor.col -= utf_head_off(p, p + win->w_cursor.col);
|
||||
win->w_cursor.col -= utf_head_off((char_u *)p, (char_u *)p + win->w_cursor.col);
|
||||
}
|
||||
|
||||
// Reset `coladd` when the cursor would be on the right half of a
|
||||
// double-wide character.
|
||||
if (win->w_cursor.coladd == 1 && p[win->w_cursor.col] != TAB
|
||||
&& vim_isprintc(utf_ptr2char((char *)p + win->w_cursor.col))
|
||||
&& vim_isprintc(utf_ptr2char(p + win->w_cursor.col))
|
||||
&& ptr2cells(p + win->w_cursor.col) > 1) {
|
||||
win->w_cursor.coladd = 0;
|
||||
}
|
||||
|
||||
+15
-16
@@ -531,7 +531,7 @@ void ml_open_file(buf_T *buf)
|
||||
need_wait_return = true; // call wait_return later
|
||||
no_wait_return++;
|
||||
(void)semsg(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
|
||||
buf_spname(buf) != NULL ? buf_spname(buf) : (char_u *)buf->b_fname);
|
||||
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname);
|
||||
no_wait_return--;
|
||||
}
|
||||
|
||||
@@ -665,8 +665,8 @@ static void set_b0_fname(ZERO_BL *b0p, buf_T *buf)
|
||||
* First replace home dir path with "~/" with home_replace().
|
||||
* Then insert the user name to get "~user/".
|
||||
*/
|
||||
home_replace(NULL, buf->b_ffname, b0p->b0_fname,
|
||||
B0_FNAME_SIZE_CRYPT, TRUE);
|
||||
home_replace(NULL, (char *)buf->b_ffname, (char *)b0p->b0_fname,
|
||||
B0_FNAME_SIZE_CRYPT, true);
|
||||
if (b0p->b0_fname[0] == '~') {
|
||||
// If there is no user name or it is too long, don't use "~/"
|
||||
int retval = os_get_user_name(uname, B0_UNAME_SIZE);
|
||||
@@ -933,18 +933,18 @@ void ml_recover(bool checkext)
|
||||
*/
|
||||
if (directly) {
|
||||
expand_env(b0p->b0_fname, NameBuff, MAXPATHL);
|
||||
if (setfname(curbuf, NameBuff, NULL, true) == FAIL) {
|
||||
if (setfname(curbuf, (char *)NameBuff, NULL, true) == FAIL) {
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
|
||||
home_replace(NULL, mfp->mf_fname, NameBuff, MAXPATHL, TRUE);
|
||||
home_replace(NULL, (char *)mfp->mf_fname, (char *)NameBuff, MAXPATHL, true);
|
||||
smsg(_("Using swap file \"%s\""), NameBuff);
|
||||
|
||||
if (buf_spname(curbuf) != NULL) {
|
||||
STRLCPY(NameBuff, buf_spname(curbuf), MAXPATHL);
|
||||
} else {
|
||||
home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE);
|
||||
home_replace(NULL, (char *)curbuf->b_ffname, (char *)NameBuff, MAXPATHL, true);
|
||||
}
|
||||
smsg(_("Original file \"%s\""), NameBuff);
|
||||
msg_putchar('\n');
|
||||
@@ -1377,7 +1377,7 @@ int recover_names(char_u *fname, int list, int nr, char_u **fname_out)
|
||||
for (int i = 0; i < num_files; i++) {
|
||||
// Do not expand wildcards, on Windows would try to expand
|
||||
// "%tmp%" in "%tmp%file"
|
||||
if (path_full_compare(p, files[i], true, false) & kEqualFiles) {
|
||||
if (path_full_compare((char *)p, (char *)files[i], true, false) & kEqualFiles) {
|
||||
// Remove the name from files[i]. Move further entries
|
||||
// down. When the array becomes empty free it here, since
|
||||
// FreeWild() won't be called below.
|
||||
@@ -1520,7 +1520,7 @@ static time_t swapfile_info(char_u *fname)
|
||||
// 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_outtrans((char_u *)uname);
|
||||
msg_outtrans(uname);
|
||||
msg_puts(_(" dated: "));
|
||||
} else
|
||||
#endif
|
||||
@@ -1547,7 +1547,7 @@ static time_t swapfile_info(char_u *fname)
|
||||
if (b0.b0_fname[0] == NUL) {
|
||||
msg_puts(_("[No Name]"));
|
||||
} else {
|
||||
msg_outtrans(b0.b0_fname);
|
||||
msg_outtrans((char *)b0.b0_fname);
|
||||
}
|
||||
|
||||
msg_puts(_("\n modified: "));
|
||||
@@ -1555,7 +1555,7 @@ static time_t swapfile_info(char_u *fname)
|
||||
|
||||
if (*(b0.b0_uname) != NUL) {
|
||||
msg_puts(_("\n user name: "));
|
||||
msg_outtrans(b0.b0_uname);
|
||||
msg_outtrans((char *)b0.b0_uname);
|
||||
}
|
||||
|
||||
if (*(b0.b0_hname) != NUL) {
|
||||
@@ -1564,7 +1564,7 @@ static time_t swapfile_info(char_u *fname)
|
||||
} else {
|
||||
msg_puts(_("\n host name: "));
|
||||
}
|
||||
msg_outtrans(b0.b0_hname);
|
||||
msg_outtrans((char *)b0.b0_hname);
|
||||
}
|
||||
|
||||
if (char_to_long(b0.b0_pid) != 0L) {
|
||||
@@ -3317,7 +3317,7 @@ static void attention_message(buf_T *buf, char_u *fname)
|
||||
msg_puts("\"\n");
|
||||
const time_t swap_mtime = swapfile_info(fname);
|
||||
msg_puts(_("While opening file \""));
|
||||
msg_outtrans((char_u *)buf->b_fname);
|
||||
msg_outtrans(buf->b_fname);
|
||||
msg_puts("\"\n");
|
||||
FileInfo file_info;
|
||||
if (!os_fileinfo(buf->b_fname, &file_info)) {
|
||||
@@ -3339,10 +3339,10 @@ static void attention_message(buf_T *buf, char_u *fname)
|
||||
" Quit, or continue with caution.\n"));
|
||||
msg_puts(_("(2) An edit session for this file crashed.\n"));
|
||||
msg_puts(_(" If this is the case, use \":recover\" or \"vim -r "));
|
||||
msg_outtrans((char_u *)buf->b_fname);
|
||||
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_outtrans(fname);
|
||||
msg_outtrans((char *)fname);
|
||||
msg_puts(_("\"\n to avoid this message.\n"));
|
||||
cmdline_row = msg_row;
|
||||
--no_wait_return;
|
||||
@@ -3552,8 +3552,7 @@ static char *findswapname(buf_T *buf, char **dirp, char *old_fname, bool *found_
|
||||
|
||||
char *const name = xmalloc(name_len);
|
||||
memcpy(name, sw_msg_1, sw_msg_1_len + 1);
|
||||
home_replace(NULL, (char_u *)fname, (char_u *)&name[sw_msg_1_len],
|
||||
fname_len, true);
|
||||
home_replace(NULL, fname, &name[sw_msg_1_len], fname_len, true);
|
||||
xstrlcat(name, sw_msg_2, name_len);
|
||||
choice = do_dialog(VIM_WARNING, (char_u *)_("VIM - ATTENTION"),
|
||||
(char_u *)name,
|
||||
|
||||
+15
-14
@@ -348,7 +348,7 @@ bool msg_attr_keep(const char *s, int attr, bool keep, bool multiline)
|
||||
}
|
||||
retval = msg_end();
|
||||
|
||||
if (keep && retval && vim_strsize((char_u *)s) < (Rows - cmdline_row - 1) * Columns + sc_col) {
|
||||
if (keep && retval && vim_strsize((char *)s) < (Rows - cmdline_row - 1) * Columns + sc_col) {
|
||||
set_keep_msg((char *)s, 0);
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ char_u *msg_strtrunc(char_u *s, int force)
|
||||
if ((!msg_scroll && !need_wait_return && shortmess(SHM_TRUNCALL)
|
||||
&& !exmode_active && msg_silent == 0 && !ui_has(kUIMessages))
|
||||
|| force) {
|
||||
len = vim_strsize(s);
|
||||
len = vim_strsize((char *)s);
|
||||
if (msg_scrolled != 0) {
|
||||
// Use all the columns.
|
||||
room = (Rows - msg_row) * Columns - 1;
|
||||
@@ -423,7 +423,7 @@ void trunc_string(char_u *s, char_u *buf, int room_in, int buflen)
|
||||
buf[e] = NUL;
|
||||
return;
|
||||
}
|
||||
n = ptr2cells(s + e);
|
||||
n = ptr2cells((char *)s + e);
|
||||
if (len + n > half) {
|
||||
break;
|
||||
}
|
||||
@@ -443,7 +443,7 @@ void trunc_string(char_u *s, char_u *buf, int room_in, int buflen)
|
||||
do {
|
||||
half = half - utf_head_off(s, s + half - 1) - 1;
|
||||
} while (half > 0 && utf_iscomposing(utf_ptr2char((char *)s + half)));
|
||||
n = ptr2cells(s + half);
|
||||
n = ptr2cells((char *)s + half);
|
||||
if (len + n > room || half == 0) {
|
||||
break;
|
||||
}
|
||||
@@ -892,7 +892,7 @@ char_u *msg_may_trunc(bool force, char_u *s)
|
||||
room = (Rows - cmdline_row - 1) * Columns + sc_col - 1;
|
||||
if ((force || (shortmess(SHM_TRUNC) && !exmode_active))
|
||||
&& (int)STRLEN(s) - room > 0) {
|
||||
int size = vim_strsize(s);
|
||||
int size = vim_strsize((char *)s);
|
||||
|
||||
// There may be room anyway when there are multibyte chars.
|
||||
if (size <= room) {
|
||||
@@ -1275,7 +1275,7 @@ void wait_return(int redraw)
|
||||
emsg_on_display = false; // can delete error message now
|
||||
lines_left = -1; // reset lines_left at next msg_start()
|
||||
reset_last_sourcing();
|
||||
if (keep_msg != NULL && vim_strsize(keep_msg) >=
|
||||
if (keep_msg != NULL && vim_strsize((char *)keep_msg) >=
|
||||
(Rows - cmdline_row - 1) * Columns + sc_col) {
|
||||
XFREE_CLEAR(keep_msg); // don't redisplay message, it's too long
|
||||
}
|
||||
@@ -1489,9 +1489,9 @@ static void msg_home_replace_attr(char_u *fname, int attr)
|
||||
/// Use attributes 'attr'.
|
||||
///
|
||||
/// @return the number of characters it takes on the screen.
|
||||
int msg_outtrans(char_u *str)
|
||||
int msg_outtrans(char *str)
|
||||
{
|
||||
return msg_outtrans_attr(str, 0);
|
||||
return msg_outtrans_attr((char_u *)str, 0);
|
||||
}
|
||||
|
||||
int msg_outtrans_attr(const char_u *str, int attr)
|
||||
@@ -1654,7 +1654,7 @@ int msg_outtrans_special(const char_u *strstart, bool from, int maxlen)
|
||||
// single-byte character or illegal byte
|
||||
text = (char *)transchar_byte((uint8_t)text[0]);
|
||||
}
|
||||
const int len = vim_strsize((char_u *)text);
|
||||
const int len = vim_strsize((char *)text);
|
||||
if (maxlen > 0 && retval + len >= maxlen) {
|
||||
break;
|
||||
}
|
||||
@@ -3027,7 +3027,7 @@ void msg_moremsg(int full)
|
||||
if (full) {
|
||||
grid_puts(&msg_grid_adj, (char_u *)
|
||||
_(" SPACE/d/j: screen/page/line down, b/u/k: up, q: quit "),
|
||||
Rows - 1, vim_strsize(s), attr);
|
||||
Rows - 1, vim_strsize((char *)s), attr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3376,7 +3376,8 @@ int verbose_open(void)
|
||||
|
||||
/// Give a warning message (for searching).
|
||||
/// Use 'w' highlighting and may repeat the message after redrawing
|
||||
void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1)
|
||||
void give_warning(char *message, bool hl)
|
||||
FUNC_ATTR_NONNULL_ARG(1)
|
||||
{
|
||||
// Don't do this for ":silent".
|
||||
if (msg_silent != 0) {
|
||||
@@ -3386,7 +3387,7 @@ void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1)
|
||||
// Don't want a hit-enter prompt here.
|
||||
no_wait_return++;
|
||||
|
||||
set_vim_var_string(VV_WARNINGMSG, (char *)message, -1);
|
||||
set_vim_var_string(VV_WARNINGMSG, message, -1);
|
||||
XFREE_CLEAR(keep_msg);
|
||||
if (hl) {
|
||||
keep_msg_attr = HL_ATTR(HLF_W);
|
||||
@@ -3399,7 +3400,7 @@ void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1)
|
||||
}
|
||||
|
||||
if (msg_attr((const char *)message, keep_msg_attr) && msg_scrolled == 0) {
|
||||
set_keep_msg((char *)message, keep_msg_attr);
|
||||
set_keep_msg(message, keep_msg_attr);
|
||||
}
|
||||
msg_didout = false; // Overwrite this message.
|
||||
msg_nowait = true; // Don't wait for this message.
|
||||
@@ -3411,7 +3412,7 @@ void give_warning(char_u *message, bool hl) FUNC_ATTR_NONNULL_ARG(1)
|
||||
void give_warning2(char_u *const message, char_u *const a1, bool hl)
|
||||
{
|
||||
vim_snprintf((char *)IObuff, IOSIZE, (char *)message, a1);
|
||||
give_warning(IObuff, hl);
|
||||
give_warning((char *)IObuff, hl);
|
||||
}
|
||||
|
||||
/// Advance msg cursor to column "col".
|
||||
|
||||
+1
-1
@@ -802,7 +802,7 @@ void curs_columns(win_T *wp, int may_scroll)
|
||||
// column
|
||||
char *const sbr = (char *)get_showbreak_value(wp);
|
||||
if (*sbr && *get_cursor_pos_ptr() == NUL
|
||||
&& wp->w_wcol == vim_strsize((char_u *)sbr)) {
|
||||
&& wp->w_wcol == vim_strsize(sbr)) {
|
||||
wp->w_wcol = 0;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3287,7 +3287,7 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
|
||||
validate_virtcol();
|
||||
colnr_T virtcol = curwin->w_virtcol;
|
||||
if (virtcol > (colnr_T)width1 && *get_showbreak_value(curwin) != NUL) {
|
||||
virtcol -= vim_strsize(get_showbreak_value(curwin));
|
||||
virtcol -= vim_strsize((char *)get_showbreak_value(curwin));
|
||||
}
|
||||
|
||||
int c = utf_ptr2char((char *)get_cursor_pos_ptr());
|
||||
|
||||
+2
-2
@@ -3847,7 +3847,7 @@ void ex_display(exarg_T *eap)
|
||||
n -= 2;
|
||||
}
|
||||
for (p = (char_u *)yb->y_array[j];
|
||||
*p != NUL && (n -= ptr2cells(p)) >= 0; p++) { // -V1019
|
||||
*p != NUL && (n -= ptr2cells((char *)p)) >= 0; p++) { // -V1019
|
||||
clen = utfc_ptr2len((char *)p);
|
||||
msg_outtrans_len(p, clen);
|
||||
p += clen - 1;
|
||||
@@ -3925,7 +3925,7 @@ static void dis_msg(const char_u *p, bool skip_esc)
|
||||
n = Columns - 6;
|
||||
while (*p != NUL
|
||||
&& !(*p == ESC && skip_esc && *(p + 1) == NUL)
|
||||
&& (n -= ptr2cells(p)) >= 0) {
|
||||
&& (n -= ptr2cells((char *)p)) >= 0) {
|
||||
if ((l = utfc_ptr2len((char *)p)) > 1) {
|
||||
msg_outtrans_len(p, l);
|
||||
p += l;
|
||||
|
||||
+44
-49
@@ -621,7 +621,7 @@ static void set_option_default(int opt_idx, int opt_flags)
|
||||
// freeing and allocating the value.
|
||||
if (options[opt_idx].indir != PV_NONE) {
|
||||
set_string_option_direct(NULL, opt_idx,
|
||||
options[opt_idx].def_val, opt_flags, 0);
|
||||
(char *)options[opt_idx].def_val, opt_flags, 0);
|
||||
} else {
|
||||
if ((opt_flags & OPT_FREE) && (flags & P_ALLOCED)) {
|
||||
free_string_option(*(char_u **)(varp));
|
||||
@@ -944,7 +944,7 @@ void ex_set(exarg_T *eap)
|
||||
if (eap->forceit) {
|
||||
flags |= OPT_ONECOLUMN;
|
||||
}
|
||||
(void)do_set((char_u *)eap->arg, flags);
|
||||
(void)do_set(eap->arg, flags);
|
||||
}
|
||||
|
||||
/// Parse 'arg' for option settings.
|
||||
@@ -962,7 +962,7 @@ void ex_set(exarg_T *eap)
|
||||
/// @param arg option string (may be written to!)
|
||||
///
|
||||
/// @return FAIL if an error is detected, OK otherwise
|
||||
int do_set(char_u *arg, int opt_flags)
|
||||
int do_set(char *arg, int opt_flags)
|
||||
{
|
||||
int opt_idx;
|
||||
char *errmsg;
|
||||
@@ -990,7 +990,7 @@ int do_set(char_u *arg, int opt_flags)
|
||||
|
||||
while (*arg != NUL) { // loop to process all options
|
||||
errmsg = NULL;
|
||||
startarg = arg; // remember for error message
|
||||
startarg = (char_u *)arg; // remember for error message
|
||||
|
||||
if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])
|
||||
&& !(opt_flags & OPT_MODELINE)) {
|
||||
@@ -1043,7 +1043,7 @@ int do_set(char_u *arg, int opt_flags)
|
||||
}
|
||||
len++;
|
||||
if (opt_idx == -1) {
|
||||
key = find_key_option(arg + 1, true);
|
||||
key = find_key_option((char_u *)arg + 1, true);
|
||||
}
|
||||
} else {
|
||||
len = 0;
|
||||
@@ -1057,12 +1057,12 @@ int do_set(char_u *arg, int opt_flags)
|
||||
}
|
||||
opt_idx = findoption_len((const char *)arg, (size_t)len);
|
||||
if (opt_idx == -1) {
|
||||
key = find_key_option(arg, false);
|
||||
key = find_key_option((char_u *)arg, false);
|
||||
}
|
||||
}
|
||||
|
||||
// remember character after option name
|
||||
afterchar = arg[len];
|
||||
afterchar = (uint8_t)arg[len];
|
||||
|
||||
// skip white space, allow ":set ai ?"
|
||||
while (ascii_iswhite(arg[len])) {
|
||||
@@ -1084,7 +1084,7 @@ int do_set(char_u *arg, int opt_flags)
|
||||
len++;
|
||||
}
|
||||
}
|
||||
nextchar = arg[len];
|
||||
nextchar = (uint8_t)arg[len];
|
||||
|
||||
if (opt_idx == -1 && key == 0) { // found a mismatch: skip
|
||||
errmsg = N_("E518: Unknown option");
|
||||
@@ -1282,14 +1282,14 @@ int do_set(char_u *arg, int opt_flags)
|
||||
|| *arg == '^'
|
||||
|| (*arg != NUL && (!arg[1] || ascii_iswhite(arg[1]))
|
||||
&& !ascii_isdigit(*arg)))) {
|
||||
value = string_to_key(arg);
|
||||
value = string_to_key((char_u *)arg);
|
||||
if (value == 0 && (long *)varp != &p_wcm) {
|
||||
errmsg = e_invarg;
|
||||
goto skip;
|
||||
}
|
||||
} else if (*arg == '-' || ascii_isdigit(*arg)) {
|
||||
// Allow negative, octal and hex numbers.
|
||||
vim_str2nr(arg, NULL, &i, STR2NR_ALL, &value, NULL, 0, true);
|
||||
vim_str2nr((char_u *)arg, NULL, &i, STR2NR_ALL, &value, NULL, 0, true);
|
||||
if (i == 0 || (arg[i] != NUL && !ascii_iswhite(arg[i]))) {
|
||||
errmsg = N_("E521: Number required after =");
|
||||
goto skip;
|
||||
@@ -1391,8 +1391,8 @@ int do_set(char_u *arg, int opt_flags)
|
||||
if (varp == (char_u *)&p_kp
|
||||
&& (*arg == NUL || *arg == ' ')) {
|
||||
STRCPY(errbuf, ":help");
|
||||
save_arg = arg;
|
||||
arg = (char_u *)errbuf;
|
||||
save_arg = (char_u *)arg;
|
||||
arg = errbuf;
|
||||
}
|
||||
/*
|
||||
* Convert 'backspace' number to string, for
|
||||
@@ -1435,7 +1435,7 @@ int do_set(char_u *arg, int opt_flags)
|
||||
else if (varp == (char_u *)&p_ww
|
||||
&& ascii_isdigit(*arg)) {
|
||||
*errbuf = NUL;
|
||||
i = getdigits_int(&arg, true, 0);
|
||||
i = getdigits_int((char_u **)&arg, true, 0);
|
||||
if (i & 1) {
|
||||
STRLCAT(errbuf, "b,", sizeof(errbuf));
|
||||
}
|
||||
@@ -1451,8 +1451,8 @@ int do_set(char_u *arg, int opt_flags)
|
||||
if (i & 16) {
|
||||
STRLCAT(errbuf, "[,],", sizeof(errbuf));
|
||||
}
|
||||
save_arg = arg;
|
||||
arg = (char_u *)errbuf;
|
||||
save_arg = (char_u *)arg;
|
||||
arg = errbuf;
|
||||
}
|
||||
/*
|
||||
* Remove '>' before 'dir' and 'bdir', for
|
||||
@@ -1498,14 +1498,14 @@ int do_set(char_u *arg, int opt_flags)
|
||||
) {
|
||||
arg++; // remove backslash
|
||||
}
|
||||
i = utfc_ptr2len((char *)arg);
|
||||
i = utfc_ptr2len(arg);
|
||||
if (i > 1) {
|
||||
// copy multibyte char
|
||||
memmove(s, arg, (size_t)i);
|
||||
arg += i;
|
||||
s += i;
|
||||
} else {
|
||||
*s++ = *arg++;
|
||||
*s++ = (uint8_t)(*arg++);
|
||||
}
|
||||
}
|
||||
*s = NUL;
|
||||
@@ -1622,7 +1622,7 @@ int do_set(char_u *arg, int opt_flags)
|
||||
}
|
||||
|
||||
if (save_arg != NULL) { // number for 'whichwrap'
|
||||
arg = save_arg;
|
||||
arg = (char *)save_arg;
|
||||
}
|
||||
new_value_alloced = true;
|
||||
}
|
||||
@@ -1710,7 +1710,7 @@ skip:
|
||||
arg++;
|
||||
}
|
||||
}
|
||||
arg = (char_u *)skipwhite((char *)arg);
|
||||
arg = skipwhite(arg);
|
||||
if (*arg != '=') {
|
||||
break;
|
||||
}
|
||||
@@ -1720,12 +1720,12 @@ skip:
|
||||
if (errmsg != NULL) {
|
||||
STRLCPY(IObuff, _(errmsg), IOSIZE);
|
||||
i = (int)STRLEN(IObuff) + 2;
|
||||
if (i + (arg - startarg) < IOSIZE) {
|
||||
if (i + ((char_u *)arg - startarg) < IOSIZE) {
|
||||
// append the argument with the error
|
||||
STRCAT(IObuff, ": ");
|
||||
assert(arg >= startarg);
|
||||
memmove(IObuff + i, startarg, (size_t)(arg - startarg));
|
||||
IObuff[i + (arg - startarg)] = NUL;
|
||||
assert((char_u *)arg >= startarg);
|
||||
memmove(IObuff + i, startarg, (size_t)((char_u *)arg - startarg));
|
||||
IObuff[i + ((char_u *)arg - startarg)] = NUL;
|
||||
}
|
||||
// make sure all characters are printable
|
||||
trans_characters(IObuff, IOSIZE);
|
||||
@@ -1737,7 +1737,7 @@ skip:
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
arg = (char_u *)skipwhite((char *)arg);
|
||||
arg = skipwhite(arg);
|
||||
}
|
||||
|
||||
theend:
|
||||
@@ -2181,11 +2181,11 @@ static int shada_idx = -1;
|
||||
/// "set_sid".
|
||||
///
|
||||
/// @param opt_flags OPT_FREE, OPT_LOCAL and/or OPT_GLOBAL
|
||||
void set_string_option_direct(const char *name, int opt_idx, const char_u *val, int opt_flags,
|
||||
void set_string_option_direct(const char *name, int opt_idx, const char *val, int opt_flags,
|
||||
int set_sid)
|
||||
{
|
||||
char_u *s;
|
||||
char_u **varp;
|
||||
char *s;
|
||||
char **varp;
|
||||
int both = (opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0;
|
||||
int idx = opt_idx;
|
||||
|
||||
@@ -2204,18 +2204,17 @@ void set_string_option_direct(const char *name, int opt_idx, const char_u *val,
|
||||
|
||||
assert((void *)options[idx].var != (void *)&p_shada);
|
||||
|
||||
s = vim_strsave(val);
|
||||
s = xstrdup(val);
|
||||
{
|
||||
varp = (char_u **)get_varp_scope(&(options[idx]),
|
||||
both ? OPT_LOCAL : opt_flags);
|
||||
varp = (char **)get_varp_scope(&(options[idx]), both ? OPT_LOCAL : opt_flags);
|
||||
if ((opt_flags & OPT_FREE) && (options[idx].flags & P_ALLOCED)) {
|
||||
free_string_option(*varp);
|
||||
free_string_option((char_u *)(*varp));
|
||||
}
|
||||
*varp = s;
|
||||
|
||||
// For buffer/window local option may also set the global value.
|
||||
if (both) {
|
||||
set_string_option_global(idx, varp);
|
||||
set_string_option_global(idx, (char_u **)varp);
|
||||
}
|
||||
|
||||
options[idx].flags |= P_ALLOCED;
|
||||
@@ -2223,8 +2222,8 @@ void set_string_option_direct(const char *name, int opt_idx, const char_u *val,
|
||||
/* When setting both values of a global option with a local value,
|
||||
* make the local value empty, so that the global value is used. */
|
||||
if (((int)options[idx].indir & PV_BOTH) && both) {
|
||||
free_string_option(*varp);
|
||||
*varp = empty_option;
|
||||
free_string_option((char_u *)(*varp));
|
||||
*varp = (char *)empty_option;
|
||||
}
|
||||
if (set_sid != SID_NONE) {
|
||||
sctx_T script_ctx;
|
||||
@@ -2814,7 +2813,7 @@ ambw_end:
|
||||
}
|
||||
} else if (gvarp == &p_sbr) { // 'showbreak'
|
||||
for (s = *varp; *s;) {
|
||||
if (ptr2cells(s) != 1) {
|
||||
if (ptr2cells((char *)s) != 1) {
|
||||
errmsg = N_("E595: 'showbreak' contains unprintable or wide character");
|
||||
}
|
||||
MB_PTR_ADV(s);
|
||||
@@ -2834,7 +2833,7 @@ ambw_end:
|
||||
int flagval = (varp == &p_titlestring) ? STL_IN_TITLE : STL_IN_ICON;
|
||||
|
||||
// NULL => statusline syntax
|
||||
if (vim_strchr((char *)(*varp), '%') && check_stl_option(*varp) == NULL) {
|
||||
if (vim_strchr((char *)(*varp), '%') && check_stl_option((char *)(*varp)) == NULL) {
|
||||
stl_syntax |= flagval;
|
||||
} else {
|
||||
stl_syntax &= ~flagval;
|
||||
@@ -2943,14 +2942,14 @@ ambw_end:
|
||||
s++;
|
||||
}
|
||||
wid = getdigits_int(&s, true, 0);
|
||||
if (wid && *s == '(' && (errmsg = check_stl_option(p_ruf)) == NULL) {
|
||||
if (wid && *s == '(' && (errmsg = check_stl_option((char *)p_ruf)) == NULL) {
|
||||
ru_wid = wid;
|
||||
} else {
|
||||
errmsg = check_stl_option(p_ruf);
|
||||
errmsg = check_stl_option((char *)p_ruf);
|
||||
}
|
||||
} else if (varp == &p_ruf || s[0] != '%' || s[1] != '!') {
|
||||
// check 'statusline', 'winbar' or 'tabline' only if it doesn't start with "%!"
|
||||
errmsg = check_stl_option(s);
|
||||
errmsg = check_stl_option((char *)s);
|
||||
}
|
||||
if (varp == &p_ruf && errmsg == NULL) {
|
||||
comp_col();
|
||||
@@ -3786,7 +3785,7 @@ static char *set_chars_option(win_T *wp, char_u **varp, bool set)
|
||||
|
||||
/// Check validity of options with the 'statusline' format.
|
||||
/// Return an untranslated error message or NULL.
|
||||
char *check_stl_option(char_u *s)
|
||||
char *check_stl_option(char *s)
|
||||
{
|
||||
int groupdepth = 0;
|
||||
static char errbuf[80];
|
||||
@@ -5325,7 +5324,7 @@ static void showoptions(int all, int opt_flags)
|
||||
len = 1; // a toggle option fits always
|
||||
} else {
|
||||
option_value2string(p, opt_flags);
|
||||
len = (int)STRLEN(p->fullname) + vim_strsize(NameBuff) + 1;
|
||||
len = (int)STRLEN(p->fullname) + vim_strsize((char *)NameBuff) + 1;
|
||||
}
|
||||
if ((len <= INC - GAP && run == 1)
|
||||
|| (len > INC - GAP && run == 2)) {
|
||||
@@ -5438,7 +5437,7 @@ static void showoneopt(vimoption_T *p, int opt_flags)
|
||||
msg_putchar('=');
|
||||
// put value string in NameBuff
|
||||
option_value2string(p, opt_flags);
|
||||
msg_outtrans(NameBuff);
|
||||
msg_outtrans((char *)NameBuff);
|
||||
}
|
||||
|
||||
silent_mode = save_silent;
|
||||
@@ -5631,7 +5630,7 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, uint6
|
||||
|
||||
// replace home directory in the whole option value into "buf"
|
||||
buf = xmalloc(size);
|
||||
home_replace(NULL, *valuep, buf, size, false);
|
||||
home_replace(NULL, (char *)(*valuep), (char *)buf, size, false);
|
||||
|
||||
// If the option value is longer than MAXPATHL, we need to append
|
||||
// each comma separated part of the option separately, so that it
|
||||
@@ -7042,7 +7041,7 @@ static void option_value2string(vimoption_T *opp, int opt_flags)
|
||||
if (varp == NULL) { // Just in case.
|
||||
NameBuff[0] = NUL;
|
||||
} else if (opp->flags & P_EXPAND) {
|
||||
home_replace(NULL, varp, NameBuff, MAXPATHL, false);
|
||||
home_replace(NULL, (char *)varp, (char *)NameBuff, MAXPATHL, false);
|
||||
// Translate 'pastetoggle' into special key names.
|
||||
} else if ((char_u **)opp->var == &p_pt) {
|
||||
str2specialbuf((const char *)p_pt, (char *)NameBuff, MAXPATHL);
|
||||
@@ -7963,11 +7962,7 @@ void set_fileformat(int eol_style, int opt_flags)
|
||||
|
||||
// p is NULL if "eol_style" is EOL_UNKNOWN.
|
||||
if (p != NULL) {
|
||||
set_string_option_direct("ff",
|
||||
-1,
|
||||
(char_u *)p,
|
||||
OPT_FREE | opt_flags,
|
||||
0);
|
||||
set_string_option_direct("ff", -1, p, OPT_FREE | opt_flags, 0);
|
||||
}
|
||||
|
||||
// This may cause the buffer to become (un)modified.
|
||||
|
||||
+9
-9
@@ -1033,7 +1033,7 @@ char *vim_getenv(const char *name)
|
||||
/// a list of them.
|
||||
///
|
||||
/// @return length of the string put into dst, does not include NUL byte.
|
||||
size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst, size_t dstlen,
|
||||
size_t home_replace(const buf_T *const buf, const char *src, char *const dst, size_t dstlen,
|
||||
const bool one)
|
||||
FUNC_ATTR_NONNULL_ARG(3)
|
||||
{
|
||||
@@ -1085,9 +1085,9 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst
|
||||
}
|
||||
|
||||
if (!one) {
|
||||
src = (char_u *)skipwhite((char *)src);
|
||||
src = skipwhite((char *)src);
|
||||
}
|
||||
char *dst_p = (char *)dst;
|
||||
char *dst_p = dst;
|
||||
while (*src && dstlen > 0) {
|
||||
// Here we are at the beginning of a file name.
|
||||
// First, check to see if the beginning of the file name matches
|
||||
@@ -1123,11 +1123,11 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst
|
||||
|
||||
// if (!one) skip to separator: space or comma.
|
||||
while (*src && (one || (*src != ',' && *src != ' ')) && --dstlen > 0) {
|
||||
*dst_p++ = (char)(*src++);
|
||||
*dst_p++ = *src++;
|
||||
}
|
||||
// Skip separator.
|
||||
while ((*src == ' ' || *src == ',') && --dstlen > 0) {
|
||||
*dst_p++ = (char)(*src++);
|
||||
*dst_p++ = *src++;
|
||||
}
|
||||
}
|
||||
// If (dstlen == 0) out of space, what to do???
|
||||
@@ -1137,7 +1137,7 @@ size_t home_replace(const buf_T *const buf, const char_u *src, char_u *const dst
|
||||
if (must_free) {
|
||||
xfree(homedir_env_mod);
|
||||
}
|
||||
return (size_t)(dst_p - (char *)dst);
|
||||
return (size_t)(dst_p - dst);
|
||||
}
|
||||
|
||||
/// Like home_replace, store the replaced string in allocated memory.
|
||||
@@ -1149,9 +1149,9 @@ char_u *home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET
|
||||
if (src != NULL) { // just in case
|
||||
len += STRLEN(src);
|
||||
}
|
||||
char_u *dst = xmalloc(len);
|
||||
home_replace(buf, src, dst, len, true);
|
||||
return dst;
|
||||
char *dst = xmalloc(len);
|
||||
home_replace(buf, (char *)src, dst, len, true);
|
||||
return (char_u *)dst;
|
||||
}
|
||||
|
||||
/// Function given to ExpandGeneric() to obtain an environment variable name.
|
||||
|
||||
+2
-2
@@ -854,9 +854,9 @@ static int do_os_system(char **argv, const char *input, size_t len, char **outpu
|
||||
// Failed, probably 'shell' is not executable.
|
||||
if (!silent) {
|
||||
msg_puts(_("\nshell failed to start: "));
|
||||
msg_outtrans((char_u *)os_strerror(status));
|
||||
msg_outtrans((char *)os_strerror(status));
|
||||
msg_puts(": ");
|
||||
msg_outtrans((char_u *)prog);
|
||||
msg_outtrans(prog);
|
||||
msg_putchar('\n');
|
||||
}
|
||||
multiqueue_free(events);
|
||||
|
||||
+9
-9
@@ -52,27 +52,27 @@
|
||||
/// @param checkname When both files don't exist, only compare their names.
|
||||
/// @param expandenv Whether to expand environment variables in file names.
|
||||
/// @return Enum of type FileComparison. @see FileComparison.
|
||||
FileComparison path_full_compare(char_u *const s1, char_u *const s2, const bool checkname,
|
||||
FileComparison path_full_compare(char *const s1, char *const s2, const bool checkname,
|
||||
const bool expandenv)
|
||||
{
|
||||
assert(s1 && s2);
|
||||
char_u exp1[MAXPATHL];
|
||||
char_u full1[MAXPATHL];
|
||||
char_u full2[MAXPATHL];
|
||||
char exp1[MAXPATHL];
|
||||
char full1[MAXPATHL];
|
||||
char full2[MAXPATHL];
|
||||
FileID file_id_1, file_id_2;
|
||||
|
||||
if (expandenv) {
|
||||
expand_env(s1, exp1, MAXPATHL);
|
||||
expand_env((char_u *)s1, (char_u *)exp1, MAXPATHL);
|
||||
} else {
|
||||
STRLCPY(exp1, s1, MAXPATHL);
|
||||
}
|
||||
bool id_ok_1 = os_fileid((char *)exp1, &file_id_1);
|
||||
bool id_ok_2 = os_fileid((char *)s2, &file_id_2);
|
||||
bool id_ok_1 = os_fileid(exp1, &file_id_1);
|
||||
bool id_ok_2 = os_fileid(s2, &file_id_2);
|
||||
if (!id_ok_1 && !id_ok_2) {
|
||||
// If os_fileid() doesn't work, may compare the names.
|
||||
if (checkname) {
|
||||
vim_FullName((char *)exp1, (char *)full1, MAXPATHL, false);
|
||||
vim_FullName((char *)s2, (char *)full2, MAXPATHL, false);
|
||||
vim_FullName(exp1, full1, MAXPATHL, false);
|
||||
vim_FullName(s2, full2, MAXPATHL, false);
|
||||
if (FNAMECMP(full1, full2) == 0) {
|
||||
return kEqualFileNames;
|
||||
}
|
||||
|
||||
+4
-4
@@ -229,7 +229,7 @@ int win_chartabsize(win_T *wp, char_u *p, colnr_T col)
|
||||
if (*p == TAB && (!wp->w_p_list || wp->w_p_lcs_chars.tab1)) {
|
||||
return tabstop_padding(col, buf->b_p_ts, buf->b_p_vts_array);
|
||||
} else {
|
||||
return ptr2cells(p);
|
||||
return ptr2cells((char *)p);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +408,7 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he
|
||||
// Set *headp to the size of what we add.
|
||||
added = 0;
|
||||
|
||||
char_u *const sbr = get_showbreak_value(wp);
|
||||
char *const sbr = (char *)get_showbreak_value(wp);
|
||||
if ((*sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0) {
|
||||
colnr_T sbrlen = 0;
|
||||
int numberwidth = win_col_off(wp);
|
||||
@@ -423,7 +423,7 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he
|
||||
col %= numberextra;
|
||||
}
|
||||
if (*sbr != NUL) {
|
||||
sbrlen = (colnr_T)mb_charlen(sbr);
|
||||
sbrlen = (colnr_T)mb_charlen((char_u *)sbr);
|
||||
if (col >= sbrlen) {
|
||||
col -= sbrlen;
|
||||
}
|
||||
@@ -494,7 +494,7 @@ static int win_nolbr_chartabsize(win_T *wp, char_u *s, colnr_T col, int *headp)
|
||||
wp->w_buffer->b_p_ts,
|
||||
wp->w_buffer->b_p_vts_array);
|
||||
}
|
||||
n = ptr2cells(s);
|
||||
n = ptr2cells((char *)s);
|
||||
|
||||
// Add one cell for a double-width character in the last column of the
|
||||
// window, displayed with a ">".
|
||||
|
||||
+8
-8
@@ -66,19 +66,19 @@ static void pum_compute_size(void)
|
||||
for (int i = 0; i < pum_size; i++) {
|
||||
int w;
|
||||
if (pum_array[i].pum_text != NULL) {
|
||||
w = vim_strsize(pum_array[i].pum_text);
|
||||
w = vim_strsize((char *)pum_array[i].pum_text);
|
||||
if (pum_base_width < w) {
|
||||
pum_base_width = w;
|
||||
}
|
||||
}
|
||||
if (pum_array[i].pum_kind != NULL) {
|
||||
w = vim_strsize(pum_array[i].pum_kind) + 1;
|
||||
w = vim_strsize((char *)pum_array[i].pum_kind) + 1;
|
||||
if (pum_kind_width < w) {
|
||||
pum_kind_width = w;
|
||||
}
|
||||
}
|
||||
if (pum_array[i].pum_extra != NULL) {
|
||||
w = vim_strsize(pum_array[i].pum_extra) + 1;
|
||||
w = vim_strsize((char *)pum_array[i].pum_extra) + 1;
|
||||
if (pum_extra_width < w) {
|
||||
pum_extra_width = w;
|
||||
}
|
||||
@@ -504,7 +504,7 @@ void pum_redraw(void)
|
||||
if (s == NULL) {
|
||||
s = p;
|
||||
}
|
||||
w = ptr2cells(p);
|
||||
w = ptr2cells((char *)p);
|
||||
|
||||
if ((*p == NUL) || (*p == TAB) || (totwidth + w > pum_width)) {
|
||||
// Display the text that fits or comes before a Tab.
|
||||
@@ -517,13 +517,13 @@ void pum_redraw(void)
|
||||
*p = saved;
|
||||
|
||||
if (pum_rl) {
|
||||
char_u *rt = reverse_text(st);
|
||||
char_u *rt_start = rt;
|
||||
char *rt = (char *)reverse_text(st);
|
||||
char *rt_start = rt;
|
||||
int size = vim_strsize(rt);
|
||||
|
||||
if (size > pum_width) {
|
||||
do {
|
||||
size -= utf_ptr2cells((char *)rt);
|
||||
size -= utf_ptr2cells(rt);
|
||||
MB_PTR_ADV(rt);
|
||||
} while (size > pum_width);
|
||||
|
||||
@@ -535,7 +535,7 @@ void pum_redraw(void)
|
||||
size++;
|
||||
}
|
||||
}
|
||||
grid_puts_len(&pum_grid, rt, (int)STRLEN(rt), row,
|
||||
grid_puts_len(&pum_grid, (char_u *)rt, (int)STRLEN(rt), row,
|
||||
grid_col - size + 1, attr);
|
||||
xfree(rt_start);
|
||||
xfree(st);
|
||||
|
||||
+5
-5
@@ -4343,7 +4343,7 @@ static char *make_get_fullcmd(const char *makecmd, const char *fname)
|
||||
}
|
||||
msg_start();
|
||||
msg_puts(":!");
|
||||
msg_outtrans((char_u *)cmd); // show what we are doing
|
||||
msg_outtrans(cmd); // show what we are doing
|
||||
|
||||
return cmd;
|
||||
}
|
||||
@@ -5100,7 +5100,7 @@ void ex_cfile(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
if (*eap->arg != NUL) {
|
||||
set_string_option_direct("ef", -1, (char_u *)eap->arg, OPT_FREE, 0);
|
||||
set_string_option_direct("ef", -1, eap->arg, OPT_FREE, 0);
|
||||
}
|
||||
|
||||
char *enc = (*curbuf->b_p_menc != NUL) ? (char *)curbuf->b_p_menc : (char *)p_menc;
|
||||
@@ -5199,9 +5199,9 @@ static void vgr_display_fname(char *fname)
|
||||
msg_start();
|
||||
char *p = (char *)msg_strtrunc((char_u *)fname, true);
|
||||
if (p == NULL) {
|
||||
msg_outtrans((char_u *)fname);
|
||||
msg_outtrans(fname);
|
||||
} else {
|
||||
msg_outtrans((char_u *)p);
|
||||
msg_outtrans(p);
|
||||
xfree(p);
|
||||
}
|
||||
msg_clr_eos();
|
||||
@@ -5716,7 +5716,7 @@ static buf_T *load_dummy_buffer(char *fname, char *dirname_start, char *resultin
|
||||
aucmd_prepbuf(&aco, newbuf);
|
||||
|
||||
// Need to set the filename for autocommands.
|
||||
(void)setfname(curbuf, (char_u *)fname, NULL, false);
|
||||
(void)setfname(curbuf, fname, NULL, false);
|
||||
|
||||
// Create swap file now to avoid the ATTENTION message.
|
||||
check_need_swap(true);
|
||||
|
||||
+39
-41
@@ -4718,7 +4718,7 @@ static int status_match_len(expand_T *xp, char_u *s)
|
||||
|
||||
while (*s != NUL) {
|
||||
s += skip_status_match_char(xp, s);
|
||||
len += ptr2cells(s);
|
||||
len += ptr2cells((char *)s);
|
||||
MB_PTR_ADV(s);
|
||||
}
|
||||
|
||||
@@ -4856,7 +4856,7 @@ void win_redr_status_matches(expand_T *xp, int num_matches, char_u **matches, in
|
||||
} else {
|
||||
for (; *s != NUL; ++s) {
|
||||
s += skip_status_match_char(xp, s);
|
||||
clen += ptr2cells(s);
|
||||
clen += ptr2cells((char *)s);
|
||||
if ((l = utfc_ptr2len((char *)s)) > 1) {
|
||||
STRNCPY(buf + len, s, l); // NOLINT(runtime/printf)
|
||||
s += l - 1;
|
||||
@@ -5034,7 +5034,7 @@ static void win_redr_status(win_T *wp)
|
||||
grid_fill(&default_grid, row, row + 1, len + col,
|
||||
this_ru_col + col, fillchar, fillchar, attr);
|
||||
|
||||
if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL)
|
||||
if (get_keymap_str(wp, "<%s>", (char *)NameBuff, MAXPATHL)
|
||||
&& this_ru_col - len > (int)(STRLEN(NameBuff) + 1)) {
|
||||
grid_puts(&default_grid, NameBuff, row,
|
||||
(int)(this_ru_col - STRLEN(NameBuff) - 1), attr);
|
||||
@@ -5079,7 +5079,7 @@ static void redraw_custom_statusline(win_T *wp)
|
||||
// When there is an error disable the statusline, otherwise the
|
||||
// display is messed up with errors and a redraw triggers the problem
|
||||
// again and again.
|
||||
set_string_option_direct("statusline", -1, (char_u *)"",
|
||||
set_string_option_direct("statusline", -1, "",
|
||||
OPT_FREE | (*wp->w_p_stl != NUL
|
||||
? OPT_LOCAL : OPT_GLOBAL), SID_ERROR);
|
||||
}
|
||||
@@ -5109,7 +5109,7 @@ static void win_redr_winbar(win_T *wp)
|
||||
// When there is an error disable the winbar, otherwise the
|
||||
// display is messed up with errors and a redraw triggers the problem
|
||||
// again and again.
|
||||
set_string_option_direct("winbar", -1, (char_u *)"",
|
||||
set_string_option_direct("winbar", -1, "",
|
||||
OPT_FREE | (*wp->w_p_stl != NUL
|
||||
? OPT_LOCAL : OPT_GLOBAL), SID_ERROR);
|
||||
}
|
||||
@@ -5218,9 +5218,9 @@ static bool vsep_connected(win_T *wp, WindowCorner corner)
|
||||
/// @param fmt format string containing one %s item
|
||||
/// @param buf buffer for the result
|
||||
/// @param len length of buffer
|
||||
bool get_keymap_str(win_T *wp, char_u *fmt, char_u *buf, int len)
|
||||
bool get_keymap_str(win_T *wp, char *fmt, char *buf, int len)
|
||||
{
|
||||
char_u *p;
|
||||
char *p;
|
||||
|
||||
if (wp->w_buffer->b_p_iminsert != B_IMODE_LMAP) {
|
||||
return false;
|
||||
@@ -5229,24 +5229,24 @@ bool get_keymap_str(win_T *wp, char_u *fmt, char_u *buf, int len)
|
||||
{
|
||||
buf_T *old_curbuf = curbuf;
|
||||
win_T *old_curwin = curwin;
|
||||
char_u *s;
|
||||
char *s;
|
||||
|
||||
curbuf = wp->w_buffer;
|
||||
curwin = wp;
|
||||
STRCPY(buf, "b:keymap_name"); // must be writable
|
||||
emsg_skip++;
|
||||
s = p = (char_u *)eval_to_string((char *)buf, NULL, false);
|
||||
s = p = eval_to_string(buf, NULL, false);
|
||||
emsg_skip--;
|
||||
curbuf = old_curbuf;
|
||||
curwin = old_curwin;
|
||||
if (p == NULL || *p == NUL) {
|
||||
if (wp->w_buffer->b_kmap_state & KEYMAP_LOADED) {
|
||||
p = wp->w_buffer->b_p_keymap;
|
||||
p = (char *)wp->w_buffer->b_p_keymap;
|
||||
} else {
|
||||
p = (char_u *)"lang";
|
||||
p = "lang";
|
||||
}
|
||||
}
|
||||
if (vim_snprintf((char *)buf, len, (char *)fmt, p) > len - 1) {
|
||||
if (vim_snprintf(buf, len, fmt, p) > len - 1) {
|
||||
buf[0] = NUL;
|
||||
}
|
||||
xfree(s);
|
||||
@@ -5268,9 +5268,9 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
|
||||
int n;
|
||||
int len;
|
||||
int fillchar;
|
||||
char_u buf[MAXPATHL];
|
||||
char buf[MAXPATHL];
|
||||
char_u *stl;
|
||||
char_u *p;
|
||||
char *p;
|
||||
stl_hlrec_t *hltab;
|
||||
StlClickRecord *tabtab;
|
||||
int use_sandbox = false;
|
||||
@@ -5389,20 +5389,20 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
|
||||
* might change the option value and free the memory. */
|
||||
stl = vim_strsave(stl);
|
||||
width =
|
||||
build_stl_str_hl(ewp, (char *)buf, sizeof(buf), (char *)stl, use_sandbox,
|
||||
build_stl_str_hl(ewp, buf, sizeof(buf), (char *)stl, use_sandbox,
|
||||
fillchar, maxwidth, &hltab, &tabtab);
|
||||
xfree(stl);
|
||||
ewp->w_p_crb = p_crb_save;
|
||||
|
||||
// Make all characters printable.
|
||||
p = (char_u *)transstr((const char *)buf, true);
|
||||
p = transstr(buf, true);
|
||||
len = STRLCPY(buf, p, sizeof(buf));
|
||||
len = (size_t)len < sizeof(buf) ? len : (int)sizeof(buf) - 1;
|
||||
xfree(p);
|
||||
|
||||
// fill up with "fillchar"
|
||||
while (width < maxwidth && len < (int)sizeof(buf) - 1) {
|
||||
len += utf_char2bytes(fillchar, (char *)buf + len);
|
||||
len += utf_char2bytes(fillchar, buf + len);
|
||||
width++;
|
||||
}
|
||||
buf[len] = NUL;
|
||||
@@ -5416,8 +5416,8 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
|
||||
p = buf;
|
||||
for (n = 0; hltab[n].start != NULL; n++) {
|
||||
int textlen = (int)(hltab[n].start - p);
|
||||
grid_puts_len(grid, p, textlen, row, col, curattr);
|
||||
col += vim_strnsize(p, textlen);
|
||||
grid_puts_len(grid, (char_u *)p, textlen, row, col, curattr);
|
||||
col += vim_strnsize((char_u *)p, textlen);
|
||||
p = hltab[n].start;
|
||||
|
||||
if (hltab[n].userhl == 0) {
|
||||
@@ -5431,7 +5431,7 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
|
||||
}
|
||||
}
|
||||
// Make sure to use an empty string instead of p, if p is beyond buf + len.
|
||||
grid_puts(grid, p >= buf + len ? (char_u *)"" : p, row, col,
|
||||
grid_puts(grid, p >= buf + len ? (char_u *)"" : (char_u *)p, row, col,
|
||||
curattr);
|
||||
|
||||
grid_puts_line_flush(false);
|
||||
@@ -5453,11 +5453,11 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler)
|
||||
.type = kStlClickDisabled,
|
||||
};
|
||||
for (n = 0; tabtab[n].start != NULL; n++) {
|
||||
len += vim_strnsize(p, (int)(tabtab[n].start - (char *)p));
|
||||
len += vim_strnsize((char_u *)p, (int)(tabtab[n].start - p));
|
||||
while (col < len) {
|
||||
click_defs[col++] = cur_click_def;
|
||||
}
|
||||
p = (char_u *)tabtab[n].start;
|
||||
p = (char *)tabtab[n].start;
|
||||
cur_click_def = tabtab[n].def;
|
||||
if ((wp != NULL) && !(cur_click_def.type == kStlClickDisabled
|
||||
|| cur_click_def.type == kStlClickFuncRun)) {
|
||||
@@ -5980,13 +5980,13 @@ int showmode(void)
|
||||
length = (Rows - msg_row) * Columns - 3;
|
||||
}
|
||||
if (edit_submode_extra != NULL) {
|
||||
length -= vim_strsize(edit_submode_extra);
|
||||
length -= vim_strsize((char *)edit_submode_extra);
|
||||
}
|
||||
if (length > 0) {
|
||||
if (edit_submode_pre != NULL) {
|
||||
length -= vim_strsize(edit_submode_pre);
|
||||
length -= vim_strsize((char *)edit_submode_pre);
|
||||
}
|
||||
if (length - vim_strsize(edit_submode) > 0) {
|
||||
if (length - vim_strsize((char *)edit_submode) > 0) {
|
||||
if (edit_submode_pre != NULL) {
|
||||
msg_puts_attr((const char *)edit_submode_pre, attr);
|
||||
}
|
||||
@@ -6028,8 +6028,8 @@ int showmode(void)
|
||||
if (State & MODE_LANGMAP) {
|
||||
if (curwin->w_p_arab) {
|
||||
msg_puts_attr(_(" Arabic"), attr);
|
||||
} else if (get_keymap_str(curwin, (char_u *)" (%s)",
|
||||
NameBuff, MAXPATHL)) {
|
||||
} else if (get_keymap_str(curwin, " (%s)",
|
||||
(char *)NameBuff, MAXPATHL)) {
|
||||
msg_puts_attr((char *)NameBuff, attr);
|
||||
}
|
||||
}
|
||||
@@ -6211,8 +6211,7 @@ void draw_tabline(void)
|
||||
did_emsg = false;
|
||||
win_redr_custom(NULL, false, false);
|
||||
if (did_emsg) {
|
||||
set_string_option_direct("tabline", -1,
|
||||
(char_u *)"", OPT_FREE, SID_ERROR);
|
||||
set_string_option_direct("tabline", -1, "", OPT_FREE, SID_ERROR);
|
||||
}
|
||||
did_emsg |= saved_did_emsg;
|
||||
} else {
|
||||
@@ -6289,10 +6288,10 @@ void draw_tabline(void)
|
||||
// Get buffer name in NameBuff[]
|
||||
get_trans_bufname(cwp->w_buffer);
|
||||
shorten_dir(NameBuff);
|
||||
len = vim_strsize(NameBuff);
|
||||
len = vim_strsize((char *)NameBuff);
|
||||
p = NameBuff;
|
||||
while (len > room) {
|
||||
len -= ptr2cells(p);
|
||||
len -= ptr2cells((char *)p);
|
||||
MB_PTR_ADV(p);
|
||||
}
|
||||
if (len > Columns - col - 1) {
|
||||
@@ -6395,7 +6394,7 @@ void get_trans_bufname(buf_T *buf)
|
||||
if (buf_spname(buf) != NULL) {
|
||||
STRLCPY(NameBuff, buf_spname(buf), MAXPATHL);
|
||||
} else {
|
||||
home_replace(buf, (char_u *)buf->b_fname, NameBuff, MAXPATHL, true);
|
||||
home_replace(buf, buf->b_fname, (char *)NameBuff, MAXPATHL, true);
|
||||
}
|
||||
trans_characters(NameBuff, MAXPATHL);
|
||||
}
|
||||
@@ -6521,8 +6520,7 @@ static void win_redr_ruler(win_T *wp, bool always)
|
||||
called_emsg = false;
|
||||
win_redr_custom(wp, false, true);
|
||||
if (called_emsg) {
|
||||
set_string_option_direct("rulerformat", -1, (char_u *)"",
|
||||
OPT_FREE, SID_ERROR);
|
||||
set_string_option_direct("rulerformat", -1, "", OPT_FREE, SID_ERROR);
|
||||
}
|
||||
called_emsg |= save_called_emsg;
|
||||
return;
|
||||
@@ -6588,17 +6586,17 @@ static void win_redr_ruler(win_T *wp, bool always)
|
||||
}
|
||||
|
||||
#define RULER_BUF_LEN 70
|
||||
char_u buffer[RULER_BUF_LEN];
|
||||
char buffer[RULER_BUF_LEN];
|
||||
|
||||
/*
|
||||
* Some sprintfs return the length, some return a pointer.
|
||||
* To avoid portability problems we use strlen() here.
|
||||
*/
|
||||
vim_snprintf((char *)buffer, RULER_BUF_LEN, "%" PRId64 ",",
|
||||
vim_snprintf(buffer, RULER_BUF_LEN, "%" PRId64 ",",
|
||||
(wp->w_buffer->b_ml.ml_flags & ML_EMPTY) ? (int64_t)0L
|
||||
: (int64_t)wp->w_cursor.lnum);
|
||||
size_t len = STRLEN(buffer);
|
||||
col_print(buffer + len, RULER_BUF_LEN - len,
|
||||
col_print((char_u *)buffer + len, RULER_BUF_LEN - len,
|
||||
empty_line ? 0 : (int)wp->w_cursor.col + 1,
|
||||
(int)virtcol + 1);
|
||||
|
||||
@@ -6625,7 +6623,7 @@ static void win_redr_ruler(win_T *wp, bool always)
|
||||
if (this_ru_col + o < width) {
|
||||
// Need at least 3 chars left for get_rel_pos() + NUL.
|
||||
while (this_ru_col + o < width && RULER_BUF_LEN > i + 4) {
|
||||
i += utf_char2bytes(fillchar, (char *)buffer + i);
|
||||
i += utf_char2bytes(fillchar, buffer + i);
|
||||
o++;
|
||||
}
|
||||
get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i);
|
||||
@@ -6646,8 +6644,8 @@ static void win_redr_ruler(win_T *wp, bool always)
|
||||
}
|
||||
// Truncate at window boundary.
|
||||
o = 0;
|
||||
for (i = 0; buffer[i] != NUL; i += utfc_ptr2len((char *)buffer + i)) {
|
||||
o += utf_ptr2cells((char *)buffer + i);
|
||||
for (i = 0; buffer[i] != NUL; i += utfc_ptr2len(buffer + i)) {
|
||||
o += utf_ptr2cells(buffer + i);
|
||||
if (this_ru_col + o > width) {
|
||||
buffer[i] = NUL;
|
||||
break;
|
||||
@@ -6655,7 +6653,7 @@ static void win_redr_ruler(win_T *wp, bool always)
|
||||
}
|
||||
|
||||
ScreenGrid *grid = part_of_status ? &default_grid : &msg_grid_adj;
|
||||
grid_puts(grid, buffer, row, this_ru_col + off, attr);
|
||||
grid_puts(grid, (char_u *)buffer, row, this_ru_col + off, attr);
|
||||
grid_fill(grid, row, row + 1,
|
||||
this_ru_col + off + (int)STRLEN(buffer), off + width, fillchar,
|
||||
fillchar, attr);
|
||||
|
||||
+7
-8
@@ -910,8 +910,7 @@ int searchit(win_T *win, buf_T *buf, pos_T *pos, pos_T *end_pos, Direction dir,
|
||||
lnum = 1;
|
||||
}
|
||||
if (!shortmess(SHM_SEARCH) && (options & SEARCH_MSG)) {
|
||||
give_warning((char_u *)_(dir == BACKWARD
|
||||
? top_bot_msg : bot_top_msg), true);
|
||||
give_warning(_(dir == BACKWARD ? top_bot_msg : bot_top_msg), true);
|
||||
}
|
||||
if (extra_arg != NULL) {
|
||||
extra_arg->sa_wrapped = true;
|
||||
@@ -1261,7 +1260,7 @@ int do_search(oparg_T *oap, int dirc, int search_delim, char_u *pat, long count,
|
||||
memset(msgbuf + pat_len, ' ', r - msgbuf);
|
||||
}
|
||||
}
|
||||
msg_outtrans(msgbuf);
|
||||
msg_outtrans((char *)msgbuf);
|
||||
msg_clr_eos();
|
||||
msg_check();
|
||||
|
||||
@@ -1452,7 +1451,7 @@ int search_for_exact_line(buf_T *buf, pos_T *pos, Direction dir, char_u *pat)
|
||||
if (p_ws) {
|
||||
pos->lnum = buf->b_ml.ml_line_count;
|
||||
if (!shortmess(SHM_SEARCH)) {
|
||||
give_warning((char_u *)_(top_bot_msg), true);
|
||||
give_warning(_(top_bot_msg), true);
|
||||
}
|
||||
} else {
|
||||
pos->lnum = 1;
|
||||
@@ -1462,7 +1461,7 @@ int search_for_exact_line(buf_T *buf, pos_T *pos, Direction dir, char_u *pat)
|
||||
if (p_ws) {
|
||||
pos->lnum = 1;
|
||||
if (!shortmess(SHM_SEARCH)) {
|
||||
give_warning((char_u *)_(bot_top_msg), true);
|
||||
give_warning(_(bot_top_msg), true);
|
||||
}
|
||||
} else {
|
||||
pos->lnum = 1;
|
||||
@@ -4515,7 +4514,7 @@ static void cmdline_search_stat(int dirc, pos_T *pos, pos_T *cursor_pos, bool sh
|
||||
// keep the message even after redraw, but don't put in history
|
||||
msg_hist_off = true;
|
||||
msg_ext_set_kind("search_count");
|
||||
give_warning(msgbuf, false);
|
||||
give_warning((char *)msgbuf, false);
|
||||
msg_hist_off = false;
|
||||
}
|
||||
}
|
||||
@@ -5414,8 +5413,8 @@ void find_pattern_in_path(char_u *ptr, Direction dir, size_t len, bool whole, bo
|
||||
if (i == max_path_depth) {
|
||||
break;
|
||||
}
|
||||
if (path_full_compare(new_fname, files[i].name,
|
||||
true, true) & kEqualFiles) {
|
||||
if (path_full_compare((char *)new_fname, (char *)files[i].name, true,
|
||||
true) & kEqualFiles) {
|
||||
if (type != CHECK_PATH
|
||||
&& action == ACTION_SHOW_ALL && files[i].matched) {
|
||||
msg_putchar('\n'); // cursor below last one */
|
||||
|
||||
+1
-1
@@ -3977,7 +3977,7 @@ static bool shada_removable(const char *name)
|
||||
for (p = (char *)p_shada; *p;) {
|
||||
(void)copy_option_part((char_u **)&p, (char_u *)part, ARRAY_SIZE(part), ", ");
|
||||
if (part[0] == 'r') {
|
||||
home_replace(NULL, (char_u *)(part + 1), (char_u *)NameBuff, MAXPATHL, true);
|
||||
home_replace(NULL, part + 1, (char *)NameBuff, MAXPATHL, true);
|
||||
size_t n = STRLEN(NameBuff);
|
||||
if (mb_strnicmp((char_u *)NameBuff, (char_u *)new_name, n) == 0) {
|
||||
retval = true;
|
||||
|
||||
+2
-2
@@ -1624,12 +1624,12 @@ static void sign_list_defined(sign_T *sp)
|
||||
smsg("sign %s", sp->sn_name);
|
||||
if (sp->sn_icon != NULL) {
|
||||
msg_puts(" icon=");
|
||||
msg_outtrans(sp->sn_icon);
|
||||
msg_outtrans((char *)sp->sn_icon);
|
||||
msg_puts(_(" (not supported)"));
|
||||
}
|
||||
if (sp->sn_text != NULL) {
|
||||
msg_puts(" text=");
|
||||
msg_outtrans(sp->sn_text);
|
||||
msg_outtrans((char *)sp->sn_text);
|
||||
}
|
||||
if (sp->sn_line_hl > 0) {
|
||||
msg_puts(" linehl=");
|
||||
|
||||
+6
-6
@@ -1576,7 +1576,7 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att
|
||||
lnum = wp->w_buffer->b_ml.ml_line_count;
|
||||
wrapped = true;
|
||||
if (!shortmess(SHM_SEARCH)) {
|
||||
give_warning((char_u *)_(top_bot_msg), true);
|
||||
give_warning(_(top_bot_msg), true);
|
||||
}
|
||||
}
|
||||
capcol = -1;
|
||||
@@ -1591,7 +1591,7 @@ size_t spell_move_to(win_T *wp, int dir, bool allwords, bool curline, hlf_T *att
|
||||
lnum = 1;
|
||||
wrapped = true;
|
||||
if (!shortmess(SHM_SEARCH)) {
|
||||
give_warning((char_u *)_(bot_top_msg), true);
|
||||
give_warning(_(bot_top_msg), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2115,7 +2115,7 @@ char *did_set_spelllang(win_T *wp)
|
||||
|
||||
// Check if we loaded this language before.
|
||||
for (slang = first_lang; slang != NULL; slang = slang->sl_next) {
|
||||
if (path_full_compare(lang, slang->sl_fname, false, true)
|
||||
if (path_full_compare((char *)lang, (char *)slang->sl_fname, false, true)
|
||||
== kEqualFiles) {
|
||||
break;
|
||||
}
|
||||
@@ -2164,7 +2164,7 @@ char *did_set_spelllang(win_T *wp)
|
||||
// Loop over the languages, there can be several files for "lang".
|
||||
for (slang = first_lang; slang != NULL; slang = slang->sl_next) {
|
||||
if (filename
|
||||
? path_full_compare(lang, slang->sl_fname, false, true) == kEqualFiles
|
||||
? path_full_compare((char *)lang, (char *)slang->sl_fname, false, true) == kEqualFiles
|
||||
: STRICMP(lang, slang->sl_name) == 0) {
|
||||
region_mask = REGION_ALL;
|
||||
if (!filename && region != NULL) {
|
||||
@@ -2222,7 +2222,7 @@ char *did_set_spelllang(win_T *wp)
|
||||
for (c = 0; c < ga.ga_len; ++c) {
|
||||
p = LANGP_ENTRY(ga, c)->lp_slang->sl_fname;
|
||||
if (p != NULL
|
||||
&& path_full_compare(spf_name, p, false, true) == kEqualFiles) {
|
||||
&& path_full_compare((char *)spf_name, (char *)p, false, true) == kEqualFiles) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2233,7 +2233,7 @@ char *did_set_spelllang(win_T *wp)
|
||||
|
||||
// Check if it was loaded already.
|
||||
for (slang = first_lang; slang != NULL; slang = slang->sl_next) {
|
||||
if (path_full_compare(spf_name, slang->sl_fname, false, true)
|
||||
if (path_full_compare((char *)spf_name, (char *)slang->sl_fname, false, true)
|
||||
== kEqualFiles) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1826,7 +1826,7 @@ static void spell_reload_one(char_u *fname, bool added_word)
|
||||
bool didit = false;
|
||||
|
||||
for (slang = first_lang; slang != NULL; slang = slang->sl_next) {
|
||||
if (path_full_compare(fname, slang->sl_fname, false, true) == kEqualFiles) {
|
||||
if (path_full_compare((char *)fname, (char *)slang->sl_fname, false, true) == kEqualFiles) {
|
||||
slang_clear(slang);
|
||||
if (spell_load_file(fname, NULL, slang, false) == NULL) {
|
||||
// reloading failed, clear the language
|
||||
@@ -4903,7 +4903,7 @@ static void spell_make_sugfile(spellinfo_T *spin, char_u *wfname)
|
||||
// of the code for the soundfolding stuff.
|
||||
// It might have been done already by spell_reload_one().
|
||||
for (slang = first_lang; slang != NULL; slang = slang->sl_next) {
|
||||
if (path_full_compare(wfname, slang->sl_fname, false, true)
|
||||
if (path_full_compare((char *)wfname, (char *)slang->sl_fname, false, true)
|
||||
== kEqualFiles) {
|
||||
break;
|
||||
}
|
||||
@@ -5598,9 +5598,8 @@ void spell_add_word(char_u *word, int len, SpellAddType what, int idx, bool undo
|
||||
if (fseek(fd, fpos, SEEK_SET) == 0) {
|
||||
fputc('#', fd);
|
||||
if (undo) {
|
||||
home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
|
||||
smsg(_("Word '%.*s' removed from %s"),
|
||||
len, word, NameBuff);
|
||||
home_replace(NULL, (char *)fname, (char *)NameBuff, MAXPATHL, true);
|
||||
smsg(_("Word '%.*s' removed from %s"), len, word, NameBuff);
|
||||
}
|
||||
}
|
||||
if (fseek(fd, fpos_next, SEEK_SET) != 0) {
|
||||
@@ -5648,7 +5647,7 @@ void spell_add_word(char_u *word, int len, SpellAddType what, int idx, bool undo
|
||||
}
|
||||
fclose(fd);
|
||||
|
||||
home_replace(NULL, fname, NameBuff, MAXPATHL, TRUE);
|
||||
home_replace(NULL, (char *)fname, (char *)NameBuff, MAXPATHL, true);
|
||||
smsg(_("Word '%.*s' added to %s"), len, word, NameBuff);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -3171,9 +3171,9 @@ static void syn_cmd_iskeyword(exarg_T *eap, int syncing)
|
||||
msg_puts("\n");
|
||||
if (curwin->w_s->b_syn_isk != empty_option) {
|
||||
msg_puts("syntax iskeyword ");
|
||||
msg_outtrans(curwin->w_s->b_syn_isk);
|
||||
msg_outtrans((char *)curwin->w_s->b_syn_isk);
|
||||
} else {
|
||||
msg_outtrans((char_u *)_("syntax iskeyword not set"));
|
||||
msg_outtrans(_("syntax iskeyword not set"));
|
||||
}
|
||||
} else {
|
||||
if (STRNICMP(arg, "clear", 5) == 0) {
|
||||
@@ -3382,7 +3382,7 @@ static void syn_cmd_clear(exarg_T *eap, int syncing)
|
||||
XFREE_CLEAR(SYN_CLSTR(curwin->w_s)[scl_id].scl_list);
|
||||
}
|
||||
} else {
|
||||
id = syn_name2id_len(arg, (int)(arg_end - arg));
|
||||
id = syn_name2id_len((char *)arg, (int)(arg_end - arg));
|
||||
if (id == 0) {
|
||||
semsg(_(e_nogroup), arg);
|
||||
break;
|
||||
@@ -3553,7 +3553,7 @@ static void syn_cmd_list(exarg_T *eap, int syncing)
|
||||
syn_list_cluster(id - SYNID_CLUSTER);
|
||||
}
|
||||
} else {
|
||||
int id = syn_name2id_len(arg, (int)(arg_end - arg));
|
||||
int id = syn_name2id_len((char *)arg, (int)(arg_end - arg));
|
||||
if (id == 0) {
|
||||
semsg(_(e_nogroup), arg);
|
||||
} else {
|
||||
@@ -3690,8 +3690,8 @@ static void syn_list_one(const int id, const bool syncing, const bool link_only)
|
||||
}
|
||||
msg_putchar(' ');
|
||||
if (spp->sp_sync_idx >= 0) {
|
||||
msg_outtrans(highlight_group_name(SYN_ITEMS(curwin->w_s)
|
||||
[spp->sp_sync_idx].sp_syn.id - 1));
|
||||
msg_outtrans((char *)highlight_group_name(SYN_ITEMS(curwin->w_s)
|
||||
[spp->sp_sync_idx].sp_syn.id - 1));
|
||||
} else {
|
||||
msg_puts("NONE");
|
||||
}
|
||||
@@ -3704,7 +3704,7 @@ static void syn_list_one(const int id, const bool syncing, const bool link_only)
|
||||
(void)syn_list_header(did_header, 0, id, true);
|
||||
msg_puts_attr("links to", attr);
|
||||
msg_putchar(' ');
|
||||
msg_outtrans(highlight_group_name(highlight_link_id(id - 1) - 1));
|
||||
msg_outtrans((char *)highlight_group_name(highlight_link_id(id - 1) - 1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3729,7 +3729,7 @@ static void syn_list_cluster(int id)
|
||||
|
||||
// slight hack: roughly duplicate the guts of syn_list_header()
|
||||
msg_putchar('\n');
|
||||
msg_outtrans(SYN_CLSTR(curwin->w_s)[id].scl_name);
|
||||
msg_outtrans((char *)SYN_CLSTR(curwin->w_s)[id].scl_name);
|
||||
|
||||
if (msg_col >= endcol) { // output at least one space
|
||||
endcol = msg_col + 1;
|
||||
@@ -3766,9 +3766,9 @@ static void put_id_list(const char *const name, const int16_t *const list, const
|
||||
int scl_id = *p - SYNID_CLUSTER;
|
||||
|
||||
msg_putchar('@');
|
||||
msg_outtrans(SYN_CLSTR(curwin->w_s)[scl_id].scl_name);
|
||||
msg_outtrans((char *)SYN_CLSTR(curwin->w_s)[scl_id].scl_name);
|
||||
} else {
|
||||
msg_outtrans(highlight_group_name(*p - 1));
|
||||
msg_outtrans((char *)highlight_group_name(*p - 1));
|
||||
}
|
||||
if (p[1]) {
|
||||
msg_putchar(',');
|
||||
@@ -3788,9 +3788,9 @@ static void put_pattern(const char *const s, const int c, const synpat_T *const
|
||||
msg_puts_attr("matchgroup", attr);
|
||||
msg_putchar('=');
|
||||
if (last_matchgroup == 0) {
|
||||
msg_outtrans((char_u *)"NONE");
|
||||
msg_outtrans("NONE");
|
||||
} else {
|
||||
msg_outtrans(highlight_group_name(last_matchgroup - 1));
|
||||
msg_outtrans((char *)highlight_group_name(last_matchgroup - 1));
|
||||
}
|
||||
msg_putchar(' ');
|
||||
}
|
||||
@@ -3807,7 +3807,7 @@ static void put_pattern(const char *const s, const int c, const synpat_T *const
|
||||
}
|
||||
}
|
||||
msg_putchar(sepchars[i]);
|
||||
msg_outtrans(spp->sp_pattern);
|
||||
msg_outtrans((char *)spp->sp_pattern);
|
||||
msg_putchar(sepchars[i]);
|
||||
|
||||
// output any pattern options
|
||||
@@ -3917,7 +3917,7 @@ static bool syn_list_keywords(const int id, const hashtab_T *const ht, bool did_
|
||||
prev_skipempty = (kp->flags & HL_SKIPEMPTY);
|
||||
}
|
||||
}
|
||||
msg_outtrans(kp->keyword);
|
||||
msg_outtrans((char *)kp->keyword);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6038,7 +6038,7 @@ static void syntime_report(void)
|
||||
msg_puts(profile_msg(p->average));
|
||||
msg_puts(" ");
|
||||
msg_advance(50);
|
||||
msg_outtrans(highlight_group_name(p->id - 1));
|
||||
msg_outtrans((char *)highlight_group_name(p->id - 1));
|
||||
msg_puts(" ");
|
||||
|
||||
msg_advance(69);
|
||||
|
||||
+5
-6
@@ -624,7 +624,7 @@ bool do_tag(char_u *tag, int type, int count, int forceit, int verbose)
|
||||
}
|
||||
msg_scroll = true; // Don't overwrite this message.
|
||||
} else {
|
||||
give_warning(IObuff, ic);
|
||||
give_warning((char *)IObuff, ic);
|
||||
}
|
||||
if (ic && !msg_scrolled && msg_silent == 0) {
|
||||
ui_flush();
|
||||
@@ -784,7 +784,7 @@ static void print_tag_list(int new_tag, int use_tagstack, int num_matches, char_
|
||||
// print all other extra fields
|
||||
attr = HL_ATTR(HLF_CM);
|
||||
while (*p && *p != '\r' && *p != '\n') {
|
||||
if (msg_col + ptr2cells(p) >= Columns) {
|
||||
if (msg_col + ptr2cells((char *)p) >= Columns) {
|
||||
msg_putchar('\n');
|
||||
if (got_int) {
|
||||
break;
|
||||
@@ -830,7 +830,7 @@ static void print_tag_list(int new_tag, int use_tagstack, int num_matches, char_
|
||||
}
|
||||
|
||||
while (p != command_end) {
|
||||
if (msg_col + (*p == TAB ? 1 : ptr2cells(p)) > Columns) {
|
||||
if (msg_col + (*p == TAB ? 1 : ptr2cells((char *)p)) > Columns) {
|
||||
msg_putchar('\n');
|
||||
}
|
||||
if (got_int) {
|
||||
@@ -1050,7 +1050,7 @@ void do_tags(exarg_T *eap)
|
||||
tagstack[i].cur_match + 1,
|
||||
tagstack[i].tagname,
|
||||
tagstack[i].fmark.mark.lnum);
|
||||
msg_outtrans(IObuff);
|
||||
msg_outtrans((char *)IObuff);
|
||||
msg_outtrans_attr(name, tagstack[i].fmark.fnum == curbuf->b_fnum
|
||||
? HL_ATTR(HLF_D) : 0);
|
||||
xfree(name);
|
||||
@@ -3032,8 +3032,7 @@ static int test_for_current(char_u *fname, char_u *fname_end, char_u *tag_fname,
|
||||
*fname_end = NUL;
|
||||
}
|
||||
fullname = expand_tag_fname(fname, tag_fname, true);
|
||||
retval = (path_full_compare(fullname, buf_ffname, true, true)
|
||||
& kEqualFiles);
|
||||
retval = (path_full_compare((char *)fullname, (char *)buf_ffname, true, true) & kEqualFiles);
|
||||
xfree(fullname);
|
||||
*fname_end = (char_u)c;
|
||||
}
|
||||
|
||||
+1
-2
@@ -1468,8 +1468,7 @@ void u_read_undo(char *name, const char_u *hash, const char_u *orig_name FUNC_AT
|
||||
if (name == NULL) {
|
||||
verbose_enter();
|
||||
}
|
||||
give_warning((char_u *)
|
||||
_("File contents changed, cannot use undo info"), true);
|
||||
give_warning(_("File contents changed, cannot use undo info"), true);
|
||||
if (name == NULL) {
|
||||
verbose_leave();
|
||||
}
|
||||
|
||||
+4
-4
@@ -2020,7 +2020,7 @@ void ex_version(exarg_T *eap)
|
||||
/// @param wrap
|
||||
static void version_msg_wrap(char *s, int wrap)
|
||||
{
|
||||
int len = vim_strsize((char_u *)s) + (wrap ? 2 : 0);
|
||||
int len = vim_strsize(s) + (wrap ? 2 : 0);
|
||||
|
||||
if (!got_int
|
||||
&& (len < Columns)
|
||||
@@ -2071,7 +2071,7 @@ void list_in_columns(char_u **items, int size, int current)
|
||||
// Find the length of the longest item, use that + 1 as the column width.
|
||||
int i;
|
||||
for (i = 0; size < 0 ? items[i] != NULL : i < size; i++) {
|
||||
int l = vim_strsize(items[i]) + (i == current ? 2 : 0);
|
||||
int l = vim_strsize((char *)items[i]) + (i == current ? 2 : 0);
|
||||
|
||||
if (l > width) {
|
||||
width = l;
|
||||
@@ -2294,7 +2294,7 @@ static void do_intro_line(long row, char_u *mesg, int attr)
|
||||
int clen;
|
||||
|
||||
// Center the message horizontally.
|
||||
col = vim_strsize(mesg);
|
||||
col = vim_strsize((char *)mesg);
|
||||
|
||||
col = (Columns - col) / 2;
|
||||
|
||||
@@ -2309,7 +2309,7 @@ static void do_intro_line(long row, char_u *mesg, int attr)
|
||||
for (l = 0;
|
||||
p[l] != NUL && (l == 0 || (p[l] != '<' && p[l - 1] != '>'));
|
||||
l++) {
|
||||
clen += ptr2cells(p + l);
|
||||
clen += ptr2cells((char *)p + l);
|
||||
l += utfc_ptr2len((char *)p + l) - 1;
|
||||
}
|
||||
assert(row <= INT_MAX && col <= INT_MAX);
|
||||
|
||||
Reference in New Issue
Block a user