1 /* vars.c */ 2 3 /* Author: 4 * Steve Kirkendall 5 * 16820 SW Tallac Way 6 * Beaverton, OR 97006 7 * kirkenda@jove.cs.pdx.edu, or ...uunet!tektronix!psueea!jove!kirkenda 8 */ 9 10 11 /* This file contains variables which weren't happy anyplace else */ 12 13 #include "config.h" 14 #include "vi.h" 15 16 /*------------------------------------------------------------------------*/ 17 18 /* used to remember whether the file has been modified */ 19 struct _viflags viflags; 20 21 /* used to access the tmp file */ 22 long lnum[MAXBLKS]; 23 long nlines; 24 int tmpfd = -1; 25 26 /* used to keep track of the current file & alternate file */ 27 long origtime; 28 char origname[256]; 29 char prevorig[256]; 30 long prevline = 1; 31 32 /* used to track various places in the text */ 33 MARK mark[NMARKS]; /* marks 'a through 'z, plus mark '' */ 34 MARK cursor; /* the cursor position within the file */ 35 36 /* which mode of the editor we're in */ 37 int mode; /* vi mode? ex mode? quitting? */ 38 39 /* used to manage the args list */ 40 char args[BLKSIZE]; /* list of filenames to edit */ 41 int argno; /* index of current file in args list */ 42 int nargs; /* number of filenames in args[] */ 43 44 /* dummy var, never explicitly referenced */ 45 int bavar; /* used only in BeforeAfter macros */ 46 47 /* have we made a multi-line change? */ 48 int mustredraw; /* must we redraw the whole screen? */ 49 long redrawafter; /* line# of first line that must be redrawn */ 50 long preredraw; /* line# of last line changed, before change */ 51 long postredraw; /* line# of last line changed, after change */ 52 /* (postredraw - preredraw) = #lines added */ 53 54 /* used to detect changes that invalidate cached text/blocks */ 55 long changes; /* incremented when file is changed */ 56 57 /* used to support the pfetch() macro */ 58 int plen; /* length of the line */ 59 long pline; /* line number that len refers to */ 60 long pchgs; /* "changes" level that len refers to */ 61 char *ptext; /* text of previous line, if valid */ 62 63 /* misc temporary storage - mostly for strings */ 64 BLK tmpblk; /* a block used to accumulate changes */ 65 66 /* screen oriented stuff */ 67 long topline; /* file line number of top line */ 68 int leftcol; /* column number of left col */ 69 int physcol; /* physical column number that cursor is on */ 70 int physrow; /* physical row number that cursor is on */ 71 72 /* used to help minimize that "[Hit a key to continue]" message */ 73 int exwrote; /* Boolean: was the last ex command wordy? */ 74 75 /* This variable affects the behaviour of certain functions -- most importantly 76 * the input function. 77 */ 78 int doingdot; /* boolean: are we doing the "." command? */ 79 80 /* These are used for reporting multi-line changes to the user */ 81 long rptlines; /* number of lines affected by a command */ 82 char *rptlabel; /* description of how lines were affected */ 83 84 /* These store info that pertains to the shift-U command */ 85 long U_line; /* line# of the undoable line, or 0l for none */ 86 char U_text[BLKSIZE]; /* contents of the undoable line */ 87 88 /* Bigger stack req'ed for TOS */ 89 90 #if TOS 91 long _stksize = 16384; 92 #endif 93