Ejemplo n.º 1
0
void
vnpins(int dosync)
{
	register int d = DEPTH(vcline);
	register int e;

	e = LINE(vcline) + DEPTH(vcline);
	if (e < LINE(vcline + 1)) {
		vigoto(e, 0);
		vclreol();
		return;
	}
	DEPTH(vcline)++;
	if (e < WECHO) {
		e = vglitchup(vcline, d);
		vigoto(e, 0); vclreol();
		if (dosync) {
			int (*Ooutchar)() = Outchar;
			Outchar = vputchar;
			vsync(e + 1);
			Outchar = Ooutchar;
		}
	} else {
		vup1();
		vigoto(WBOT, 0);
		vclreol();
	}
	vprepins();
}
Ejemplo n.º 2
0
/*
 * Note a change affecting a lot of lines, or non-visible
 * lines.  If the parameter must is set, then we only want
 * to do this for open modes now; return and save for later
 * notification in visual.
 */
int
noteit(bool must)
{
	register int sdl = destline, sdc = destcol;

	if (notecnt < 2 || (!must && state == VISUAL))
		return (0);
	splitw++;
	if (WBOT == WECHO)
		vmoveitup(1, 1);
	vigoto(WECHO, 0);
	ex_printf("%d %sline", notecnt, notesgn);
	if (notecnt > 1)
		ex_putchar('s');
	if (*notenam) {
		ex_printf(" %s", notenam);
		if (*(strend(notenam) - 1) != 'e')
			ex_putchar('e');
		ex_putchar('d');
	}
	vclreol();
	notecnt = 0;
	if (state != VISUAL)
		vcnt = vcline = 0;
	splitw = 0;
	if (state == ONEOPEN || state == CRTOPEN)
		vup1();
	destline = sdl; destcol = sdc;
	return (1);
}
Ejemplo n.º 3
0
/*
 * Clear a physical line
 */
void
vclrlin(int l, int *tp)
{

	vigoto(l, 0);
	if (!holdat)
		ex_putchar(tp > dol ? '~' : '@');
	vclreol();
}
Ejemplo n.º 4
0
/*
 * Read a line from the echo area, with single character prompt c.
 * A return value of 1 means the user blewit or blewit away.
 */
int
readecho(int c)
{
	register char *sc = cursor;
	void (*OP)();
	bool waste;
	register int OPeek;

	if (WBOT == WECHO)
		vclean();
	else
		vclrech(0);
	splitw++;
	vgoto(WECHO, 0);
	ex_putchar(c);
	vclreol();
	vgoto(WECHO, 1);
	cursor = linebuf; linebuf[0] = 0; genbuf[0] = c;
	if (peekbr()) {
		if (!INS[0] || (INS[0] & (OVERBUF|TRIM)) == OVERBUF)
			goto blewit;
		vglobp = INS;
	}
	OP = Pline; Pline = normline;
	ignore(vgetline(0, genbuf + 1, &waste, c));
	if (Outchar == termchar)
		ex_putchar('\n');
	vscrap();
	Pline = OP;
	if (Peekkey != ATTN && Peekkey != QUIT && Peekkey != CTRL('h')) {
		cursor = sc;
		vclreol();
		return (0);
	}
blewit:
	OPeek = Peekkey==CTRL('h') ? 0 : Peekkey; Peekkey = 0;
	splitw = 0;
	vclean();
	vshow(dot, NOLINE);
	vnline(sc);
	Peekkey = OPeek;
	return (1);
}
Ejemplo n.º 5
0
/*
 * Clear a physical display line, high level.
 */
void
vclrlin(int l, line *tp)
{

	vigoto(l, 0);
	if ((hold & HOLDAT) == 0)
		putchar(tp > dol ? ((UPPERCASE || tilde_glitch) ? '^' : '~') : '@');
	if (state == HARDOPEN)
		sethard();
	vclreol();
}
Ejemplo n.º 6
0
/*
 * Clear a physical display line, high level.
 */
void 
vclrlin(int l, line *tp)
{

	vigoto(l, 0);
	if ((hold & HOLDAT) == 0)
#ifndef	UCVISUAL
		putchar(tp > dol ? '~' : '@');
#else
		putchar(tp > dol ? ((UPPERCASE || xHZ) ? '^' : '~') : '@');
#endif
	if (state == HARDOPEN)
		sethard();
	vclreol();
}
Ejemplo n.º 7
0
/*
 * Clear the echo line.
 * If didphys then its been cleared physically (as
 * a side effect of a clear to end of display, e.g.)
 * so just do it logically.
 * If work here is being held off, just remember, in
 * heldech, if work needs to be done, don't do anything.
 */
void
vclrech(bool didphys)
{

	if (Peekkey == ATTN)
		return;
	if (hold & HOLDECH) {
		heldech = !didphys;
		return;
	}
	if (!didphys && (CD || CE)) {
		splitw++;
		/*
		 * If display is retained below, then MUST use CD or CE
		 * since we don't really know whats out there.
		 * Vigoto might decide (incorrectly) to do nothing.
		 */
		if (DB) {
			vgoto(WECHO, 0);
			vputp(CD ? CD : CE, 1);
		} else {
			if (XT) {
				/*
				 * This code basically handles the t1061
				 * where positioning at (0, 0) won't work
				 * because the terminal won't let you put
				 * the cursor on it's magic cookie.
				 *
				 * Should probably be XS above, or even a
				 * new X? glitch, but right now t1061 is the
				 * only terminal with XT.
				 */
				vgoto(WECHO, 0);
				vputp(DL, 1);
			} else {
				vigoto(WECHO, 0);
				vclreol();
			}
		}
		splitw = 0;
		didphys = 1;
	}
	if (didphys)
		vclrcell(vtube[WECHO], WCOLS);
	heldech = 0;
}
Ejemplo n.º 8
0
static void
ovend(ttymode f)
{

	splitw++;
	vgoto(WECHO, 0);
	vclreol();
	vgoto(WECHO, 0);
	holdcm = 0;
	splitw = 0;
	ostop(f);
	setoutt();
	undvis();
	COLUMNS = OCOLUMNS;
	inopen = 0;
	flusho();
	netchHAD(Vlines);
}
Ejemplo n.º 9
0
/*
 * Redisplay logical line l at physical line p with line number lineno.
 */
int 
vreopen(int p, int lineno, int l)
{
	register int d;
	register struct vlinfo *vp = &vlinfo[l];

	if (p < 0)
		error("Line too long to fit on screen");
	d = vp->vdepth;
	if (d == 0 || (vp->vflags & VDIRT))
		vp->vdepth = d = vdepth();
	vp->vliny = p, vp->vflags &= ~VDIRT;

	/*
	 * Try to win by making the screen larger rather than inserting
	 * a line and driving text off the bottom.
	 */
	p = vglitchup(l, 0);

	/*
	 * BUG:		Should consider using CE here to clear to end of line.
	 *		As it stands we always strike over the current text.
	 *		Since often the current text is the same as what
	 *		we are overstriking with, it tends not to show.
	 *		On the other hand if it is different and we end up
	 *		spacing out a lot of text, we could have won with
	 *		a CE.  This is probably worthwhile at low speed
	 *		only however, since clearly computation will be
	 *		necessary to determine which way to go.
	 */
	vigoto(p, 0);
	pline(lineno);

	/*
	 * When we are typing part of a line for hardcopy open, don't
	 * want to type the '$' marking an end of line if in list mode.
	 */
	if (hold & HOLDDOL)
		return (d);
	if (Putchar == listchar)
		putchar('$');

	/*
	 * Optimization of cursor motion may prevent screen rollup if the
	 * line has blanks/tabs at the end unless we force the cursor to appear
	 * on the last line segment.
	 */
	if (vp->vliny + d - 1 > WBOT)
		vcsync();

	/*
	 * Switch into hardcopy open mode if we are in one line (adm3)
	 * open mode and this line is now too long.  If in hardcopy
	 * open mode, then call sethard to move onto the next line
	 * with appropriate positioning.
	 */
	if (state == ONEOPEN) {
		WCOLS = OCOLUMNS;
		if (vdepth() > 1) {
			WCOLS = TUBECOLS;
			sethard();
		} else
			WCOLS = TUBECOLS;
	} else if (state == HARDOPEN)
		sethard();

	/*
	 * Unless we filled (completely) the last line we typed on,
	 * we have to clear to the end of the line
	 * in case stuff is left from before.
	 */
	if (vp->vliny + d > destline) {
		if (IN && destcol == WCOLS)
			vigoto(vp->vliny + d - 1, 0);
		vclreol();
	}
	return (d);
}