*** mbyte.c~ Wed Apr 21 19:41:22 2004 --- mbyte.c Wed Apr 21 19:41:27 2004 *************** *** 2563,2591 **** } /* - * Decrement position "lp" by one character, taking care of multi-byte chars. - */ - int - mb_dec(lp) - pos_T *lp; - { - if (lp->col > 0) /* still within line */ - { - --lp->col; - mb_adjustpos(lp); - return 0; - } - if (lp->lnum > 1) /* there is a prior line */ - { - lp->lnum--; - lp->col = (colnr_T)STRLEN(ml_get(lp->lnum)); - mb_adjustpos(lp); - return 1; - } - return -1; /* at start of file */ - } - - /* * Try to un-escape a multi-byte character. * Used for the "to" and "from" part of a mapping. * Return the un-escaped string if it is a multi-byte character, and advance --- 2563,2568 ---- *** misc2.c~ Wed Apr 21 13:49:13 2004 --- misc2.c Wed Apr 21 19:41:37 2004 *************** *** 412,422 **** int dec_cursor() { - #ifdef FEAT_MBYTE - return (has_mbyte ? mb_dec(&curwin->w_cursor) : dec(&curwin->w_cursor)); - #else return dec(&curwin->w_cursor); - #endif } int --- 412,418 ---- *************** *** 426,437 **** --- 422,443 ---- if (lp->col > 0) { /* still within line */ lp->col--; + #ifdef FEAT_MBYTE + if (has_mbyte) + lp->col -= (*mb_head_off)( + ml_get(lp->lnum), ml_get(lp->lnum) + lp->col); + #endif return 0; } if (lp->lnum > 1) { /* there is a prior line */ lp->lnum--; lp->col = (colnr_T)STRLEN(ml_get(lp->lnum)); + #ifdef FEAT_MBYTE + if (has_mbyte) + lp->col -= (*mb_head_off)( + ml_get(lp->lnum), ml_get(lp->lnum) + lp->col); + #endif return 1; } return -1; /* at start of file */