mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
commit
23ba875b82
@ -723,8 +723,8 @@ static int diff_write_buffer(buf_T *buf, diffin_T *din)
|
|||||||
char_u cbuf[MB_MAXBYTES + 1];
|
char_u cbuf[MB_MAXBYTES + 1];
|
||||||
|
|
||||||
c = PTR2CHAR(s);
|
c = PTR2CHAR(s);
|
||||||
c = enc_utf8 ? utf_fold(c) : TOLOWER_LOC(c);
|
c = utf_fold(c);
|
||||||
orig_len = MB_PTR2LEN(s);
|
orig_len = utfc_ptr2len(s);
|
||||||
if (utf_char2bytes(c, cbuf) != orig_len) {
|
if (utf_char2bytes(c, cbuf) != orig_len) {
|
||||||
// TODO(Bram): handle byte length difference
|
// TODO(Bram): handle byte length difference
|
||||||
memmove(ptr + len, s, orig_len);
|
memmove(ptr + len, s, orig_len);
|
||||||
|
@ -15502,7 +15502,7 @@ static void f_setcharsearch(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
set_last_csearch(PTR2CHAR(csearch),
|
set_last_csearch(PTR2CHAR(csearch),
|
||||||
csearch, MB_PTR2LEN(csearch));
|
csearch, utfc_ptr2len(csearch));
|
||||||
}
|
}
|
||||||
|
|
||||||
di = tv_dict_find(d, S_LEN("forward"));
|
di = tv_dict_find(d, S_LEN("forward"));
|
||||||
@ -24051,8 +24051,8 @@ char_u *do_string_sub(char_u *str, char_u *pat, char_u *sub,
|
|||||||
/* Skip empty match except for first match. */
|
/* Skip empty match except for first match. */
|
||||||
if (regmatch.startp[0] == regmatch.endp[0]) {
|
if (regmatch.startp[0] == regmatch.endp[0]) {
|
||||||
if (zero_width == regmatch.startp[0]) {
|
if (zero_width == regmatch.startp[0]) {
|
||||||
/* avoid getting stuck on a match with an empty string */
|
// avoid getting stuck on a match with an empty string
|
||||||
int i = MB_PTR2LEN(tail);
|
int i = utfc_ptr2len(tail);
|
||||||
memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i);
|
memmove((char_u *)ga.ga_data + ga.ga_len, tail, (size_t)i);
|
||||||
ga.ga_len += i;
|
ga.ga_len += i;
|
||||||
tail += i;
|
tail += i;
|
||||||
|
@ -2320,7 +2320,7 @@ redraw:
|
|||||||
} while (++vcol % 8);
|
} while (++vcol % 8);
|
||||||
p++;
|
p++;
|
||||||
} else {
|
} else {
|
||||||
len = MB_PTR2LEN(p);
|
len = utfc_ptr2len(p);
|
||||||
msg_outtrans_len(p, len);
|
msg_outtrans_len(p, len);
|
||||||
vcol += ptr2cells(p);
|
vcol += ptr2cells(p);
|
||||||
p += len;
|
p += len;
|
||||||
|
@ -1102,8 +1102,8 @@ static bool ff_wc_equal(char_u *s1, char_u *s2)
|
|||||||
prev2 = prev1;
|
prev2 = prev1;
|
||||||
prev1 = c1;
|
prev1 = c1;
|
||||||
|
|
||||||
i += MB_PTR2LEN(s1 + i);
|
i += utfc_ptr2len(s1 + i);
|
||||||
j += MB_PTR2LEN(s2 + j);
|
j += utfc_ptr2len(s2 + j);
|
||||||
}
|
}
|
||||||
return s1[i] == s2[j];
|
return s1[i] == s2[j];
|
||||||
}
|
}
|
||||||
|
@ -1833,13 +1833,13 @@ static int vgetorpeek(int advance)
|
|||||||
char_u *p1 = mp->m_keys;
|
char_u *p1 = mp->m_keys;
|
||||||
char_u *p2 = (char_u *)mb_unescape((const char **)&p1);
|
char_u *p2 = (char_u *)mb_unescape((const char **)&p1);
|
||||||
|
|
||||||
if (has_mbyte && p2 != NULL && MB_BYTE2LEN(c1) > MB_PTR2LEN(p2))
|
if (p2 != NULL && MB_BYTE2LEN(c1) > utfc_ptr2len(p2)) {
|
||||||
mlen = 0;
|
mlen = 0;
|
||||||
/*
|
}
|
||||||
* Check an entry whether it matches.
|
|
||||||
* - Full match: mlen == keylen
|
// Check an entry whether it matches.
|
||||||
* - Partly match: mlen == typebuf.tb_len
|
// - Full match: mlen == keylen
|
||||||
*/
|
// - Partly match: mlen == typebuf.tb_len
|
||||||
keylen = mp->m_keylen;
|
keylen = mp->m_keylen;
|
||||||
if (mlen == keylen
|
if (mlen == keylen
|
||||||
|| (mlen == typebuf.tb_len
|
|| (mlen == typebuf.tb_len
|
||||||
|
@ -110,8 +110,6 @@
|
|||||||
// MB_COPY_CHAR(f, t): copy one char from "f" to "t" and advance the pointers.
|
// MB_COPY_CHAR(f, t): copy one char from "f" to "t" and advance the pointers.
|
||||||
// PTR2CHAR(): get character from pointer.
|
// PTR2CHAR(): get character from pointer.
|
||||||
|
|
||||||
// Get the length of the character p points to, including composing chars.
|
|
||||||
# define MB_PTR2LEN(p) mb_ptr2len(p)
|
|
||||||
// Advance multi-byte pointer, skip over composing chars.
|
// Advance multi-byte pointer, skip over composing chars.
|
||||||
# define MB_PTR_ADV(p) (p += mb_ptr2len((char_u *)p))
|
# define MB_PTR_ADV(p) (p += mb_ptr2len((char_u *)p))
|
||||||
// Advance multi-byte pointer, do not skip over composing chars.
|
// Advance multi-byte pointer, do not skip over composing chars.
|
||||||
|
@ -4641,7 +4641,7 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1)
|
|||||||
if (visual) {
|
if (visual) {
|
||||||
while (ptr[col] != NUL && length > 0 && !ascii_isdigit(ptr[col])
|
while (ptr[col] != NUL && length > 0 && !ascii_isdigit(ptr[col])
|
||||||
&& !(doalp && ASCII_ISALPHA(ptr[col]))) {
|
&& !(doalp && ASCII_ISALPHA(ptr[col]))) {
|
||||||
int mb_len = MB_PTR2LEN(ptr + col);
|
int mb_len = utfc_ptr2len(ptr + col);
|
||||||
|
|
||||||
col += mb_len;
|
col += mb_len;
|
||||||
length -= mb_len;
|
length -= mb_len;
|
||||||
|
@ -338,9 +338,9 @@ int path_fnamencmp(const char *const fname1, const char *const fname2,
|
|||||||
&& (p_fic ? (c1 != c2 && CH_FOLD(c1) != CH_FOLD(c2)) : c1 != c2)) {
|
&& (p_fic ? (c1 != c2 && CH_FOLD(c1) != CH_FOLD(c2)) : c1 != c2)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
len -= (size_t)MB_PTR2LEN((const char_u *)p1);
|
len -= (size_t)utfc_ptr2len((const char_u *)p1);
|
||||||
p1 += MB_PTR2LEN((const char_u *)p1);
|
p1 += utfc_ptr2len((const char_u *)p1);
|
||||||
p2 += MB_PTR2LEN((const char_u *)p2);
|
p2 += utfc_ptr2len((const char_u *)p2);
|
||||||
}
|
}
|
||||||
return c1 - c2;
|
return c1 - c2;
|
||||||
#else
|
#else
|
||||||
@ -1910,16 +1910,16 @@ int pathcmp(const char *p, const char *q, int maxlen)
|
|||||||
: c1 - c2; // no match
|
: c1 - c2; // no match
|
||||||
}
|
}
|
||||||
|
|
||||||
i += MB_PTR2LEN((char_u *)p + i);
|
i += utfc_ptr2len((char_u *)p + i);
|
||||||
j += MB_PTR2LEN((char_u *)q + j);
|
j += utfc_ptr2len((char_u *)q + j);
|
||||||
}
|
}
|
||||||
if (s == NULL) { // "i" or "j" ran into "maxlen"
|
if (s == NULL) { // "i" or "j" ran into "maxlen"
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
c1 = PTR2CHAR((char_u *)s + i);
|
c1 = PTR2CHAR((char_u *)s + i);
|
||||||
c2 = PTR2CHAR((char_u *)s + i + MB_PTR2LEN((char_u *)s + i));
|
c2 = PTR2CHAR((char_u *)s + i + utfc_ptr2len((char_u *)s + i));
|
||||||
/* ignore a trailing slash, but not "//" or ":/" */
|
// ignore a trailing slash, but not "//" or ":/"
|
||||||
if (c2 == NUL
|
if (c2 == NUL
|
||||||
&& i > 0
|
&& i > 0
|
||||||
&& !after_pathsep((char *)s, (char *)s + i)
|
&& !after_pathsep((char *)s, (char *)s + i)
|
||||||
@ -1928,10 +1928,12 @@ int pathcmp(const char *p, const char *q, int maxlen)
|
|||||||
#else
|
#else
|
||||||
&& c1 == '/'
|
&& c1 == '/'
|
||||||
#endif
|
#endif
|
||||||
)
|
) {
|
||||||
return 0; /* match with trailing slash */
|
return 0; // match with trailing slash
|
||||||
if (s == q)
|
}
|
||||||
return -1; /* no match */
|
if (s == q) {
|
||||||
|
return -1; // no match
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4943,7 +4943,7 @@ static int skip_to_start(int c, colnr_T *colp)
|
|||||||
*/
|
*/
|
||||||
static long find_match_text(colnr_T startcol, int regstart, char_u *match_text)
|
static long find_match_text(colnr_T startcol, int regstart, char_u *match_text)
|
||||||
{
|
{
|
||||||
#define PTR2LEN(x) enc_utf8 ? utf_ptr2len(x) : MB_PTR2LEN(x)
|
#define PTR2LEN(x) utf_ptr2len(x)
|
||||||
|
|
||||||
colnr_T col = startcol;
|
colnr_T col = startcol;
|
||||||
int regstart_len = PTR2LEN(regline + startcol);
|
int regstart_len = PTR2LEN(regline + startcol);
|
||||||
|
@ -2994,7 +2994,7 @@ win_line (
|
|||||||
if (shl->startcol != MAXCOL
|
if (shl->startcol != MAXCOL
|
||||||
&& v >= (long)shl->startcol
|
&& v >= (long)shl->startcol
|
||||||
&& v < (long)shl->endcol) {
|
&& v < (long)shl->endcol) {
|
||||||
int tmp_col = v + MB_PTR2LEN(ptr);
|
int tmp_col = v + utfc_ptr2len(ptr);
|
||||||
|
|
||||||
if (shl->endcol < tmp_col) {
|
if (shl->endcol < tmp_col) {
|
||||||
shl->endcol = tmp_col;
|
shl->endcol = tmp_col;
|
||||||
|
@ -681,7 +681,7 @@ int searchit(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (matchcol == matchpos.col && ptr[matchcol] != NUL) {
|
if (matchcol == matchpos.col && ptr[matchcol] != NUL) {
|
||||||
matchcol += MB_PTR2LEN(ptr + matchcol);
|
matchcol += utfc_ptr2len(ptr + matchcol);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (matchcol == 0 && (options & SEARCH_START)) {
|
if (matchcol == 0 && (options & SEARCH_START)) {
|
||||||
@ -1755,7 +1755,7 @@ pos_T *findmatchlimit(oparg_T *oap, int initc, int flags, int64_t maxtravel)
|
|||||||
find_mps_values(&initc, &findc, &backwards, FALSE);
|
find_mps_values(&initc, &findc, &backwards, FALSE);
|
||||||
if (findc)
|
if (findc)
|
||||||
break;
|
break;
|
||||||
pos.col += MB_PTR2LEN(linep + pos.col);
|
pos.col += utfc_ptr2len(linep + pos.col);
|
||||||
}
|
}
|
||||||
if (!findc) {
|
if (!findc) {
|
||||||
/* no brace in the line, maybe use " #if" then */
|
/* no brace in the line, maybe use " #if" then */
|
||||||
@ -2234,14 +2234,14 @@ showmatch(
|
|||||||
for (p = curbuf->b_p_mps; *p != NUL; ++p) {
|
for (p = curbuf->b_p_mps; *p != NUL; ++p) {
|
||||||
if (PTR2CHAR(p) == c && (curwin->w_p_rl ^ p_ri))
|
if (PTR2CHAR(p) == c && (curwin->w_p_rl ^ p_ri))
|
||||||
break;
|
break;
|
||||||
p += MB_PTR2LEN(p) + 1;
|
p += utfc_ptr2len(p) + 1;
|
||||||
if (PTR2CHAR(p) == c
|
if (PTR2CHAR(p) == c && !(curwin->w_p_rl ^ p_ri)) {
|
||||||
&& !(curwin->w_p_rl ^ p_ri)
|
|
||||||
)
|
|
||||||
break;
|
break;
|
||||||
p += MB_PTR2LEN(p);
|
}
|
||||||
if (*p == NUL)
|
p += utfc_ptr2len(p);
|
||||||
|
if (*p == NUL) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((lpos = findmatch(NULL, NUL)) == NULL) { // no match, so beep
|
if ((lpos = findmatch(NULL, NUL)) == NULL) { // no match, so beep
|
||||||
@ -4845,7 +4845,7 @@ exit_matched:
|
|||||||
&& action == ACTION_EXPAND
|
&& action == ACTION_EXPAND
|
||||||
&& !(compl_cont_status & CONT_SOL)
|
&& !(compl_cont_status & CONT_SOL)
|
||||||
&& *startp != NUL
|
&& *startp != NUL
|
||||||
&& *(p = startp + MB_PTR2LEN(startp)) != NUL)
|
&& *(p = startp + utfc_ptr2len(startp)) != NUL)
|
||||||
goto search_line;
|
goto search_line;
|
||||||
}
|
}
|
||||||
line_breakcheck();
|
line_breakcheck();
|
||||||
|
@ -2570,36 +2570,33 @@ void init_spell_chartab(void)
|
|||||||
/// Thus this only works properly when past the first character of the word.
|
/// Thus this only works properly when past the first character of the word.
|
||||||
///
|
///
|
||||||
/// @param wp Buffer used.
|
/// @param wp Buffer used.
|
||||||
static bool spell_iswordp(char_u *p, win_T *wp)
|
static bool spell_iswordp(const char_u *p, const win_T *wp)
|
||||||
|
FUNC_ATTR_NONNULL_ALL
|
||||||
{
|
{
|
||||||
char_u *s;
|
|
||||||
int l;
|
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
if (has_mbyte) {
|
const int l = utfc_ptr2len(p);
|
||||||
l = MB_PTR2LEN(p);
|
const char_u *s = p;
|
||||||
s = p;
|
if (l == 1) {
|
||||||
if (l == 1) {
|
// be quick for ASCII
|
||||||
// be quick for ASCII
|
if (wp->w_s->b_spell_ismw[*p]) {
|
||||||
if (wp->w_s->b_spell_ismw[*p])
|
s = p + 1; // skip a mid-word character
|
||||||
s = p + 1; // skip a mid-word character
|
|
||||||
} else {
|
|
||||||
c = utf_ptr2char(p);
|
|
||||||
if (c < 256 ? wp->w_s->b_spell_ismw[c]
|
|
||||||
: (wp->w_s->b_spell_ismw_mb != NULL
|
|
||||||
&& vim_strchr(wp->w_s->b_spell_ismw_mb, c) != NULL)) {
|
|
||||||
s = p + l;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
c = utf_ptr2char(s);
|
c = utf_ptr2char(p);
|
||||||
if (c > 255) {
|
if (c < 256
|
||||||
return spell_mb_isword_class(mb_get_class(s), wp);
|
? wp->w_s->b_spell_ismw[c]
|
||||||
|
: (wp->w_s->b_spell_ismw_mb != NULL
|
||||||
|
&& vim_strchr(wp->w_s->b_spell_ismw_mb, c) != NULL)) {
|
||||||
|
s = p + l;
|
||||||
}
|
}
|
||||||
return spelltab.st_isw[c];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return spelltab.st_isw[wp->w_s->b_spell_ismw[*p] ? p[1] : p[0]];
|
c = utf_ptr2char(s);
|
||||||
|
if (c > 255) {
|
||||||
|
return spell_mb_isword_class(mb_get_class(s), wp);
|
||||||
|
}
|
||||||
|
return spelltab.st_isw[c];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if "p" points to a word character.
|
// Returns true if "p" points to a word character.
|
||||||
@ -2617,7 +2614,8 @@ bool spell_iswordp_nmw(const char_u *p, win_T *wp)
|
|||||||
// Only for characters above 255.
|
// Only for characters above 255.
|
||||||
// Unicode subscript and superscript are not considered word characters.
|
// Unicode subscript and superscript are not considered word characters.
|
||||||
// See also utf_class() in mbyte.c.
|
// See also utf_class() in mbyte.c.
|
||||||
static bool spell_mb_isword_class(int cl, win_T *wp)
|
static bool spell_mb_isword_class(int cl, const win_T *wp)
|
||||||
|
FUNC_ATTR_PURE FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT
|
||||||
{
|
{
|
||||||
if (wp->w_s->b_cjk)
|
if (wp->w_s->b_cjk)
|
||||||
// East Asian characters are not considered word characters.
|
// East Asian characters are not considered word characters.
|
||||||
@ -4118,7 +4116,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
|||||||
&& goodword_ends) {
|
&& goodword_ends) {
|
||||||
int l;
|
int l;
|
||||||
|
|
||||||
l = MB_PTR2LEN(fword + sp->ts_fidx);
|
l = utfc_ptr2len(fword + sp->ts_fidx);
|
||||||
if (fword_ends) {
|
if (fword_ends) {
|
||||||
// Copy the skipped character to preword.
|
// Copy the skipped character to preword.
|
||||||
memmove(preword + sp->ts_prewordlen,
|
memmove(preword + sp->ts_prewordlen,
|
||||||
@ -4264,7 +4262,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
|||||||
// Correct ts_fidx for the byte length of the
|
// Correct ts_fidx for the byte length of the
|
||||||
// character (we didn't check that before).
|
// character (we didn't check that before).
|
||||||
sp->ts_fidx = sp->ts_fcharstart
|
sp->ts_fidx = sp->ts_fcharstart
|
||||||
+ MB_PTR2LEN(fword + sp->ts_fcharstart);
|
+ utfc_ptr2len(fword + sp->ts_fcharstart);
|
||||||
|
|
||||||
// For changing a composing character adjust
|
// For changing a composing character adjust
|
||||||
// the score from SCORE_SUBST to
|
// the score from SCORE_SUBST to
|
||||||
@ -4363,7 +4361,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
|||||||
// a bit illogical for soundfold tree but it does give better
|
// a bit illogical for soundfold tree but it does give better
|
||||||
// results.
|
// results.
|
||||||
c = utf_ptr2char(fword + sp->ts_fidx);
|
c = utf_ptr2char(fword + sp->ts_fidx);
|
||||||
stack[depth].ts_fidx += MB_PTR2LEN(fword + sp->ts_fidx);
|
stack[depth].ts_fidx += utfc_ptr2len(fword + sp->ts_fidx);
|
||||||
if (utf_iscomposing(c)) {
|
if (utf_iscomposing(c)) {
|
||||||
stack[depth].ts_score -= SCORE_DEL - SCORE_DELCOMP;
|
stack[depth].ts_score -= SCORE_DEL - SCORE_DELCOMP;
|
||||||
} else if (c == utf_ptr2char(fword + stack[depth].ts_fidx)) {
|
} else if (c == utf_ptr2char(fword + stack[depth].ts_fidx)) {
|
||||||
@ -4533,9 +4531,9 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
|||||||
case STATE_UNSWAP:
|
case STATE_UNSWAP:
|
||||||
// Undo the STATE_SWAP swap: "21" -> "12".
|
// Undo the STATE_SWAP swap: "21" -> "12".
|
||||||
p = fword + sp->ts_fidx;
|
p = fword + sp->ts_fidx;
|
||||||
n = MB_PTR2LEN(p);
|
n = utfc_ptr2len(p);
|
||||||
c = utf_ptr2char(p + n);
|
c = utf_ptr2char(p + n);
|
||||||
memmove(p + MB_PTR2LEN(p + n), p, n);
|
memmove(p + utfc_ptr2len(p + n), p, n);
|
||||||
utf_char2bytes(c, p);
|
utf_char2bytes(c, p);
|
||||||
|
|
||||||
FALLTHROUGH;
|
FALLTHROUGH;
|
||||||
@ -4589,11 +4587,11 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
|||||||
case STATE_UNSWAP3:
|
case STATE_UNSWAP3:
|
||||||
// Undo STATE_SWAP3: "321" -> "123"
|
// Undo STATE_SWAP3: "321" -> "123"
|
||||||
p = fword + sp->ts_fidx;
|
p = fword + sp->ts_fidx;
|
||||||
n = MB_PTR2LEN(p);
|
n = utfc_ptr2len(p);
|
||||||
c2 = utf_ptr2char(p + n);
|
c2 = utf_ptr2char(p + n);
|
||||||
fl = MB_PTR2LEN(p + n);
|
fl = utfc_ptr2len(p + n);
|
||||||
c = utf_ptr2char(p + n + fl);
|
c = utf_ptr2char(p + n + fl);
|
||||||
tl = MB_PTR2LEN(p + n + fl);
|
tl = utfc_ptr2len(p + n + fl);
|
||||||
memmove(p + fl + tl, p, n);
|
memmove(p + fl + tl, p, n);
|
||||||
utf_char2bytes(c, p);
|
utf_char2bytes(c, p);
|
||||||
utf_char2bytes(c2, p + tl);
|
utf_char2bytes(c2, p + tl);
|
||||||
@ -4637,10 +4635,10 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
|||||||
case STATE_UNROT3L:
|
case STATE_UNROT3L:
|
||||||
// Undo ROT3L: "231" -> "123"
|
// Undo ROT3L: "231" -> "123"
|
||||||
p = fword + sp->ts_fidx;
|
p = fword + sp->ts_fidx;
|
||||||
n = MB_PTR2LEN(p);
|
n = utfc_ptr2len(p);
|
||||||
n += MB_PTR2LEN(p + n);
|
n += utfc_ptr2len(p + n);
|
||||||
c = utf_ptr2char(p + n);
|
c = utf_ptr2char(p + n);
|
||||||
tl = MB_PTR2LEN(p + n);
|
tl = utfc_ptr2len(p + n);
|
||||||
memmove(p + tl, p, n);
|
memmove(p + tl, p, n);
|
||||||
utf_char2bytes(c, p);
|
utf_char2bytes(c, p);
|
||||||
|
|
||||||
@ -4675,9 +4673,9 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
|
|||||||
// Undo ROT3R: "312" -> "123"
|
// Undo ROT3R: "312" -> "123"
|
||||||
p = fword + sp->ts_fidx;
|
p = fword + sp->ts_fidx;
|
||||||
c = utf_ptr2char(p);
|
c = utf_ptr2char(p);
|
||||||
tl = MB_PTR2LEN(p);
|
tl = utfc_ptr2len(p);
|
||||||
n = MB_PTR2LEN(p + tl);
|
n = utfc_ptr2len(p + tl);
|
||||||
n += MB_PTR2LEN(p + tl + n);
|
n += utfc_ptr2len(p + tl + n);
|
||||||
memmove(p, p + tl, n);
|
memmove(p, p + tl, n);
|
||||||
utf_char2bytes(c, p + n);
|
utf_char2bytes(c, p + n);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user