Remove has_mbyte from lines near changes in parent commit

This commit is contained in:
ZviRackover
2018-08-15 22:46:48 +03:00
parent 2bddc4ca54
commit 30392b6356
14 changed files with 66 additions and 122 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 -= utf_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 -= utf_head_off(p, p + lp->col);
}
lp->col -= utf_head_off(p, p + lp->col);
return 1;
}
return -1; // at start of file