Merge #8863 'refactor: Remove mb_head_off() '

This commit is contained in:
Justin M. Keyes
2018-08-28 23:37:30 +02:00
20 changed files with 120 additions and 160 deletions

View File

@@ -4035,24 +4035,18 @@ int incl(pos_T *lp)
int dec(pos_T *lp)
{
char_u *p;
lp->coladd = 0;
if (lp->col > 0) { // still within line
lp->col--;
if (has_mbyte) {
p = ml_get(lp->lnum);
lp->col -= (*mb_head_off)(p, p + lp->col);
}
char_u *p = ml_get(lp->lnum);
lp->col -= utf_head_off(p, p + lp->col);
return 0;
}
if (lp->lnum > 1) { // there is a prior line
lp->lnum--;
p = ml_get(lp->lnum);
char_u *p = ml_get(lp->lnum);
lp->col = (colnr_T)STRLEN(p);
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; // at start of file