vim-patch:8.0.0446: the ";" command does not work after some characters

Problem:    The ";" command does not work after characters with a lower byte
            that is NUL.
Solution:   Properly check for not having a previous character. (Hirohito
            Higashi)

454709baff
This commit is contained in:
Justin M. Keyes
2018-02-11 20:05:57 +01:00
parent ff4a628081
commit 1257b04747
3 changed files with 51 additions and 4 deletions

View File

@@ -1380,13 +1380,15 @@ int searchc(cmdarg_T *cap, int t_cmd)
lastc_bytelen += (*mb_char2bytes)(cap->ncharC2, lastc_bytes + lastc_bytelen);
}
}
} else { /* repeat previous search */
if (*lastc == NUL)
} else { // repeat previous search
if (*lastc == NUL && lastc_bytelen == 1) {
return FAIL;
if (dir) /* repeat in opposite direction */
}
if (dir) { // repeat in opposite direction
dir = -lastcdir;
else
} else {
dir = lastcdir;
}
t_cmd = last_t_cmd;
c = *lastc;
/* For multi-byte re-use last lastc_bytes[] and lastc_bytelen. */