* 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
  following 'p' vi command pasted the text affected by the former vi command.
  It now pastes the text of the last yank or delete even if that was an ex
  command.
This commit is contained in:
Gunnar Ritter 2005-01-02 14:58:49 +00:00
parent 34bb648726
commit 6b5d023516
5 changed files with 23 additions and 12 deletions

View File

@ -4,6 +4,11 @@ Release ...
other than xterm.
* Handle character case conversions with the '~' vi command correctly if the
length of the converted multibyte sequence is smaller than the original one.
* 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
following 'p' vi command pasted the text affected by the former vi command.
It now pastes the text of the last yank or delete even if that was an ex
command.
Release 12/2/04
* Support for multibyte character locales was added.

View File

@ -73,7 +73,7 @@
#ifndef lint
#ifdef DOSCCS
static char sccsid[] = "@(#)ex_cmds.c 1.17 (gritter) 11/27/04";
static char sccsid[] = "@(#)ex_cmds.c 1.18 (gritter) 1/2/05";
#endif
#endif
@ -330,6 +330,7 @@ changdir:
YANKreg(c);
delete(0);
appendnone();
vkillDEL();
continue;
/* edit */
@ -817,6 +818,7 @@ wq:
YANKreg(c);
else
yank(0);
vkillDEL();
continue;
/* z */

View File

@ -70,7 +70,7 @@
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* @(#)ex_proto.h 1.24 (gritter) 12/1/04
* @(#)ex_proto.h 1.25 (gritter) 1/2/05
*/
/*
@ -475,6 +475,7 @@ extern void vshift(int);
extern void vrep(register int);
extern void vyankit(int);
extern void setpk(void);
extern void vkillDEL(void);
/* ex_vops2.c */
extern void bleep(register int, char *);
extern int vdcMID(void);

11
ex_re.c
View File

@ -73,7 +73,7 @@
#ifndef lint
#ifdef DOSCCS
static char sccsid[] = "@(#)ex_re.c 1.42 (gritter) 12/1/04";
static char sccsid[] = "@(#)ex_re.c 1.43 (gritter) 1/2/05";
#endif
#endif
@ -517,15 +517,8 @@ confirmed(line *a)
return (1);
pofix();
pline(lineno(a));
if (inopen) {
#ifndef BIT8
if (inopen)
putchar('\n' | QUOTE);
#else
if (Putchar == listchar)
putchar('$');
putchar('\n');
#endif
}
c = column(loc1 - 1);
ugo(c - 1 + (inopen ? 1 : 0), ' ');
ugo(column(loc2 - 1) - c, '^');

View File

@ -73,7 +73,7 @@
#ifndef lint
#ifdef DOSCCS
static char sccsid[] = "@(#)ex_vops.c 1.21 (gritter) 11/29/04";
static char sccsid[] = "@(#)ex_vops.c 1.22 (gritter) 1/2/05";
#endif
#endif
@ -1051,3 +1051,13 @@ setpk(void)
pkill[1] = wcursor;
}
}
/*
* Kill the last deleted part of a line so that "p" does not put it back.
* This is to be called from ex commands that delete some text.
*/
void
vkillDEL(void)
{
DEL[0] = 0;
}