* Pressing the ^U (kill) character in insert mode sometimes positioned the

cursor at weird locations since the last revision (P).
This commit is contained in:
Gunnar Ritter 2005-01-13 19:21:27 +00:00
parent cffa86a85e
commit 7529db3b73
3 changed files with 11 additions and 4 deletions

View File

@ -27,6 +27,8 @@ Release ...
length of the converted multibyte sequence is smaller than the original one. length of the converted multibyte sequence is smaller than the original one.
* Multibyte sequences that correspond to an unprintable character are now * Multibyte sequences that correspond to an unprintable character are now
printed as multiple octal escape sequences. printed as multiple octal escape sequences.
* Pressing the ^U (kill) character in insert mode sometimes positioned the
cursor at weird locations since the last revision (P).
* Fixed an old vi bug: If a vi command that yanked or deleted part of a line * Fixed an old vi bug: If a vi command that yanked or deleted part of a line
was followed by an ex command that also yanked or deleted some text, a was followed by an ex command that also yanked or deleted some text, a
following 'p' vi command pasted the text affected by the former vi command. following 'p' vi command pasted the text affected by the former vi command.

5
ex.h
View File

@ -72,7 +72,7 @@
* *
* from ex.h 7.7.1.1 (Berkeley) 8/12/86 * from ex.h 7.7.1.1 (Berkeley) 8/12/86
* *
* @(#)ex.h 1.48 (gritter) 12/2/04 * @(#)ex.h 1.49 (gritter) 1/13/05
*/ */
/* /*
@ -552,7 +552,8 @@ var int mb_cur_max;
#define colsc(c) (mb_cur_max > 1 && ((c)&0177) != (c) ? wcwidth(c) : 1) #define colsc(c) (mb_cur_max > 1 && ((c)&0177) != (c) ? wcwidth(c) : 1)
#define skipleft(l, p) (mb_cur_max > 1 && ((p)[0]&0200 || \ #define skipleft(l, p) (mb_cur_max > 1 && ((p)[0]&0200 || \
(p)>(l) && (p)[-1]&0200) ? wskipleft(l, p) : -1) (p)>(l) && (p)[-1]&0200) ? wskipleft(l, p) : -1)
#define skipright(l, p) (mb_cur_max > 1 && (p)[0]&0200 ? wskipright(l, p) : 1) #define skipright(l, p) (mb_cur_max > 1 && (p)>=(l) && (p)[0]&0200 ? \
wskipright(l, p) : 1)
#define samechar(cp, c) (mb_cur_max > 1 && *(cp)&0200 ? wsamechar(cp, c) : \ #define samechar(cp, c) (mb_cur_max > 1 && *(cp)&0200 ? wsamechar(cp, c) : \
(*(cp)&0377) == c) (*(cp)&0377) == c)
#define xisdigit(c) (mb_cur_max > 1 ? iswdigit(c) : isdigit(c)) #define xisdigit(c) (mb_cur_max > 1 ? iswdigit(c) : isdigit(c))

View File

@ -73,7 +73,7 @@
#ifndef lint #ifndef lint
#ifdef DOSCCS #ifdef DOSCCS
static char sccsid[] = "@(#)ex_subr.c 1.33 (gritter) 1/12/05"; static char sccsid[] = "@(#)ex_subr.c 1.34 (gritter) 1/13/05";
#endif #endif
#endif #endif
@ -636,6 +636,10 @@ qcolumn(register char *lim, register char *gp)
Outchar = qcount; Outchar = qcount;
vcntcol = 0; vcntcol = 0;
if (lim != NULL) { if (lim != NULL) {
if (lim < linebuf) {
lim = linebuf;
n = 0;
} else
n = skipright(linebuf, lim); n = skipright(linebuf, lim);
x = lim[n], lim[n] = 0; x = lim[n], lim[n] = 0;
} }