comparison src/ops.c @ 4203:eea32254940f v7.3.853

updated for version 7.3.853 Problem: Using "ra" in multiple lines on multi-byte characters leaves a few characters not replaced. Solution: Adjust the end column only in the last line. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Thu, 07 Mar 2013 18:50:57 +0100
parents 3fd805ca2a6a
children fb533fb6c015
comparison
equal deleted inserted replaced
4202:97591d534d42 4203:eea32254940f
2192 #ifdef FEAT_MBYTE 2192 #ifdef FEAT_MBYTE
2193 if ((*mb_char2len)(c) > 1 || (*mb_char2len)(n) > 1) 2193 if ((*mb_char2len)(c) > 1 || (*mb_char2len)(n) > 1)
2194 { 2194 {
2195 /* This is slow, but it handles replacing a single-byte 2195 /* This is slow, but it handles replacing a single-byte
2196 * with a multi-byte and the other way around. */ 2196 * with a multi-byte and the other way around. */
2197 oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n); 2197 if (curwin->w_cursor.lnum == oap->end.lnum)
2198 oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n);
2198 n = State; 2199 n = State;
2199 State = REPLACE; 2200 State = REPLACE;
2200 ins_char(c); 2201 ins_char(c);
2201 State = n; 2202 State = n;
2202 /* Backup to the replaced character. */ 2203 /* Backup to the replaced character. */