Import nvi2 2.1.2-95773e17e2751.
This commit is contained in:
parent
be3e4646ee
commit
44e7e21f38
4
README
4
README
@ -1,6 +1,6 @@
|
||||
# $Id: README,v 9.0 2012/10/07 09:13:54 zy Exp $
|
||||
# $Id: README,v 9.1 2013/11/02 02:50:23 zy Exp $
|
||||
|
||||
This is version 2.1.1 (2012-10-07) of nex/nvi, a reimplementation of the ex/vi
|
||||
This is version 2.1.2 (2012-11-02) of nex/nvi, a reimplementation of the ex/vi
|
||||
text editors originally distributed as part of the Fourth Berkeley
|
||||
Software Distribution (4BSD), by the University of California, Berkeley.
|
||||
|
||||
|
@ -2,12 +2,38 @@
|
||||
* Copyright (c) 1992, 1993, 1994
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* %sccs.include.redist.c%
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 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.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"%Z% Copyright (c) 1992, 1993, 1994\n\
|
||||
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
|
@ -11,9 +11,9 @@
|
||||
|
||||
#ifndef lint
|
||||
static const char copyright[] =
|
||||
"%Z% Copyright (c) 1992, 1993, 1994\n\
|
||||
"@(#) Copyright (c) 1992, 1993, 1994\n\
|
||||
The Regents of the University of California. All rights reserved.\n\
|
||||
%Z% Copyright (c) 1992, 1993, 1994, 1995, 1996\n\
|
||||
@(#) Copyright (c) 1992, 1993, 1994, 1995, 1996\n\
|
||||
Keith Bostic. All rights reserved.\n";
|
||||
#endif /* not lint */
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "$Id: ex_print.c,v 10.25 2011/12/12 22:12:20 zy Exp $";
|
||||
static const char sccsid[] = "$Id: ex_print.c,v 10.26 2013/11/02 02:11:07 zy Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -213,7 +213,7 @@ ex_prchars(SCR *sp, const CHAR_T *p, size_t *colp, size_t len,
|
||||
gp = sp->gp;
|
||||
ts = O_VAL(sp, O_TABSTOP);
|
||||
for (col = *colp; len--;)
|
||||
if ((ch = *p++) == '\t' && !LF_ISSET(E_C_LIST))
|
||||
if ((ch = *p++) == L('\t') && !LF_ISSET(E_C_LIST))
|
||||
for (tlen = ts - col % ts;
|
||||
col < sp->cols && tlen--; ++col) {
|
||||
(void)ex_printf(sp,
|
||||
@ -223,21 +223,32 @@ ex_prchars(SCR *sp, const CHAR_T *p, size_t *colp, size_t len,
|
||||
}
|
||||
else {
|
||||
kp = KEY_NAME(sp, ch);
|
||||
tlen = KEY_LEN(sp, ch);
|
||||
if (!repeatc && col + tlen < sp->cols) {
|
||||
tlen = KEY_COL(sp, ch);
|
||||
|
||||
/*
|
||||
* Start a new line if the last character does not fit
|
||||
* into the current line. The implicit new lines are
|
||||
* not interruptible.
|
||||
*/
|
||||
if (col + tlen > sp->cols) {
|
||||
col = 0;
|
||||
(void)ex_puts(sp, "\n");
|
||||
}
|
||||
|
||||
col += tlen;
|
||||
if (!repeatc) {
|
||||
(void)ex_puts(sp, kp);
|
||||
col += tlen;
|
||||
} else
|
||||
for (; tlen--; ++kp, ++col) {
|
||||
if (col == sp->cols) {
|
||||
col = 0;
|
||||
(void)ex_puts(sp, "\n");
|
||||
}
|
||||
(void)ex_printf(sp,
|
||||
"%c", repeatc ? repeatc : *kp);
|
||||
if (INTERRUPTED(sp))
|
||||
goto intr;
|
||||
}
|
||||
if (INTERRUPTED(sp))
|
||||
goto intr;
|
||||
} else while (tlen--) {
|
||||
(void)ex_printf(sp, "%c", repeatc);
|
||||
if (INTERRUPTED(sp))
|
||||
goto intr;
|
||||
}
|
||||
if (col == sp->cols) {
|
||||
col = 0;
|
||||
(void)ex_puts(sp, "\n");
|
||||
}
|
||||
}
|
||||
intr: *colp = col;
|
||||
return (0);
|
||||
|
@ -295,7 +295,8 @@ v_txt(
|
||||
tiqh = sp->tiq;
|
||||
if (!TAILQ_EMPTY(tiqh)) {
|
||||
tp = TAILQ_FIRST(tiqh);
|
||||
if (TAILQ_NEXT(tp, q) != NULL || tp->lb_len < len + 32) {
|
||||
if (TAILQ_NEXT(tp, q) != NULL ||
|
||||
tp->lb_len < (len + 32) * sizeof(CHAR_T)) {
|
||||
text_lfree(tiqh);
|
||||
goto newtp;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#ifndef lint
|
||||
static const char sccsid[] = "$Id: vs_refresh.c,v 10.52 2011/12/16 11:06:25 zy Exp $";
|
||||
static const char sccsid[] = "$Id: vs_refresh.c,v 10.53 2013/11/01 11:57:36 zy Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -331,7 +331,8 @@ small_fill: (void)gp->scr_move(sp, LASTLINE(sp), 0);
|
||||
if (vs_sm_1down(sp))
|
||||
return (1);
|
||||
goto adjust;
|
||||
}
|
||||
} else
|
||||
goto top; /* XXX No such line. */
|
||||
|
||||
/*
|
||||
* If less than a half screen from the bottom of the file,
|
||||
|
Loading…
x
Reference in New Issue
Block a user