jack@cadre.ARPA (Jack Nelson) (06/07/85)
*** REPLACE THIS LINE WITH YOUR MESSAGE *** /*top*/ I added two subroutines to vi 3.7 as supplied with 2.9bsd which are called from ex_vops2.c to set a standout mode flag 'I' in the lower left corner of the screen during inserts of text; it seems to make use of vi easier for the beginner, to distinuish the insert modes from command mode. Seeing the flag go on and off is reassuring. The subroutines are assemblages of other vi subroutine calls which do the job. My effort is hereby deeded to public domain, all AT&T Bell Laboratory and UCB rights not disputed. BUGS: not tested with ex.40 version. I added "jpnsubs.o" to the same overlay segment of ex.70 in which ex_vops2.o lives. They could probably just as well be tacked onto the end of ex_vops2.c. John Paul Nelson, M.D., U.of Pittsburgh, 3811 O'Hara St., Pittsburgh Pa 15213 412-624-1769. jack@cadre.UUCP This is not a shar file. "Patch" will not handle the subroutines as a separate file. *** ex_vops2.c.org Wed Feb 13 15:17:13 1985 --- ex_vops2.c Fri Feb 15 20:05:59 1985 *************** *** 113,118 int repcnt, savedoomed; short oldhold = hold; /* * Before a move in hardopen when the line is dirty * or we are in the middle of the printed representation, --- 113,119 ----- int repcnt, savedoomed; short oldhold = hold; + setIflag(); /* * Before a move in hardopen when the line is dirty * or we are in the middle of the printed representation, *************** *** 356,361 vscrap(); else vsync1(LINE(vcline)); } strcLIN(gcursor); *gcursor = 0; --- 357,363 ----- vscrap(); else vsync1(LINE(vcline)); + setIflag(); } strcLIN(gcursor); *gcursor = 0; *************** *** 362,367 cursor = linebuf; vgotoCL(qcolumn(cursor - 1, genbuf)); } /* * All done with insertion, position the cursor --- 364,370 ----- cursor = linebuf; vgotoCL(qcolumn(cursor - 1, genbuf)); } + clrIflag(); /* * All done with insertion, position the cursor /*********************/ /* jpnsubs.c follows: */ #include "ex.h" #include "ex_tty.h" #include "ex_vis.h" int clrIflag() { if (state == VISUAL) { int sdc = destcol, sdl = destline; splitw++; vigoto(WECHO, 0); vclreol(); vgoto(WECHO, 0); vputchar(' '); splitw = 0; vgoto(sdl, sdc); } } int setIflag() { if (state == VISUAL) { int sdc = destcol, sdl = destline; splitw++; vigoto(WECHO, 0); vclreol(); vgoto(WECHO, 0); if (SO && SE) putpad(SO); vputchar('I'); if (SO && SE) putpad(SE); splitw = 0; vgoto(sdl, sdc); } }