mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Remove occurences of mb_head_off
This commit is contained in:
parent
b5cfac0894
commit
2bddc4ca54
@ -1965,8 +1965,8 @@ bool diff_find_change(win_T *wp, linenr_T lnum, int *startp, int *endp)
|
|||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
// Move back to first byte of character in both lines (may
|
// Move back to first byte of character in both lines (may
|
||||||
// have "nn^" in line_org and "n^ in line_new).
|
// have "nn^" in line_org and "n^ in line_new).
|
||||||
si_org -= (*mb_head_off)(line_org, line_org + si_org);
|
si_org -= utf_head_off(line_org, line_org + si_org);
|
||||||
si_new -= (*mb_head_off)(line_new, line_new + si_new);
|
si_new -= utf_head_off(line_new, line_new + si_new);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*startp > si_org) {
|
if (*startp > si_org) {
|
||||||
|
@ -1561,7 +1561,7 @@ void display_dollar(colnr_T col)
|
|||||||
|
|
||||||
/* If on the last byte of a multi-byte move to the first byte. */
|
/* If on the last byte of a multi-byte move to the first byte. */
|
||||||
p = get_cursor_line_ptr();
|
p = get_cursor_line_ptr();
|
||||||
curwin->w_cursor.col -= (*mb_head_off)(p, p + col);
|
curwin->w_cursor.col -= utf_head_off(p, p + col);
|
||||||
}
|
}
|
||||||
curs_columns(FALSE); /* recompute w_wrow and w_wcol */
|
curs_columns(FALSE); /* recompute w_wrow and w_wcol */
|
||||||
if (curwin->w_wcol < curwin->w_width) {
|
if (curwin->w_wcol < curwin->w_width) {
|
||||||
@ -3451,7 +3451,7 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
|
|||||||
for (len = 0; p[len] != NUL && p[len] == ptr[len]; ++len)
|
for (len = 0; p[len] != NUL && p[len] == ptr[len]; ++len)
|
||||||
;
|
;
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
len -= (*mb_head_off)(p, p + len);
|
len -= utf_head_off(p, p + len);
|
||||||
for (p += len; *p != NUL; MB_PTR_ADV(p)) {
|
for (p += len; *p != NUL; MB_PTR_ADV(p)) {
|
||||||
AppendCharToRedobuff(K_BS);
|
AppendCharToRedobuff(K_BS);
|
||||||
}
|
}
|
||||||
@ -4593,10 +4593,10 @@ static int ins_complete(int c, bool enable_pum)
|
|||||||
int base_class;
|
int base_class;
|
||||||
int head_off;
|
int head_off;
|
||||||
|
|
||||||
startcol -= (*mb_head_off)(line, line + startcol);
|
startcol -= utf_head_off(line, line + startcol);
|
||||||
base_class = mb_get_class(line + startcol);
|
base_class = mb_get_class(line + startcol);
|
||||||
while (--startcol >= 0) {
|
while (--startcol >= 0) {
|
||||||
head_off = (*mb_head_off)(line, line + startcol);
|
head_off = utf_head_off(line, line + startcol);
|
||||||
if (base_class != mb_get_class(line + startcol
|
if (base_class != mb_get_class(line + startcol
|
||||||
- head_off))
|
- head_off))
|
||||||
break;
|
break;
|
||||||
|
@ -726,7 +726,7 @@ static int command_line_execute(VimState *state, int key)
|
|||||||
s->i = (int)(s->xpc.xp_pattern - ccline.cmdbuff);
|
s->i = (int)(s->xpc.xp_pattern - ccline.cmdbuff);
|
||||||
while (--s->j > s->i) {
|
while (--s->j > s->i) {
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
s->j -= (*mb_head_off)(ccline.cmdbuff, ccline.cmdbuff + s->j);
|
s->j -= utf_head_off(ccline.cmdbuff, ccline.cmdbuff + s->j);
|
||||||
}
|
}
|
||||||
if (vim_ispathsep(ccline.cmdbuff[s->j])) {
|
if (vim_ispathsep(ccline.cmdbuff[s->j])) {
|
||||||
found = true;
|
found = true;
|
||||||
@ -748,7 +748,7 @@ static int command_line_execute(VimState *state, int key)
|
|||||||
s->i = (int)(s->xpc.xp_pattern - ccline.cmdbuff);
|
s->i = (int)(s->xpc.xp_pattern - ccline.cmdbuff);
|
||||||
while (--s->j > s->i) {
|
while (--s->j > s->i) {
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
s->j -= (*mb_head_off)(ccline.cmdbuff, ccline.cmdbuff + s->j);
|
s->j -= utf_head_off(ccline.cmdbuff, ccline.cmdbuff + s->j);
|
||||||
}
|
}
|
||||||
if (vim_ispathsep(ccline.cmdbuff[s->j])
|
if (vim_ispathsep(ccline.cmdbuff[s->j])
|
||||||
#ifdef BACKSLASH_IN_FILENAME
|
#ifdef BACKSLASH_IN_FILENAME
|
||||||
@ -1437,7 +1437,7 @@ static int command_line_handle_key(CommandLineState *s)
|
|||||||
do {
|
do {
|
||||||
--ccline.cmdpos;
|
--ccline.cmdpos;
|
||||||
if (has_mbyte) { // move to first byte of char
|
if (has_mbyte) { // move to first byte of char
|
||||||
ccline.cmdpos -= (*mb_head_off)(ccline.cmdbuff,
|
ccline.cmdpos -= utf_head_off(ccline.cmdbuff,
|
||||||
ccline.cmdbuff + ccline.cmdpos);
|
ccline.cmdbuff + ccline.cmdpos);
|
||||||
}
|
}
|
||||||
ccline.cmdspos -= cmdline_charsize(ccline.cmdpos);
|
ccline.cmdspos -= cmdline_charsize(ccline.cmdpos);
|
||||||
@ -2271,7 +2271,7 @@ getexmodeline (
|
|||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
p = (char_u *)line_ga.ga_data;
|
p = (char_u *)line_ga.ga_data;
|
||||||
p[line_ga.ga_len] = NUL;
|
p[line_ga.ga_len] = NUL;
|
||||||
len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1;
|
len = utf_head_off(p, p + line_ga.ga_len - 1) + 1;
|
||||||
line_ga.ga_len -= len;
|
line_ga.ga_len -= len;
|
||||||
} else {
|
} else {
|
||||||
line_ga.ga_len--;
|
line_ga.ga_len--;
|
||||||
@ -3156,7 +3156,7 @@ void put_on_cmdline(char_u *str, int len, int redraw)
|
|||||||
i = 0;
|
i = 0;
|
||||||
c = utf_ptr2char(ccline.cmdbuff + ccline.cmdpos);
|
c = utf_ptr2char(ccline.cmdbuff + ccline.cmdpos);
|
||||||
while (ccline.cmdpos > 0 && utf_iscomposing(c)) {
|
while (ccline.cmdpos > 0 && utf_iscomposing(c)) {
|
||||||
i = (*mb_head_off)(ccline.cmdbuff,
|
i = utf_head_off(ccline.cmdbuff,
|
||||||
ccline.cmdbuff + ccline.cmdpos - 1) + 1;
|
ccline.cmdbuff + ccline.cmdpos - 1) + 1;
|
||||||
ccline.cmdpos -= i;
|
ccline.cmdpos -= i;
|
||||||
len += i;
|
len += i;
|
||||||
@ -3164,7 +3164,7 @@ void put_on_cmdline(char_u *str, int len, int redraw)
|
|||||||
}
|
}
|
||||||
if (i == 0 && ccline.cmdpos > 0 && arabic_maycombine(c)) {
|
if (i == 0 && ccline.cmdpos > 0 && arabic_maycombine(c)) {
|
||||||
/* Check the previous character for Arabic combining pair. */
|
/* Check the previous character for Arabic combining pair. */
|
||||||
i = (*mb_head_off)(ccline.cmdbuff,
|
i = utf_head_off(ccline.cmdbuff,
|
||||||
ccline.cmdbuff + ccline.cmdpos - 1) + 1;
|
ccline.cmdbuff + ccline.cmdpos - 1) + 1;
|
||||||
if (arabic_combine(utf_ptr2char(ccline.cmdbuff
|
if (arabic_combine(utf_ptr2char(ccline.cmdbuff
|
||||||
+ ccline.cmdpos - i), c)) {
|
+ ccline.cmdpos - i), c)) {
|
||||||
|
@ -2133,7 +2133,7 @@ static int vgetorpeek(int advance)
|
|||||||
/* Correct when the cursor is on the right halve
|
/* Correct when the cursor is on the right halve
|
||||||
* of a double-wide character. */
|
* of a double-wide character. */
|
||||||
ptr = get_cursor_line_ptr();
|
ptr = get_cursor_line_ptr();
|
||||||
col -= (*mb_head_off)(ptr, ptr + col);
|
col -= utf_head_off(ptr, ptr + col);
|
||||||
if ((*mb_ptr2cells)(ptr + col) > 1)
|
if ((*mb_ptr2cells)(ptr + col) > 1)
|
||||||
--curwin->w_wcol;
|
--curwin->w_wcol;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@
|
|||||||
// Advance multi-byte pointer, do not skip over composing chars.
|
// Advance multi-byte pointer, do not skip over composing chars.
|
||||||
# define MB_CPTR_ADV(p) (p += utf_ptr2len(p))
|
# define MB_CPTR_ADV(p) (p += utf_ptr2len(p))
|
||||||
// Backup multi-byte pointer. Only use with "p" > "s" !
|
// Backup multi-byte pointer. Only use with "p" > "s" !
|
||||||
# define MB_PTR_BACK(s, p) (p -= mb_head_off((char_u *)s, (char_u *)p - 1) + 1)
|
# define MB_PTR_BACK(s, p) (p -= utf_head_off((char_u *)s, (char_u *)p - 1) + 1)
|
||||||
// get length of multi-byte char, not including composing chars
|
// get length of multi-byte char, not including composing chars
|
||||||
# define MB_CPTR2LEN(p) utf_ptr2len(p)
|
# define MB_CPTR2LEN(p) utf_ptr2len(p)
|
||||||
|
|
||||||
|
@ -1468,7 +1468,7 @@ void mark_mb_adjustpos(buf_T *buf, pos_T *lp)
|
|||||||
if (*p == NUL || (int)STRLEN(p) < lp->col) {
|
if (*p == NUL || (int)STRLEN(p) < lp->col) {
|
||||||
lp->col = 0;
|
lp->col = 0;
|
||||||
} else {
|
} else {
|
||||||
lp->col -= (*mb_head_off)(p, p + lp->col);
|
lp->col -= utf_head_off(p, p + lp->col);
|
||||||
}
|
}
|
||||||
// Reset "coladd" when the cursor would be on the right half of a
|
// Reset "coladd" when the cursor would be on the right half of a
|
||||||
// double-wide character.
|
// double-wide character.
|
||||||
|
@ -1710,7 +1710,7 @@ void mb_check_adjust_col(void *win_)
|
|||||||
win->w_cursor.col = len - 1;
|
win->w_cursor.col = len - 1;
|
||||||
}
|
}
|
||||||
// Move the cursor to the head byte.
|
// Move the cursor to the head byte.
|
||||||
win->w_cursor.col -= (*mb_head_off)(p, p + win->w_cursor.col);
|
win->w_cursor.col -= utf_head_off(p, p + win->w_cursor.col);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset `coladd` when the cursor would be on the right half of a
|
// Reset `coladd` when the cursor would be on the right half of a
|
||||||
|
@ -53,7 +53,6 @@ enum { MAX_MCO = 6 };
|
|||||||
#define mb_ptr2cells utf_ptr2cells
|
#define mb_ptr2cells utf_ptr2cells
|
||||||
#define mb_ptr2cells_len utf_ptr2cells_len
|
#define mb_ptr2cells_len utf_ptr2cells_len
|
||||||
#define mb_char2cells utf_char2cells
|
#define mb_char2cells utf_char2cells
|
||||||
#define mb_head_off utf_head_off
|
|
||||||
|
|
||||||
/// Flags for vimconv_T
|
/// Flags for vimconv_T
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -4042,7 +4042,7 @@ int dec(pos_T *lp)
|
|||||||
lp->col--;
|
lp->col--;
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
p = ml_get(lp->lnum);
|
p = ml_get(lp->lnum);
|
||||||
lp->col -= (*mb_head_off)(p, p + lp->col);
|
lp->col -= utf_head_off(p, p + lp->col);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -4051,7 +4051,7 @@ int dec(pos_T *lp)
|
|||||||
p = ml_get(lp->lnum);
|
p = ml_get(lp->lnum);
|
||||||
lp->col = (colnr_T)STRLEN(p);
|
lp->col = (colnr_T)STRLEN(p);
|
||||||
if (has_mbyte) {
|
if (has_mbyte) {
|
||||||
lp->col -= (*mb_head_off)(p, p + lp->col);
|
lp->col -= utf_head_off(p, p + lp->col);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -548,7 +548,7 @@ open_line (
|
|||||||
|
|
||||||
/* blank-out any other chars from the old leader. */
|
/* blank-out any other chars from the old leader. */
|
||||||
while (--p >= leader) {
|
while (--p >= leader) {
|
||||||
int l = mb_head_off(leader, p);
|
int l = utf_head_off(leader, p);
|
||||||
|
|
||||||
if (l > 1) {
|
if (l > 1) {
|
||||||
p -= l;
|
p -= l;
|
||||||
@ -1648,7 +1648,7 @@ int del_bytes(colnr_T count, bool fixpos_arg, bool use_delcombine)
|
|||||||
curwin->w_cursor.coladd = 0;
|
curwin->w_cursor.coladd = 0;
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
curwin->w_cursor.col -=
|
curwin->w_cursor.col -=
|
||||||
(*mb_head_off)(oldp, oldp + curwin->w_cursor.col);
|
utf_head_off(oldp, oldp + curwin->w_cursor.col);
|
||||||
}
|
}
|
||||||
count = oldlen - col;
|
count = oldlen - col;
|
||||||
movelen = 1;
|
movelen = 1;
|
||||||
|
@ -2858,7 +2858,7 @@ static void find_start_of_word(pos_T *pos)
|
|||||||
|
|
||||||
while (pos->col > 0) {
|
while (pos->col > 0) {
|
||||||
col = pos->col - 1;
|
col = pos->col - 1;
|
||||||
col -= (*mb_head_off)(line, line + col);
|
col -= utf_head_off(line, line + col);
|
||||||
if (get_mouse_class(line + col) != cclass)
|
if (get_mouse_class(line + col) != cclass)
|
||||||
break;
|
break;
|
||||||
pos->col = col;
|
pos->col = col;
|
||||||
@ -2878,7 +2878,7 @@ static void find_end_of_word(pos_T *pos)
|
|||||||
line = ml_get(pos->lnum);
|
line = ml_get(pos->lnum);
|
||||||
if (*p_sel == 'e' && pos->col > 0) {
|
if (*p_sel == 'e' && pos->col > 0) {
|
||||||
--pos->col;
|
--pos->col;
|
||||||
pos->col -= (*mb_head_off)(line, line + pos->col);
|
pos->col -= utf_head_off(line, line + pos->col);
|
||||||
}
|
}
|
||||||
cclass = get_mouse_class(line + pos->col);
|
cclass = get_mouse_class(line + pos->col);
|
||||||
while (line[pos->col] != NUL) {
|
while (line[pos->col] != NUL) {
|
||||||
@ -3062,7 +3062,7 @@ size_t find_ident_at_pos(win_T *wp, linenr_T lnum, colnr_T startcol,
|
|||||||
/* Remember class of character under cursor. */
|
/* Remember class of character under cursor. */
|
||||||
this_class = mb_get_class(ptr + col);
|
this_class = mb_get_class(ptr + col);
|
||||||
while (col > 0 && this_class != 0) {
|
while (col > 0 && this_class != 0) {
|
||||||
prevcol = col - 1 - (*mb_head_off)(ptr, ptr + col - 1);
|
prevcol = col - 1 - utf_head_off(ptr, ptr + col - 1);
|
||||||
prev_class = mb_get_class(ptr + prevcol);
|
prev_class = mb_get_class(ptr + prevcol);
|
||||||
if (this_class != prev_class
|
if (this_class != prev_class
|
||||||
&& (i == 0
|
&& (i == 0
|
||||||
|
@ -525,7 +525,7 @@ static void block_insert(oparg_T *oap, char_u *s, int b_insert, struct block_def
|
|||||||
|
|
||||||
// Avoid starting halfway through a multi-byte character.
|
// Avoid starting halfway through a multi-byte character.
|
||||||
if (b_insert) {
|
if (b_insert) {
|
||||||
off = (*mb_head_off)(oldp, oldp + offset + spaces);
|
off = utf_head_off(oldp, oldp + offset + spaces);
|
||||||
} else {
|
} else {
|
||||||
off = (*mb_off_next)(oldp, oldp + offset);
|
off = (*mb_off_next)(oldp, oldp + offset);
|
||||||
offset += off;
|
offset += off;
|
||||||
@ -2435,7 +2435,7 @@ static void op_yank_reg(oparg_T *oap, bool message, yankreg_T *reg, bool append)
|
|||||||
/* Don't add space for double-wide
|
/* Don't add space for double-wide
|
||||||
* char; endcol will be on last byte
|
* char; endcol will be on last byte
|
||||||
* of multi-byte char. */
|
* of multi-byte char. */
|
||||||
&& (*mb_head_off)(p, p + endcol) == 0
|
&& utf_head_off(p, p + endcol) == 0
|
||||||
)) {
|
)) {
|
||||||
if (oap->start.lnum == oap->end.lnum
|
if (oap->start.lnum == oap->end.lnum
|
||||||
&& oap->start.col == oap->end.col) {
|
&& oap->start.col == oap->end.col) {
|
||||||
@ -2992,7 +2992,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
|
|||||||
bd.startspaces = incr - bd.endspaces;
|
bd.startspaces = incr - bd.endspaces;
|
||||||
--bd.textcol;
|
--bd.textcol;
|
||||||
delcount = 1;
|
delcount = 1;
|
||||||
bd.textcol -= (*mb_head_off)(oldp, oldp + bd.textcol);
|
bd.textcol -= utf_head_off(oldp, oldp + bd.textcol);
|
||||||
if (oldp[bd.textcol] != TAB) {
|
if (oldp[bd.textcol] != TAB) {
|
||||||
/* Only a Tab can be split into spaces. Other
|
/* Only a Tab can be split into spaces. Other
|
||||||
* characters will have to be moved to after the
|
* characters will have to be moved to after the
|
||||||
|
@ -1819,7 +1819,7 @@ void path_fix_case(char_u *name)
|
|||||||
int after_pathsep(const char *b, const char *p)
|
int after_pathsep(const char *b, const char *p)
|
||||||
{
|
{
|
||||||
return p > b && vim_ispathsep(p[-1])
|
return p > b && vim_ispathsep(p[-1])
|
||||||
&& (!has_mbyte || (*mb_head_off)((char_u *)b, (char_u *)p - 1) == 0);
|
&& (!has_mbyte || utf_head_off((char_u *)b, (char_u *)p - 1) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3653,7 +3653,7 @@ static long regtry(bt_regprog_T *prog, colnr_T col)
|
|||||||
static int reg_prev_class(void)
|
static int reg_prev_class(void)
|
||||||
{
|
{
|
||||||
if (reginput > regline) {
|
if (reginput > regline) {
|
||||||
return mb_get_class_tab(reginput - 1 - (*mb_head_off)(regline,
|
return mb_get_class_tab(reginput - 1 - utf_head_off(regline,
|
||||||
reginput - 1),
|
reginput - 1),
|
||||||
rex.reg_buf->b_chartab);
|
rex.reg_buf->b_chartab);
|
||||||
}
|
}
|
||||||
|
@ -4640,7 +4640,7 @@ static int recursive_regmatch(nfa_state_T *state, nfa_pim_T *pim, nfa_regprog_T
|
|||||||
if ((int)(reginput - regline) >= state->val) {
|
if ((int)(reginput - regline) >= state->val) {
|
||||||
reginput -= state->val;
|
reginput -= state->val;
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
reginput -= mb_head_off(regline, reginput);
|
reginput -= utf_head_off(regline, reginput);
|
||||||
} else
|
} else
|
||||||
reginput = regline;
|
reginput = regline;
|
||||||
}
|
}
|
||||||
|
@ -3430,7 +3430,7 @@ win_line (
|
|||||||
// Found last space before word: check for line break.
|
// Found last space before word: check for line break.
|
||||||
if (wp->w_p_lbr && c0 == c && vim_isbreak(c)
|
if (wp->w_p_lbr && c0 == c && vim_isbreak(c)
|
||||||
&& !vim_isbreak((int)(*ptr))) {
|
&& !vim_isbreak((int)(*ptr))) {
|
||||||
int mb_off = has_mbyte ? (*mb_head_off)(line, ptr - 1) : 0;
|
int mb_off = has_mbyte ? utf_head_off(line, ptr - 1) : 0;
|
||||||
char_u *p = ptr - (mb_off + 1);
|
char_u *p = ptr - (mb_off + 1);
|
||||||
// TODO: is passing p for start of the line OK?
|
// TODO: is passing p for start of the line OK?
|
||||||
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, NULL) - 1;
|
n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, NULL) - 1;
|
||||||
|
@ -821,7 +821,7 @@ int searchit(
|
|||||||
if (has_mbyte
|
if (has_mbyte
|
||||||
&& pos->lnum <= buf->b_ml.ml_line_count) {
|
&& pos->lnum <= buf->b_ml.ml_line_count) {
|
||||||
ptr = ml_get_buf(buf, pos->lnum, FALSE);
|
ptr = ml_get_buf(buf, pos->lnum, FALSE);
|
||||||
pos->col -= (*mb_head_off)(ptr, ptr + pos->col);
|
pos->col -= utf_head_off(ptr, ptr + pos->col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1419,7 +1419,7 @@ int searchc(cmdarg_T *cap, int t_cmd)
|
|||||||
} else {
|
} else {
|
||||||
if (col == 0)
|
if (col == 0)
|
||||||
return FAIL;
|
return FAIL;
|
||||||
col -= (*mb_head_off)(p, p + col - 1) + 1;
|
col -= utf_head_off(p, p + col - 1) + 1;
|
||||||
}
|
}
|
||||||
if (lastc_bytelen == 1) {
|
if (lastc_bytelen == 1) {
|
||||||
if (p[col] == c && stop) {
|
if (p[col] == c && stop) {
|
||||||
@ -1450,7 +1450,7 @@ int searchc(cmdarg_T *cap, int t_cmd)
|
|||||||
col += lastc_bytelen - 1;
|
col += lastc_bytelen - 1;
|
||||||
else
|
else
|
||||||
/* To previous char, which may be multi-byte. */
|
/* To previous char, which may be multi-byte. */
|
||||||
col -= (*mb_head_off)(p, p + col);
|
col -= utf_head_off(p, p + col);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
curwin->w_cursor.col = col;
|
curwin->w_cursor.col = col;
|
||||||
@ -1483,7 +1483,7 @@ static int check_prevcol(char_u *linep, int col, int ch, int *prevcol)
|
|||||||
{
|
{
|
||||||
--col;
|
--col;
|
||||||
if (col > 0 && has_mbyte)
|
if (col > 0 && has_mbyte)
|
||||||
col -= (*mb_head_off)(linep, linep + col);
|
col -= utf_head_off(linep, linep + col);
|
||||||
if (prevcol)
|
if (prevcol)
|
||||||
*prevcol = col;
|
*prevcol = col;
|
||||||
return (col >= 0 && linep[col] == ch) ? TRUE : FALSE;
|
return (col >= 0 && linep[col] == ch) ? TRUE : FALSE;
|
||||||
@ -1795,7 +1795,7 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
} else {
|
} else {
|
||||||
--pos.col;
|
--pos.col;
|
||||||
if (has_mbyte)
|
if (has_mbyte)
|
||||||
pos.col -= (*mb_head_off)(linep, linep + pos.col);
|
pos.col -= utf_head_off(linep, linep + pos.col);
|
||||||
}
|
}
|
||||||
} else { /* forward search */
|
} else { /* forward search */
|
||||||
if (linep[pos.col] == NUL
|
if (linep[pos.col] == NUL
|
||||||
@ -2386,7 +2386,7 @@ findpar (
|
|||||||
if ((curwin->w_cursor.col = (colnr_T)STRLEN(line)) != 0) {
|
if ((curwin->w_cursor.col = (colnr_T)STRLEN(line)) != 0) {
|
||||||
curwin->w_cursor.col--;
|
curwin->w_cursor.col--;
|
||||||
curwin->w_cursor.col -=
|
curwin->w_cursor.col -=
|
||||||
(*mb_head_off)(line, line + curwin->w_cursor.col);
|
utf_head_off(line, line + curwin->w_cursor.col);
|
||||||
*pincl = true;
|
*pincl = true;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
@ -3692,7 +3692,7 @@ find_prev_quote(
|
|||||||
|
|
||||||
while (col_start > 0) {
|
while (col_start > 0) {
|
||||||
--col_start;
|
--col_start;
|
||||||
col_start -= (*mb_head_off)(line, line + col_start);
|
col_start -= utf_head_off(line, line + col_start);
|
||||||
n = 0;
|
n = 0;
|
||||||
if (escape != NULL)
|
if (escape != NULL)
|
||||||
while (col_start - n > 0 && vim_strchr(escape,
|
while (col_start - n > 0 && vim_strchr(escape,
|
||||||
|
@ -688,7 +688,7 @@ static void find_word(matchinf_T *mip, int mode)
|
|||||||
arridx = endidx[endidxcnt];
|
arridx = endidx[endidxcnt];
|
||||||
wlen = endlen[endidxcnt];
|
wlen = endlen[endidxcnt];
|
||||||
|
|
||||||
if ((*mb_head_off)(ptr, ptr + wlen) > 0)
|
if (utf_head_off(ptr, ptr + wlen) > 0)
|
||||||
continue; // not at first byte of character
|
continue; // not at first byte of character
|
||||||
if (spell_iswordp(ptr + wlen, mip->mi_win)) {
|
if (spell_iswordp(ptr + wlen, mip->mi_win)) {
|
||||||
if (slang->sl_compprog == NULL && !slang->sl_nobreak)
|
if (slang->sl_compprog == NULL && !slang->sl_nobreak)
|
||||||
|
@ -1730,7 +1730,7 @@ static int syn_current_attr(
|
|||||||
&& (current_col == 0
|
&& (current_col == 0
|
||||||
|| !vim_iswordp_buf(line + current_col - 1
|
|| !vim_iswordp_buf(line + current_col - 1
|
||||||
- (has_mbyte
|
- (has_mbyte
|
||||||
? (*mb_head_off)(line, line + current_col - 1)
|
? utf_head_off(line, line + current_col - 1)
|
||||||
: 0)
|
: 0)
|
||||||
, syn_buf))) {
|
, syn_buf))) {
|
||||||
syn_id = check_keyword_id(line, (int)current_col,
|
syn_id = check_keyword_id(line, (int)current_col,
|
||||||
|
@ -5130,7 +5130,7 @@ file_name_in_line (
|
|||||||
* Go one char back to ":" before "//" even when ':' is not in 'isfname'.
|
* Go one char back to ":" before "//" even when ':' is not in 'isfname'.
|
||||||
*/
|
*/
|
||||||
while (ptr > line) {
|
while (ptr > line) {
|
||||||
if (has_mbyte && (len = (size_t)((*mb_head_off)(line, ptr - 1))) > 0)
|
if (has_mbyte && (len = (size_t)(utf_head_off(line, ptr - 1))) > 0)
|
||||||
ptr -= len + 1;
|
ptr -= len + 1;
|
||||||
else if (vim_isfilec(ptr[-1])
|
else if (vim_isfilec(ptr[-1])
|
||||||
|| ((options & FNAME_HYP) && path_is_url((char *)ptr - 1)))
|
|| ((options & FNAME_HYP) && path_is_url((char *)ptr - 1)))
|
||||||
|
Loading…
Reference in New Issue
Block a user