mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
Merge #8863 'refactor: Remove mb_head_off() '
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user