home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1710 < prev    next >
SHell self-extracting ARchive  |  1990-12-28  |  72.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: SHell self-extracting ARchive (archive/shar).

You can browse this item here: 1710

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert SHell self-extracting ARchive (archive/shar) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news or mail text default
99% file C source text default
98% file C source, ASCII text default
100% TrID E-Mail message (Var. 2) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/329 Shell Archive Format default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/rfc822 default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 3a 20 6b 69 | 72 6b 65 6e 64 61 40 65 |From: ki|rkenda@e|
|00000010| 65 63 73 2e 63 73 2e 70 | 64 78 2e 65 64 75 20 28 |ecs.cs.p|dx.edu (|
|00000020| 53 74 65 76 65 20 4b 69 | 72 6b 65 6e 64 61 6c 6c |Steve Ki|rkendall|
|00000030| 29 0a 4e 65 77 73 67 72 | 6f 75 70 73 3a 20 61 6c |).Newsgr|oups: al|
|00000040| 74 2e 73 6f 75 72 63 65 | 73 0a 53 75 62 6a 65 63 |t.source|s.Subjec|
|00000050| 74 3a 20 65 6c 76 69 73 | 20 31 2e 33 20 2d 20 61 |t: elvis| 1.3 - a|
|00000060| 20 63 6c 6f 6e 65 20 6f | 66 20 76 69 2f 65 78 2c | clone o|f vi/ex,|
|00000070| 20 70 61 72 74 20 36 20 | 6f 66 20 36 0a 4d 65 73 | part 6 |of 6.Mes|
|00000080| 73 61 67 65 2d 49 44 3a | 20 3c 33 32 38 31 40 70 |sage-ID:| <3281@p|
|00000090| 73 75 65 65 61 2e 55 55 | 43 50 3e 0a 44 61 74 65 |sueea.UU|CP>.Date|
|000000a0| 3a 20 32 34 20 41 75 67 | 20 39 30 20 31 38 3a 30 |: 24 Aug| 90 18:0|
|000000b0| 30 3a 34 34 20 47 4d 54 | 0a 0a 41 72 63 68 69 76 |0:44 GMT|..Archiv|
|000000c0| 65 2d 6e 61 6d 65 3a 20 | 65 6c 76 69 73 31 2e 33 |e-name: |elvis1.3|
|000000d0| 2f 70 61 72 74 36 0a 23 | 21 20 2f 62 69 6e 2f 73 |/part6.#|! /bin/s|
|000000e0| 68 0a 23 20 54 68 69 73 | 20 69 73 20 61 20 73 68 |h.# This| is a sh|
|000000f0| 65 6c 6c 20 61 72 63 68 | 69 76 65 2c 20 6d 65 61 |ell arch|ive, mea|
|00000100| 6e 69 6e 67 3a 0a 23 20 | 31 2e 20 52 65 6d 6f 76 |ning:.# |1. Remov|
|00000110| 65 20 65 76 65 72 79 74 | 68 69 6e 67 20 61 62 6f |e everyt|hing abo|
|00000120| 76 65 20 74 68 65 20 23 | 21 20 2f 62 69 6e 2f 73 |ve the #|! /bin/s|
|00000130| 68 20 6c 69 6e 65 2e 0a | 23 20 32 2e 20 53 61 76 |h line..|# 2. Sav|
|00000140| 65 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 20 |e the re|sulting |
|00000150| 74 65 78 74 20 69 6e 20 | 61 20 66 69 6c 65 2e 0a |text in |a file..|
|00000160| 23 20 33 2e 20 45 78 65 | 63 75 74 65 20 74 68 65 |# 3. Exe|cute the|
|00000170| 20 66 69 6c 65 20 77 69 | 74 68 20 2f 62 69 6e 2f | file wi|th /bin/|
|00000180| 73 68 20 28 6e 6f 74 20 | 63 73 68 29 20 74 6f 20 |sh (not |csh) to |
|00000190| 63 72 65 61 74 65 3a 0a | 23 09 76 61 72 73 2e 63 |create:.|#.vars.c|
|000001a0| 0a 23 09 76 63 6d 64 2e | 63 0a 23 09 76 69 2e 63 |.#.vcmd.|c.#.vi.c|
|000001b0| 0a 23 09 76 69 2e 68 0a | 23 09 63 74 61 67 73 2e |.#.vi.h.|#.ctags.|
|000001c0| 63 0a 23 09 72 65 66 2e | 63 0a 23 09 76 69 72 65 |c.#.ref.|c.#.vire|
|000001d0| 63 2e 63 0a 23 09 77 69 | 6c 64 63 61 72 64 2e 63 |c.c.#.wi|ldcard.c|
|000001e0| 0a 23 09 73 68 65 6c 6c | 2e 63 0a 23 20 54 68 69 |.#.shell|.c.# Thi|
|000001f0| 73 20 61 72 63 68 69 76 | 65 20 63 72 65 61 74 65 |s archiv|e create|
|00000200| 64 3a 20 46 72 69 20 41 | 75 67 20 32 34 20 31 30 |d: Fri A|ug 24 10|
|00000210| 3a 33 30 3a 30 30 20 31 | 39 39 30 0a 65 78 70 6f |:30:00 1|990.expo|
|00000220| 72 74 20 50 41 54 48 3b | 20 50 41 54 48 3d 2f 62 |rt PATH;| PATH=/b|
|00000230| 69 6e 3a 2f 75 73 72 2f | 62 69 6e 3a 24 50 41 54 |in:/usr/|bin:$PAT|
|00000240| 48 0a 69 66 20 74 65 73 | 74 20 2d 66 20 27 76 61 |H.if tes|t -f 'va|
|00000250| 72 73 2e 63 27 0a 74 68 | 65 6e 0a 09 65 63 68 6f |rs.c'.th|en..echo|
|00000260| 20 73 68 61 72 3a 20 22 | 77 69 6c 6c 20 6e 6f 74 | shar: "|will not|
|00000270| 20 6f 76 65 72 2d 77 72 | 69 74 65 20 65 78 69 73 | over-wr|ite exis|
|00000280| 74 69 6e 67 20 66 69 6c | 65 20 27 76 61 72 73 2e |ting fil|e 'vars.|
|00000290| 63 27 22 0a 65 6c 73 65 | 0a 63 61 74 20 3c 3c 20 |c'".else|.cat << |
|000002a0| 5c 53 48 41 52 5f 45 4f | 46 20 3e 20 27 76 61 72 |\SHAR_EO|F > 'var|
|000002b0| 73 2e 63 27 0a 2f 2a 20 | 76 61 72 73 2e 63 20 2a |s.c'./* |vars.c *|
|000002c0| 2f 0a 0a 2f 2a 20 41 75 | 74 68 6f 72 3a 0a 20 2a |/../* Au|thor:. *|
|000002d0| 09 53 74 65 76 65 20 4b | 69 72 6b 65 6e 64 61 6c |.Steve K|irkendal|
|000002e0| 6c 0a 20 2a 09 31 36 38 | 32 30 20 53 57 20 54 61 |l. *.168|20 SW Ta|
|000002f0| 6c 6c 61 63 20 57 61 79 | 0a 20 2a 09 42 65 61 76 |llac Way|. *.Beav|
|00000300| 65 72 74 6f 6e 2c 20 4f | 52 20 39 37 30 30 36 0a |erton, O|R 97006.|
|00000310| 20 2a 09 6b 69 72 6b 65 | 6e 64 61 40 6a 6f 76 65 | *.kirke|nda@jove|
|00000320| 2e 63 73 2e 70 64 78 2e | 65 64 75 2c 20 6f 72 20 |.cs.pdx.|edu, or |
|00000330| 2e 2e 2e 75 75 6e 65 74 | 21 74 65 6b 74 72 6f 6e |...uunet|!tektron|
|00000340| 69 78 21 70 73 75 65 65 | 61 21 6a 6f 76 65 21 6b |ix!psuee|a!jove!k|
|00000350| 69 72 6b 65 6e 64 61 0a | 20 2a 2f 0a 0a 0a 2f 2a |irkenda.| */.../*|
|00000360| 20 54 68 69 73 20 66 69 | 6c 65 20 63 6f 6e 74 61 | This fi|le conta|
|00000370| 69 6e 73 20 76 61 72 69 | 61 62 6c 65 73 20 77 68 |ins vari|ables wh|
|00000380| 69 63 68 20 77 65 72 65 | 6e 27 74 20 68 61 70 70 |ich were|n't happ|
|00000390| 79 20 61 6e 79 70 6c 61 | 63 65 20 65 6c 73 65 20 |y anypla|ce else |
|000003a0| 2a 2f 0a 0a 23 69 6e 63 | 6c 75 64 65 20 22 63 6f |*/..#inc|lude "co|
|000003b0| 6e 66 69 67 2e 68 22 0a | 23 69 6e 63 6c 75 64 65 |nfig.h".|#include|
|000003c0| 20 22 76 69 2e 68 22 0a | 0a 2f 2a 2d 2d 2d 2d 2d | "vi.h".|./*-----|
|000003d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000003e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000003f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000400| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000410| 2d 2d 2d 2a 2f 0a 0a 2f | 2a 20 75 73 65 64 20 74 |---*/../|* used t|
|00000420| 6f 20 72 65 6d 65 6d 62 | 65 72 20 77 68 65 74 68 |o rememb|er wheth|
|00000430| 65 72 20 74 68 65 20 66 | 69 6c 65 20 68 61 73 20 |er the f|ile has |
|00000440| 62 65 65 6e 20 6d 6f 64 | 69 66 69 65 64 20 2a 2f |been mod|ified */|
|00000450| 0a 73 74 72 75 63 74 20 | 5f 76 69 66 6c 61 67 73 |.struct |_viflags|
|00000460| 09 76 69 66 6c 61 67 73 | 3b 0a 0a 2f 2a 20 75 73 |.viflags|;../* us|
|00000470| 65 64 20 74 6f 20 61 63 | 63 65 73 73 20 74 68 65 |ed to ac|cess the|
|00000480| 20 74 6d 70 20 66 69 6c | 65 20 2a 2f 0a 6c 6f 6e | tmp fil|e */.lon|
|00000490| 67 09 09 6c 6e 75 6d 5b | 4d 41 58 42 4c 4b 53 5d |g..lnum[|MAXBLKS]|
|000004a0| 3b 0a 6c 6f 6e 67 09 09 | 6e 6c 69 6e 65 73 3b 0a |;.long..|nlines;.|
|000004b0| 69 6e 74 09 09 74 6d 70 | 66 64 20 3d 20 2d 31 3b |int..tmp|fd = -1;|
|000004c0| 0a 0a 2f 2a 20 75 73 65 | 64 20 74 6f 20 6b 65 65 |../* use|d to kee|
|000004d0| 70 20 74 72 61 63 6b 20 | 6f 66 20 74 68 65 20 63 |p track |of the c|
|000004e0| 75 72 72 65 6e 74 20 66 | 69 6c 65 20 26 20 61 6c |urrent f|ile & al|
|000004f0| 74 65 72 6e 61 74 65 20 | 66 69 6c 65 20 2a 2f 0a |ternate |file */.|
|00000500| 6c 6f 6e 67 09 09 6f 72 | 69 67 74 69 6d 65 3b 0a |long..or|igtime;.|
|00000510| 63 68 61 72 09 09 6f 72 | 69 67 6e 61 6d 65 5b 32 |char..or|igname[2|
|00000520| 35 36 5d 3b 0a 63 68 61 | 72 09 09 70 72 65 76 6f |56];.cha|r..prevo|
|00000530| 72 69 67 5b 32 35 36 5d | 3b 0a 6c 6f 6e 67 09 09 |rig[256]|;.long..|
|00000540| 70 72 65 76 6c 69 6e 65 | 20 3d 20 31 3b 0a 0a 2f |prevline| = 1;../|
|00000550| 2a 20 75 73 65 64 20 74 | 6f 20 74 72 61 63 6b 20 |* used t|o track |
|00000560| 76 61 72 69 6f 75 73 20 | 70 6c 61 63 65 73 20 69 |various |places i|
|00000570| 6e 20 74 68 65 20 74 65 | 78 74 20 2a 2f 0a 4d 41 |n the te|xt */.MA|
|00000580| 52 4b 09 09 6d 61 72 6b | 5b 4e 4d 41 52 4b 53 5d |RK..mark|[NMARKS]|
|00000590| 3b 09 2f 2a 20 6d 61 72 | 6b 73 20 27 61 20 74 68 |;./* mar|ks 'a th|
|000005a0| 72 6f 75 67 68 20 27 7a | 2c 20 70 6c 75 73 20 6d |rough 'z|, plus m|
|000005b0| 61 72 6b 20 27 27 20 2a | 2f 0a 4d 41 52 4b 09 09 |ark '' *|/.MARK..|
|000005c0| 63 75 72 73 6f 72 3b 09 | 09 2f 2a 20 74 68 65 20 |cursor;.|./* the |
|000005d0| 63 75 72 73 6f 72 20 70 | 6f 73 69 74 69 6f 6e 20 |cursor p|osition |
|000005e0| 77 69 74 68 69 6e 20 74 | 68 65 20 66 69 6c 65 20 |within t|he file |
|000005f0| 2a 2f 0a 0a 2f 2a 20 77 | 68 69 63 68 20 6d 6f 64 |*/../* w|hich mod|
|00000600| 65 20 6f 66 20 74 68 65 | 20 65 64 69 74 6f 72 20 |e of the| editor |
|00000610| 77 65 27 72 65 20 69 6e | 20 2a 2f 0a 69 6e 74 09 |we're in| */.int.|
|00000620| 09 6d 6f 64 65 3b 09 09 | 2f 2a 20 76 69 20 6d 6f |.mode;..|/* vi mo|
|00000630| 64 65 3f 20 65 78 20 6d | 6f 64 65 3f 20 71 75 69 |de? ex m|ode? qui|
|00000640| 74 74 69 6e 67 3f 20 2a | 2f 0a 0a 2f 2a 20 75 73 |tting? *|/../* us|
|00000650| 65 64 20 74 6f 20 6d 61 | 6e 61 67 65 20 74 68 65 |ed to ma|nage the|
|00000660| 20 61 72 67 73 20 6c 69 | 73 74 20 2a 2f 0a 63 68 | args li|st */.ch|
|00000670| 61 72 09 09 61 72 67 73 | 5b 42 4c 4b 53 49 5a 45 |ar..args|[BLKSIZE|
|00000680| 5d 3b 09 2f 2a 20 6c 69 | 73 74 20 6f 66 20 66 69 |];./* li|st of fi|
|00000690| 6c 65 6e 61 6d 65 73 20 | 74 6f 20 65 64 69 74 20 |lenames |to edit |
|000006a0| 2a 2f 0a 69 6e 74 09 09 | 61 72 67 6e 6f 3b 09 09 |*/.int..|argno;..|
|000006b0| 2f 2a 20 69 6e 64 65 78 | 20 6f 66 20 63 75 72 72 |/* index| of curr|
|000006c0| 65 6e 74 20 66 69 6c 65 | 20 69 6e 20 61 72 67 73 |ent file| in args|
|000006d0| 20 6c 69 73 74 20 2a 2f | 0a 69 6e 74 09 09 6e 61 | list */|.int..na|
|000006e0| 72 67 73 3b 09 09 2f 2a | 20 6e 75 6d 62 65 72 20 |rgs;../*| number |
|000006f0| 6f 66 20 66 69 6c 65 6e | 61 6d 65 73 20 69 6e 20 |of filen|ames in |
|00000700| 61 72 67 73 5b 5d 20 2a | 2f 0a 0a 2f 2a 20 64 75 |args[] *|/../* du|
|00000710| 6d 6d 79 20 76 61 72 2c | 20 6e 65 76 65 72 20 65 |mmy var,| never e|
|00000720| 78 70 6c 69 63 69 74 6c | 79 20 72 65 66 65 72 65 |xplicitl|y refere|
|00000730| 6e 63 65 64 20 2a 2f 0a | 69 6e 74 09 09 62 61 76 |nced */.|int..bav|
|00000740| 61 72 3b 09 09 2f 2a 20 | 75 73 65 64 20 6f 6e 6c |ar;../* |used onl|
|00000750| 79 20 69 6e 20 42 65 66 | 6f 72 65 41 66 74 65 72 |y in Bef|oreAfter|
|00000760| 20 6d 61 63 72 6f 73 20 | 2a 2f 0a 0a 2f 2a 20 68 | macros |*/../* h|
|00000770| 61 76 65 20 77 65 20 6d | 61 64 65 20 61 20 6d 75 |ave we m|ade a mu|
|00000780| 6c 74 69 2d 6c 69 6e 65 | 20 63 68 61 6e 67 65 3f |lti-line| change?|
|00000790| 20 2a 2f 0a 69 6e 74 09 | 09 6d 75 73 74 72 65 64 | */.int.|.mustred|
|000007a0| 72 61 77 3b 09 2f 2a 20 | 6d 75 73 74 20 77 65 20 |raw;./* |must we |
|000007b0| 72 65 64 72 61 77 20 74 | 68 65 20 77 68 6f 6c 65 |redraw t|he whole|
|000007c0| 20 73 63 72 65 65 6e 3f | 20 2a 2f 0a 6c 6f 6e 67 | screen?| */.long|
|000007d0| 09 09 72 65 64 72 61 77 | 61 66 74 65 72 3b 09 2f |..redraw|after;./|
|000007e0| 2a 20 6c 69 6e 65 23 20 | 6f 66 20 66 69 72 73 74 |* line# |of first|
|000007f0| 20 6c 69 6e 65 20 74 68 | 61 74 20 6d 75 73 74 20 | line th|at must |
|00000800| 62 65 20 72 65 64 72 61 | 77 6e 20 2a 2f 0a 6c 6f |be redra|wn */.lo|
|00000810| 6e 67 09 09 70 72 65 72 | 65 64 72 61 77 3b 09 2f |ng..prer|edraw;./|
|00000820| 2a 20 6c 69 6e 65 23 20 | 6f 66 20 6c 61 73 74 20 |* line# |of last |
|00000830| 6c 69 6e 65 20 63 68 61 | 6e 67 65 64 2c 20 62 65 |line cha|nged, be|
|00000840| 66 6f 72 65 20 63 68 61 | 6e 67 65 20 2a 2f 0a 6c |fore cha|nge */.l|
|00000850| 6f 6e 67 09 09 70 6f 73 | 74 72 65 64 72 61 77 3b |ong..pos|tredraw;|
|00000860| 09 2f 2a 20 6c 69 6e 65 | 23 20 6f 66 20 6c 61 73 |./* line|# of las|
|00000870| 74 20 6c 69 6e 65 20 63 | 68 61 6e 67 65 64 2c 20 |t line c|hanged, |
|00000880| 61 66 74 65 72 20 63 68 | 61 6e 67 65 20 2a 2f 0a |after ch|ange */.|
|00000890| 09 09 09 09 2f 2a 20 28 | 70 6f 73 74 72 65 64 72 |..../* (|postredr|
|000008a0| 61 77 20 2d 20 70 72 65 | 72 65 64 72 61 77 29 20 |aw - pre|redraw) |
|000008b0| 3d 20 23 6c 69 6e 65 73 | 20 61 64 64 65 64 20 2a |= #lines| added *|
|000008c0| 2f 0a 0a 2f 2a 20 75 73 | 65 64 20 74 6f 20 64 65 |/../* us|ed to de|
|000008d0| 74 65 63 74 20 63 68 61 | 6e 67 65 73 20 74 68 61 |tect cha|nges tha|
|000008e0| 74 20 69 6e 76 61 6c 69 | 64 61 74 65 20 63 61 63 |t invali|date cac|
|000008f0| 68 65 64 20 74 65 78 74 | 2f 62 6c 6f 63 6b 73 20 |hed text|/blocks |
|00000900| 2a 2f 0a 6c 6f 6e 67 09 | 09 63 68 61 6e 67 65 73 |*/.long.|.changes|
|00000910| 3b 09 2f 2a 20 69 6e 63 | 72 65 6d 65 6e 74 65 64 |;./* inc|remented|
|00000920| 20 77 68 65 6e 20 66 69 | 6c 65 20 69 73 20 63 68 | when fi|le is ch|
|00000930| 61 6e 67 65 64 20 2a 2f | 0a 0a 2f 2a 20 75 73 65 |anged */|../* use|
|00000940| 64 20 74 6f 20 73 75 70 | 70 6f 72 74 20 74 68 65 |d to sup|port the|
|00000950| 20 70 66 65 74 63 68 28 | 29 20 6d 61 63 72 6f 20 | pfetch(|) macro |
|00000960| 2a 2f 0a 69 6e 74 09 09 | 70 6c 65 6e 3b 09 09 2f |*/.int..|plen;../|
|00000970| 2a 20 6c 65 6e 67 74 68 | 20 6f 66 20 74 68 65 20 |* length| of the |
|00000980| 6c 69 6e 65 20 2a 2f 0a | 6c 6f 6e 67 09 09 70 6c |line */.|long..pl|
|00000990| 69 6e 65 3b 09 09 2f 2a | 20 6c 69 6e 65 20 6e 75 |ine;../*| line nu|
|000009a0| 6d 62 65 72 20 74 68 61 | 74 20 6c 65 6e 20 72 65 |mber tha|t len re|
|000009b0| 66 65 72 73 20 74 6f 20 | 2a 2f 0a 6c 6f 6e 67 09 |fers to |*/.long.|
|000009c0| 09 70 63 68 67 73 3b 09 | 09 2f 2a 20 22 63 68 61 |.pchgs;.|./* "cha|
|000009d0| 6e 67 65 73 22 20 6c 65 | 76 65 6c 20 74 68 61 74 |nges" le|vel that|
|000009e0| 20 6c 65 6e 20 72 65 66 | 65 72 73 20 74 6f 20 2a | len ref|ers to *|
|000009f0| 2f 0a 63 68 61 72 09 09 | 2a 70 74 65 78 74 3b 09 |/.char..|*ptext;.|
|00000a00| 09 2f 2a 20 74 65 78 74 | 20 6f 66 20 70 72 65 76 |./* text| of prev|
|00000a10| 69 6f 75 73 20 6c 69 6e | 65 2c 20 69 66 20 76 61 |ious lin|e, if va|
|00000a20| 6c 69 64 20 2a 2f 0a 0a | 2f 2a 20 6d 69 73 63 20 |lid */..|/* misc |
|00000a30| 74 65 6d 70 6f 72 61 72 | 79 20 73 74 6f 72 61 67 |temporar|y storag|
|00000a40| 65 20 2d 20 6d 6f 73 74 | 6c 79 20 66 6f 72 20 73 |e - most|ly for s|
|00000a50| 74 72 69 6e 67 73 20 2a | 2f 0a 42 4c 4b 09 09 74 |trings *|/.BLK..t|
|00000a60| 6d 70 62 6c 6b 3b 09 09 | 2f 2a 20 61 20 62 6c 6f |mpblk;..|/* a blo|
|00000a70| 63 6b 20 75 73 65 64 20 | 74 6f 20 61 63 63 75 6d |ck used |to accum|
|00000a80| 75 6c 61 74 65 20 63 68 | 61 6e 67 65 73 20 2a 2f |ulate ch|anges */|
|00000a90| 0a 0a 2f 2a 20 73 63 72 | 65 65 6e 20 6f 72 69 65 |../* scr|een orie|
|00000aa0| 6e 74 65 64 20 73 74 75 | 66 66 20 2a 2f 0a 6c 6f |nted stu|ff */.lo|
|00000ab0| 6e 67 09 09 74 6f 70 6c | 69 6e 65 3b 09 2f 2a 20 |ng..topl|ine;./* |
|00000ac0| 66 69 6c 65 20 6c 69 6e | 65 20 6e 75 6d 62 65 72 |file lin|e number|
|00000ad0| 20 6f 66 20 74 6f 70 20 | 6c 69 6e 65 20 2a 2f 0a | of top |line */.|
|00000ae0| 69 6e 74 09 09 6c 65 66 | 74 63 6f 6c 3b 09 2f 2a |int..lef|tcol;./*|
|00000af0| 20 63 6f 6c 75 6d 6e 20 | 6e 75 6d 62 65 72 20 6f | column |number o|
|00000b00| 66 20 6c 65 66 74 20 63 | 6f 6c 20 2a 2f 0a 69 6e |f left c|ol */.in|
|00000b10| 74 09 09 70 68 79 73 63 | 6f 6c 3b 09 2f 2a 20 70 |t..physc|ol;./* p|
|00000b20| 68 79 73 69 63 61 6c 20 | 63 6f 6c 75 6d 6e 20 6e |hysical |column n|
|00000b30| 75 6d 62 65 72 20 74 68 | 61 74 20 63 75 72 73 6f |umber th|at curso|
|00000b40| 72 20 69 73 20 6f 6e 20 | 2a 2f 0a 69 6e 74 09 09 |r is on |*/.int..|
|00000b50| 70 68 79 73 72 6f 77 3b | 09 2f 2a 20 70 68 79 73 |physrow;|./* phys|
|00000b60| 69 63 61 6c 20 72 6f 77 | 20 6e 75 6d 62 65 72 20 |ical row| number |
|00000b70| 74 68 61 74 20 63 75 72 | 73 6f 72 20 69 73 20 6f |that cur|sor is o|
|00000b80| 6e 20 2a 2f 0a 0a 2f 2a | 20 75 73 65 64 20 74 6f |n */../*| used to|
|00000b90| 20 68 65 6c 70 20 6d 69 | 6e 69 6d 69 7a 65 20 74 | help mi|nimize t|
|00000ba0| 68 61 74 20 22 5b 48 69 | 74 20 61 20 6b 65 79 20 |hat "[Hi|t a key |
|00000bb0| 74 6f 20 63 6f 6e 74 69 | 6e 75 65 5d 22 20 6d 65 |to conti|nue]" me|
|00000bc0| 73 73 61 67 65 20 2a 2f | 0a 69 6e 74 09 09 65 78 |ssage */|.int..ex|
|00000bd0| 77 72 6f 74 65 3b 09 2f | 2a 20 42 6f 6f 6c 65 61 |wrote;./|* Boolea|
|00000be0| 6e 3a 20 77 61 73 20 74 | 68 65 20 6c 61 73 74 20 |n: was t|he last |
|00000bf0| 65 78 20 63 6f 6d 6d 61 | 6e 64 20 77 6f 72 64 79 |ex comma|nd wordy|
|00000c00| 3f 20 2a 2f 0a 0a 2f 2a | 20 54 68 69 73 20 76 61 |? */../*| This va|
|00000c10| 72 69 61 62 6c 65 20 61 | 66 66 65 63 74 73 20 74 |riable a|ffects t|
|00000c20| 68 65 20 62 65 68 61 76 | 69 6f 75 72 20 6f 66 20 |he behav|iour of |
|00000c30| 63 65 72 74 61 69 6e 20 | 66 75 6e 63 74 69 6f 6e |certain |function|
|00000c40| 73 20 2d 2d 20 6d 6f 73 | 74 20 69 6d 70 6f 72 74 |s -- mos|t import|
|00000c50| 61 6e 74 6c 79 0a 20 2a | 20 74 68 65 20 69 6e 70 |antly. *| the inp|
|00000c60| 75 74 20 66 75 6e 63 74 | 69 6f 6e 2e 0a 20 2a 2f |ut funct|ion.. */|
|00000c70| 0a 69 6e 74 09 09 64 6f | 69 6e 67 64 6f 74 3b 09 |.int..do|ingdot;.|
|00000c80| 2f 2a 20 62 6f 6f 6c 65 | 61 6e 3a 20 61 72 65 20 |/* boole|an: are |
|00000c90| 77 65 20 64 6f 69 6e 67 | 20 74 68 65 20 22 2e 22 |we doing| the "."|
|00000ca0| 20 63 6f 6d 6d 61 6e 64 | 3f 20 2a 2f 0a 0a 2f 2a | command|? */../*|
|00000cb0| 20 54 68 65 73 65 20 61 | 72 65 20 75 73 65 64 20 | These a|re used |
|00000cc0| 66 6f 72 20 72 65 70 6f | 72 74 69 6e 67 20 6d 75 |for repo|rting mu|
|00000cd0| 6c 74 69 2d 6c 69 6e 65 | 20 63 68 61 6e 67 65 73 |lti-line| changes|
|00000ce0| 20 74 6f 20 74 68 65 20 | 75 73 65 72 20 2a 2f 0a | to the |user */.|
|00000cf0| 6c 6f 6e 67 09 09 72 70 | 74 6c 69 6e 65 73 3b 09 |long..rp|tlines;.|
|00000d00| 2f 2a 20 6e 75 6d 62 65 | 72 20 6f 66 20 6c 69 6e |/* numbe|r of lin|
|00000d10| 65 73 20 61 66 66 65 63 | 74 65 64 20 62 79 20 61 |es affec|ted by a|
|00000d20| 20 63 6f 6d 6d 61 6e 64 | 20 2a 2f 0a 63 68 61 72 | command| */.char|
|00000d30| 09 09 2a 72 70 74 6c 61 | 62 65 6c 3b 09 2f 2a 20 |..*rptla|bel;./* |
|00000d40| 64 65 73 63 72 69 70 74 | 69 6f 6e 20 6f 66 20 68 |descript|ion of h|
|00000d50| 6f 77 20 6c 69 6e 65 73 | 20 77 65 72 65 20 61 66 |ow lines| were af|
|00000d60| 66 65 63 74 65 64 20 2a | 2f 0a 0a 2f 2a 20 54 68 |fected *|/../* Th|
|00000d70| 65 73 65 20 73 74 6f 72 | 65 20 69 6e 66 6f 20 74 |ese stor|e info t|
|00000d80| 68 61 74 20 70 65 72 74 | 61 69 6e 73 20 74 6f 20 |hat pert|ains to |
|00000d90| 74 68 65 20 73 68 69 66 | 74 2d 55 20 63 6f 6d 6d |the shif|t-U comm|
|00000da0| 61 6e 64 20 2a 2f 0a 6c | 6f 6e 67 09 55 5f 6c 69 |and */.l|ong.U_li|
|00000db0| 6e 65 3b 09 09 09 2f 2a | 20 6c 69 6e 65 23 20 6f |ne;.../*| line# o|
|00000dc0| 66 20 74 68 65 20 75 6e | 64 6f 61 62 6c 65 20 6c |f the un|doable l|
|00000dd0| 69 6e 65 2c 20 6f 72 20 | 30 6c 20 66 6f 72 20 6e |ine, or |0l for n|
|00000de0| 6f 6e 65 20 2a 2f 0a 63 | 68 61 72 09 55 5f 74 65 |one */.c|har.U_te|
|00000df0| 78 74 5b 42 4c 4b 53 49 | 5a 45 5d 3b 09 2f 2a 20 |xt[BLKSI|ZE];./* |
|00000e00| 63 6f 6e 74 65 6e 74 73 | 20 6f 66 20 74 68 65 20 |contents| of the |
|00000e10| 75 6e 64 6f 61 62 6c 65 | 20 6c 69 6e 65 20 2a 2f |undoable| line */|
|00000e20| 0a 0a 2f 2a 20 42 69 67 | 67 65 72 20 73 74 61 63 |../* Big|ger stac|
|00000e30| 6b 20 72 65 71 27 65 64 | 20 66 6f 72 20 54 4f 53 |k req'ed| for TOS|
|00000e40| 20 2a 2f 0a 0a 23 69 66 | 09 54 4f 53 0a 6c 6f 6e | */..#if|.TOS.lon|
|00000e50| 67 09 5f 73 74 6b 73 69 | 7a 65 20 3d 20 31 36 33 |g._stksi|ze = 163|
|00000e60| 38 34 3b 0a 23 65 6e 64 | 69 66 0a 53 48 41 52 5f |84;.#end|if.SHAR_|
|00000e70| 45 4f 46 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |EOF.fi.i|f test -|
|00000e80| 66 20 27 76 63 6d 64 2e | 63 27 0a 74 68 65 6e 0a |f 'vcmd.|c'.then.|
|00000e90| 09 65 63 68 6f 20 73 68 | 61 72 3a 20 22 77 69 6c |.echo sh|ar: "wil|
|00000ea0| 6c 20 6e 6f 74 20 6f 76 | 65 72 2d 77 72 69 74 65 |l not ov|er-write|
|00000eb0| 20 65 78 69 73 74 69 6e | 67 20 66 69 6c 65 20 27 | existin|g file '|
|00000ec0| 76 63 6d 64 2e 63 27 22 | 0a 65 6c 73 65 0a 63 61 |vcmd.c'"|.else.ca|
|00000ed0| 74 20 3c 3c 20 5c 53 48 | 41 52 5f 45 4f 46 20 3e |t << \SH|AR_EOF >|
|00000ee0| 20 27 76 63 6d 64 2e 63 | 27 0a 2f 2a 20 76 63 6d | 'vcmd.c|'./* vcm|
|00000ef0| 64 2e 63 20 2a 2f 0a 0a | 2f 2a 20 41 75 74 68 6f |d.c */..|/* Autho|
|00000f00| 72 3a 0a 20 2a 09 53 74 | 65 76 65 20 4b 69 72 6b |r:. *.St|eve Kirk|
|00000f10| 65 6e 64 61 6c 6c 0a 20 | 2a 09 31 36 38 32 30 20 |endall. |*.16820 |
|00000f20| 53 57 20 54 61 6c 6c 61 | 63 20 57 61 79 0a 20 2a |SW Talla|c Way. *|
|00000f30| 09 42 65 61 76 65 72 74 | 6f 6e 2c 20 4f 52 20 39 |.Beavert|on, OR 9|
|00000f40| 37 30 30 36 0a 20 2a 09 | 6b 69 72 6b 65 6e 64 61 |7006. *.|kirkenda|
|00000f50| 40 6a 6f 76 65 2e 63 73 | 2e 70 64 78 2e 65 64 75 |@jove.cs|.pdx.edu|
|00000f60| 2c 20 6f 72 20 2e 2e 2e | 75 75 6e 65 74 21 74 65 |, or ...|uunet!te|
|00000f70| 6b 74 72 6f 6e 69 78 21 | 70 73 75 65 65 61 21 6a |ktronix!|psueea!j|
|00000f80| 6f 76 65 21 6b 69 72 6b | 65 6e 64 61 0a 20 2a 2f |ove!kirk|enda. */|
|00000f90| 0a 0a 0a 2f 2a 20 54 68 | 69 73 20 66 69 6c 65 20 |.../* Th|is file |
|00000fa0| 63 6f 6e 74 61 69 6e 73 | 20 74 68 65 20 66 75 6e |contains| the fun|
|00000fb0| 63 74 69 6f 6e 73 20 74 | 68 61 74 20 68 61 6e 64 |ctions t|hat hand|
|00000fc0| 6c 65 20 56 49 20 63 6f | 6d 6d 61 6e 64 73 20 2a |le VI co|mmands *|
|00000fd0| 2f 0a 0a 0a 23 69 6e 63 | 6c 75 64 65 20 22 63 6f |/...#inc|lude "co|
|00000fe0| 6e 66 69 67 2e 68 22 0a | 23 69 6e 63 6c 75 64 65 |nfig.h".|#include|
|00000ff0| 20 22 76 69 2e 68 22 0a | 23 69 66 09 4d 53 44 4f | "vi.h".|#if.MSDO|
|00001000| 53 0a 23 69 6e 63 6c 75 | 64 65 20 3c 70 72 6f 63 |S.#inclu|de <proc|
|00001010| 65 73 73 2e 68 3e 0a 23 | 69 6e 63 6c 75 64 65 20 |ess.h>.#|include |
|00001020| 3c 73 74 72 69 6e 67 2e | 68 3e 0a 23 65 6e 64 69 |<string.|h>.#endi|
|00001030| 66 0a 23 69 66 09 54 4f | 53 0a 23 69 6e 63 6c 75 |f.#if.TO|S.#inclu|
|00001040| 64 65 20 3c 6f 73 62 69 | 6e 64 2e 68 3e 0a 23 69 |de <osbi|nd.h>.#i|
|00001050| 6e 63 6c 75 64 65 20 3c | 73 74 72 69 6e 67 2e 68 |nclude <|string.h|
|00001060| 3e 0a 23 65 6e 64 69 66 | 0a 0a 0a 2f 2a 20 54 68 |>.#endif|.../* Th|
|00001070| 69 73 20 66 75 6e 63 74 | 69 6f 6e 20 70 75 74 73 |is funct|ion puts|
|00001080| 20 74 68 65 20 65 64 69 | 74 6f 72 20 69 6e 20 45 | the edi|tor in E|
|00001090| 58 20 6d 6f 64 65 20 2a | 2f 0a 4d 41 52 4b 20 76 |X mode *|/.MARK v|
|000010a0| 5f 71 75 69 74 28 29 0a | 7b 0a 09 6d 6f 64 65 20 |_quit().|{..mode |
|000010b0| 3d 20 4d 4f 44 45 5f 45 | 58 3b 0a 09 72 65 74 75 |= MODE_E|X;..retu|
|000010c0| 72 6e 20 63 75 72 73 6f | 72 3b 0a 7d 0a 0a 2f 2a |rn curso|r;.}../*|
|000010d0| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 63 | This fu|nction c|
|000010e0| 61 75 73 65 73 20 74 68 | 65 20 73 63 72 65 65 6e |auses th|e screen|
|000010f0| 20 74 6f 20 62 65 20 72 | 65 64 72 61 77 6e 20 2a | to be r|edrawn *|
|00001100| 2f 0a 4d 41 52 4b 20 76 | 5f 72 65 64 72 61 77 28 |/.MARK v|_redraw(|
|00001110| 29 0a 7b 0a 09 72 65 64 | 72 61 77 28 4d 41 52 4b |).{..red|raw(MARK|
|00001120| 5f 55 4e 53 45 54 2c 20 | 46 41 4c 53 45 29 3b 0a |_UNSET, |FALSE);.|
|00001130| 09 72 65 74 75 72 6e 20 | 63 75 72 73 6f 72 3b 0a |.return |cursor;.|
|00001140| 7d 0a 0a 2f 2a 20 54 68 | 69 73 20 66 75 6e 63 74 |}../* Th|is funct|
|00001150| 69 6f 6e 20 65 78 65 63 | 75 74 65 73 20 61 20 73 |ion exec|utes a s|
|00001160| 69 6e 67 6c 65 20 45 58 | 20 63 6f 6d 6d 61 6e 64 |ingle EX| command|
|00001170| 2c 20 61 6e 64 20 77 61 | 69 74 73 20 66 6f 72 20 |, and wa|its for |
|00001180| 61 20 75 73 65 72 20 6b | 65 79 73 74 72 6f 6b 65 |a user k|eystroke|
|00001190| 0a 20 2a 20 62 65 66 6f | 72 65 20 72 65 74 75 72 |. * befo|re retur|
|000011a0| 6e 69 6e 67 20 74 6f 20 | 74 68 65 20 56 49 20 73 |ning to |the VI s|
|000011b0| 63 72 65 65 6e 2e 20 20 | 49 66 20 74 68 61 74 20 |creen. |If that |
|000011c0| 6b 65 79 73 74 72 6f 6b | 65 20 69 73 20 61 6e 6f |keystrok|e is ano|
|000011d0| 74 68 65 72 20 27 3a 27 | 2c 20 74 68 65 6e 0a 20 |ther ':'|, then. |
|000011e0| 2a 20 61 6e 6f 74 68 65 | 72 20 45 58 20 63 6f 6d |* anothe|r EX com|
|000011f0| 6d 61 6e 64 20 69 73 20 | 72 65 61 64 20 61 6e 64 |mand is |read and|
|00001200| 20 65 78 65 63 75 74 65 | 64 2e 0a 20 2a 2f 0a 2f | execute|d.. */./|
|00001210| 2a 41 52 47 53 55 53 45 | 44 2a 2f 0a 4d 41 52 4b |*ARGSUSE|D*/.MARK|
|00001220| 20 76 5f 31 65 78 28 6d | 2c 20 74 65 78 74 29 0a | v_1ex(m|, text).|
|00001230| 09 4d 41 52 4b 09 6d 3b | 09 2f 2a 20 74 68 65 20 |.MARK.m;|./* the |
|00001240| 63 75 72 72 65 6e 74 20 | 6c 69 6e 65 20 2a 2f 0a |current |line */.|
|00001250| 09 63 68 61 72 09 2a 74 | 65 78 74 3b 09 2f 2a 20 |.char.*t|ext;./* |
|00001260| 74 68 65 20 66 69 72 73 | 74 20 63 6f 6d 6d 61 6e |the firs|t comman|
|00001270| 64 20 74 6f 20 65 78 65 | 63 75 74 65 20 2a 2f 0a |d to exe|cute */.|
|00001280| 7b 0a 09 2f 2a 20 73 63 | 72 6f 6c 6c 20 75 70 2c |{../* sc|roll up,|
|00001290| 20 73 6f 20 77 65 20 64 | 6f 6e 27 74 20 6f 76 65 | so we d|on't ove|
|000012a0| 72 77 72 69 74 65 20 74 | 68 65 20 63 6f 6d 6d 61 |rwrite t|he comma|
|000012b0| 6e 64 20 2a 2f 0a 09 69 | 66 20 28 6d 6f 64 65 20 |nd */..i|f (mode |
|000012c0| 3d 3d 20 4d 4f 44 45 5f | 43 4f 4c 4f 4e 29 0a 09 |== MODE_|COLON)..|
|000012d0| 7b 0a 09 09 61 64 64 63 | 68 28 27 5c 6e 27 29 3b |{...addc|h('\n');|
|000012e0| 0a 09 09 72 65 66 72 65 | 73 68 28 29 3b 0a 09 7d |...refre|sh();..}|
|000012f0| 0a 0a 09 2f 2a 20 72 75 | 6e 20 74 68 65 20 63 6f |.../* ru|n the co|
|00001300| 6d 6d 61 6e 64 2e 20 20 | 62 65 20 63 61 72 65 66 |mmand. |be caref|
|00001310| 75 6c 20 61 62 6f 75 74 | 20 6d 6f 64 65 73 20 26 |ul about| modes &|
|00001320| 20 6f 75 74 70 75 74 20 | 2a 2f 0a 09 65 78 77 72 | output |*/..exwr|
|00001330| 6f 74 65 20 3d 20 28 6d | 6f 64 65 20 3d 3d 20 4d |ote = (m|ode == M|
|00001340| 4f 44 45 5f 43 4f 4c 4f | 4e 29 3b 0a 09 64 6f 65 |ODE_COLO|N);..doe|
|00001350| 78 63 6d 64 28 74 65 78 | 74 29 3b 0a 09 65 78 72 |xcmd(tex|t);..exr|
|00001360| 65 66 72 65 73 68 28 29 | 3b 0a 0a 09 2f 2a 20 69 |efresh()|;.../* i|
|00001370| 66 20 6d 6f 64 65 20 69 | 73 20 6e 6f 20 6c 6f 6e |f mode i|s no lon|
|00001380| 67 65 72 20 4d 4f 44 45 | 5f 56 49 2c 20 74 68 65 |ger MODE|_VI, the|
|00001390| 6e 20 77 65 20 73 68 6f | 75 6c 64 20 71 75 69 74 |n we sho|uld quit|
|000013a0| 20 72 69 67 68 74 20 61 | 77 61 79 21 20 2a 2f 0a | right a|way! */.|
|000013b0| 09 69 66 20 28 6d 6f 64 | 65 20 21 3d 20 4d 4f 44 |.if (mod|e != MOD|
|000013c0| 45 5f 56 49 20 26 26 20 | 6d 6f 64 65 20 21 3d 20 |E_VI && |mode != |
|000013d0| 4d 4f 44 45 5f 43 4f 4c | 4f 4e 29 0a 09 09 72 65 |MODE_COL|ON)...re|
|000013e0| 74 75 72 6e 20 63 75 72 | 73 6f 72 3b 0a 0a 09 2f |turn cur|sor;.../|
|000013f0| 2a 20 54 68 65 20 63 6f | 6d 6d 61 6e 64 20 64 69 |* The co|mmand di|
|00001400| 64 20 73 6f 6d 65 20 6f | 75 74 70 75 74 2e 20 20 |d some o|utput. |
|00001410| 57 61 69 74 20 66 6f 72 | 20 61 20 6b 65 79 73 74 |Wait for| a keyst|
|00001420| 6f 6b 65 2e 20 2a 2f 0a | 09 69 66 20 28 65 78 77 |oke. */.|.if (exw|
|00001430| 72 6f 74 65 29 0a 09 7b | 0a 09 09 6d 6f 64 65 20 |rote)..{|...mode |
|00001440| 3d 20 4d 4f 44 45 5f 56 | 49 3b 09 0a 09 09 6d 73 |= MODE_V|I;....ms|
|00001450| 67 28 22 5b 48 69 74 20 | 61 6e 79 20 6b 65 79 20 |g("[Hit |any key |
|00001460| 74 6f 20 63 6f 6e 74 69 | 6e 75 65 5d 22 29 3b 0a |to conti|nue]");.|
|00001470| 09 09 69 66 20 28 67 65 | 74 6b 65 79 28 30 29 20 |..if (ge|tkey(0) |
|00001480| 3d 3d 20 27 3a 27 29 0a | 09 09 7b 09 6d 6f 64 65 |== ':').|..{.mode|
|00001490| 20 3d 20 4d 4f 44 45 5f | 43 4f 4c 4f 4e 3b 0a 09 | = MODE_|COLON;..|
|000014a0| 09 09 61 64 64 63 68 28 | 27 5c 6e 27 29 3b 0a 09 |..addch(|'\n');..|
|000014b0| 09 7d 0a 09 09 65 6c 73 | 65 0a 09 09 09 72 65 64 |.}...els|e....red|
|000014c0| 72 61 77 28 4d 41 52 4b | 5f 55 4e 53 45 54 2c 20 |raw(MARK|_UNSET, |
|000014d0| 46 41 4c 53 45 29 3b 0a | 09 7d 0a 0a 09 72 65 74 |FALSE);.|.}...ret|
|000014e0| 75 72 6e 20 63 75 72 73 | 6f 72 3b 0a 7d 0a 0a 2f |urn curs|or;.}../|
|000014f0| 2a 20 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |* This f|unction |
|00001500| 75 6e 64 6f 65 73 20 74 | 68 65 20 6c 61 73 74 20 |undoes t|he last |
|00001510| 63 68 61 6e 67 65 20 2a | 2f 0a 2f 2a 41 52 47 53 |change *|/./*ARGS|
|00001520| 55 53 45 44 2a 2f 0a 4d | 41 52 4b 20 76 5f 75 6e |USED*/.M|ARK v_un|
|00001530| 64 6f 28 6d 29 0a 09 4d | 41 52 4b 09 6d 3b 09 2f |do(m)..M|ARK.m;./|
|00001540| 2a 20 28 69 67 6e 6f 72 | 65 64 29 20 2a 2f 0a 7b |* (ignor|ed) */.{|
|00001550| 0a 09 75 6e 64 6f 28 29 | 3b 0a 09 72 65 64 72 61 |..undo()|;..redra|
|00001560| 77 28 4d 41 52 4b 5f 55 | 4e 53 45 54 2c 20 46 41 |w(MARK_U|NSET, FA|
|00001570| 4c 53 45 29 3b 0a 09 72 | 65 74 75 72 6e 20 63 75 |LSE);..r|eturn cu|
|00001580| 72 73 6f 72 3b 0a 7d 0a | 0a 2f 2a 20 54 68 69 73 |rsor;.}.|./* This|
|00001590| 20 66 75 6e 63 74 69 6f | 6e 20 64 65 6c 65 74 65 | functio|n delete|
|000015a0| 73 20 74 68 65 20 63 68 | 61 72 61 63 74 65 72 28 |s the ch|aracter(|
|000015b0| 73 29 20 74 68 61 74 20 | 74 68 65 20 63 75 72 73 |s) that |the curs|
|000015c0| 6f 72 20 69 73 20 6f 6e | 20 2a 2f 0a 4d 41 52 4b |or is on| */.MARK|
|000015d0| 20 76 5f 78 63 68 61 72 | 28 6d 2c 20 63 6e 74 29 | v_xchar|(m, cnt)|
|000015e0| 0a 09 4d 41 52 4b 09 6d | 3b 09 2f 2a 20 77 68 65 |..MARK.m|;./* whe|
|000015f0| 72 65 20 74 6f 20 73 74 | 61 72 74 20 64 65 6c 65 |re to st|art dele|
|00001600| 74 69 6f 6e 73 20 2a 2f | 0a 09 6c 6f 6e 67 09 63 |tions */|..long.c|
|00001610| 6e 74 3b 09 2f 2a 20 6e | 75 6d 62 65 72 20 6f 66 |nt;./* n|umber of|
|00001620| 20 63 68 61 72 73 20 74 | 6f 20 64 65 6c 65 74 65 | chars t|o delete|
|00001630| 20 2a 2f 0a 7b 0a 09 44 | 45 46 41 55 4c 54 28 31 | */.{..D|EFAULT(1|
|00001640| 29 3b 0a 0a 09 70 66 65 | 74 63 68 28 6d 61 72 6b |);...pfe|tch(mark|
|00001650| 6c 69 6e 65 28 6d 29 29 | 3b 0a 09 69 66 20 28 6d |line(m))|;..if (m|
|00001660| 61 72 6b 69 64 78 28 6d | 20 2b 20 63 6e 74 29 20 |arkidx(m| + cnt) |
|00001670| 3e 20 70 6c 65 6e 29 0a | 09 7b 0a 09 09 63 6e 74 |> plen).|.{...cnt|
|00001680| 20 3d 20 70 6c 65 6e 20 | 2d 20 6d 61 72 6b 69 64 | = plen |- markid|
|00001690| 78 28 6d 29 3b 0a 09 7d | 0a 09 69 66 20 28 63 6e |x(m);..}|..if (cn|
|000016a0| 74 20 3d 3d 20 30 4c 29 | 0a 09 7b 0a 09 09 72 65 |t == 0L)|..{...re|
|000016b0| 74 75 72 6e 20 4d 41 52 | 4b 5f 55 4e 53 45 54 3b |turn MAR|K_UNSET;|
|000016c0| 0a 09 7d 0a 09 43 68 61 | 6e 67 65 54 65 78 74 0a |..}..Cha|ngeText.|
|000016d0| 09 7b 0a 09 09 63 75 74 | 28 6d 2c 20 6d 20 2b 20 |.{...cut|(m, m + |
|000016e0| 63 6e 74 29 3b 0a 09 09 | 64 65 6c 65 74 65 28 6d |cnt);...|delete(m|
|000016f0| 2c 20 6d 20 2b 20 63 6e | 74 29 3b 0a 09 7d 0a 09 |, m + cn|t);..}..|
|00001700| 72 65 74 75 72 6e 20 6d | 3b 0a 7d 0a 0a 2f 2a 20 |return m|;.}../* |
|00001710| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 64 65 |This fun|ction de|
|00001720| 6c 65 74 65 73 20 63 68 | 61 72 61 63 74 65 72 20 |letes ch|aracter |
|00001730| 74 6f 20 74 68 65 20 6c | 65 66 74 20 6f 66 20 74 |to the l|eft of t|
|00001740| 68 65 20 63 75 72 73 6f | 72 20 2a 2f 0a 4d 41 52 |he curso|r */.MAR|
|00001750| 4b 20 76 5f 58 63 68 61 | 72 28 6d 2c 20 63 6e 74 |K v_Xcha|r(m, cnt|
|00001760| 29 0a 09 4d 41 52 4b 09 | 6d 3b 09 2f 2a 20 77 68 |)..MARK.|m;./* wh|
|00001770| 65 72 65 20 64 65 6c 65 | 74 69 6f 6e 73 20 65 6e |ere dele|tions en|
|00001780| 64 20 2a 2f 0a 09 6c 6f | 6e 67 09 63 6e 74 3b 09 |d */..lo|ng.cnt;.|
|00001790| 2f 2a 20 6e 75 6d 62 65 | 72 20 6f 66 20 63 68 61 |/* numbe|r of cha|
|000017a0| 72 73 20 74 6f 20 64 65 | 6c 65 74 65 20 2a 2f 0a |rs to de|lete */.|
|000017b0| 7b 0a 09 44 45 46 41 55 | 4c 54 28 31 29 3b 0a 0a |{..DEFAU|LT(1);..|
|000017c0| 09 2f 2a 20 69 66 20 77 | 65 27 72 65 20 61 74 20 |./* if w|e're at |
|000017d0| 74 68 65 20 66 69 72 73 | 74 20 63 68 61 72 20 6f |the firs|t char o|
|000017e0| 66 20 74 68 65 20 6c 69 | 6e 65 2c 20 65 72 72 6f |f the li|ne, erro|
|000017f0| 72 21 20 2a 2f 0a 09 69 | 66 20 28 6d 61 72 6b 69 |r! */..i|f (marki|
|00001800| 64 78 28 6d 29 20 3d 3d | 20 30 29 0a 09 7b 0a 09 |dx(m) ==| 0)..{..|
|00001810| 09 72 65 74 75 72 6e 20 | 4d 41 52 4b 5f 55 4e 53 |.return |MARK_UNS|
|00001820| 45 54 3b 0a 09 7d 0a 0a | 09 2f 2a 20 6d 61 6b 65 |ET;..}..|./* make|
|00001830| 20 73 75 72 65 20 77 65 | 20 64 6f 6e 27 74 20 74 | sure we| don't t|
|00001840| 72 79 20 74 6f 20 64 65 | 6c 65 74 65 20 6d 6f 72 |ry to de|lete mor|
|00001850| 65 20 63 68 61 72 73 20 | 74 68 61 6e 20 74 68 65 |e chars |than the|
|00001860| 72 65 20 61 72 65 20 2a | 2f 0a 09 69 66 20 28 63 |re are *|/..if (c|
|00001870| 6e 74 20 3e 20 6d 61 72 | 6b 69 64 78 28 6d 29 29 |nt > mar|kidx(m))|
|00001880| 0a 09 7b 0a 09 09 63 6e | 74 20 3d 20 6d 61 72 6b |..{...cn|t = mark|
|00001890| 69 64 78 28 6d 29 3b 0a | 09 7d 0a 0a 09 2f 2a 20 |idx(m);.|.}.../* |
|000018a0| 64 65 6c 65 74 65 20 27 | 65 6d 20 2a 2f 0a 09 43 |delete '|em */..C|
|000018b0| 68 61 6e 67 65 54 65 78 | 74 0a 09 7b 0a 09 09 63 |hangeTex|t..{...c|
|000018c0| 75 74 28 6d 20 2d 20 63 | 6e 74 2c 20 6d 29 3b 0a |ut(m - c|nt, m);.|
|000018d0| 09 09 64 65 6c 65 74 65 | 28 6d 20 2d 20 63 6e 74 |..delete|(m - cnt|
|000018e0| 2c 20 6d 29 3b 0a 09 7d | 0a 0a 09 72 65 74 75 72 |, m);..}|...retur|
|000018f0| 6e 20 6d 20 2d 20 63 6e | 74 3b 0a 7d 0a 0a 2f 2a |n m - cn|t;.}../*|
|00001900| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 64 | This fu|nction d|
|00001910| 65 66 69 6e 65 73 20 61 | 20 6d 61 72 6b 20 2a 2f |efines a| mark */|
|00001920| 0a 2f 2a 41 52 47 53 55 | 53 45 44 2a 2f 0a 4d 41 |./*ARGSU|SED*/.MA|
|00001930| 52 4b 20 76 5f 6d 61 72 | 6b 28 6d 2c 20 63 6f 75 |RK v_mar|k(m, cou|
|00001940| 6e 74 2c 20 6b 65 79 29 | 0a 09 4d 41 52 4b 09 6d |nt, key)|..MARK.m|
|00001950| 3b 09 2f 2a 20 77 68 65 | 72 65 20 74 68 65 20 6d |;./* whe|re the m|
|00001960| 61 72 6b 20 77 69 6c 6c | 20 62 65 20 2a 2f 0a 09 |ark will| be */..|
|00001970| 6c 6f 6e 67 09 63 6f 75 | 6e 74 3b 09 2f 2a 20 28 |long.cou|nt;./* (|
|00001980| 69 67 6e 6f 72 65 64 29 | 20 2a 2f 0a 09 69 6e 74 |ignored)| */..int|
|00001990| 09 6b 65 79 3b 09 2f 2a | 20 74 68 65 20 41 53 43 |.key;./*| the ASC|
|000019a0| 49 49 20 6c 61 62 65 6c | 20 6f 66 20 74 68 65 20 |II label| of the |
|000019b0| 6d 61 72 6b 20 2a 2f 0a | 7b 0a 09 69 66 20 28 6b |mark */.|{..if (k|
|000019c0| 65 79 20 3c 20 27 61 27 | 20 7c 7c 20 6b 65 79 20 |ey < 'a'| || key |
|000019d0| 3e 20 27 7a 27 29 0a 09 | 7b 0a 09 09 6d 73 67 28 |> 'z')..|{...msg(|
|000019e0| 22 4d 61 72 6b 73 20 6d | 75 73 74 20 62 65 20 66 |"Marks m|ust be f|
|000019f0| 72 6f 6d 20 61 20 74 6f | 20 7a 22 29 3b 0a 09 7d |rom a to| z");..}|
|00001a00| 0a 09 65 6c 73 65 0a 09 | 7b 0a 09 09 6d 61 72 6b |..else..|{...mark|
|00001a10| 5b 6b 65 79 20 2d 20 27 | 61 27 5d 20 3d 20 6d 3b |[key - '|a'] = m;|
|00001a20| 0a 09 7d 0a 09 72 65 74 | 75 72 6e 20 6d 3b 0a 7d |..}..ret|urn m;.}|
|00001a30| 0a 0a 2f 2a 20 54 68 69 | 73 20 66 75 6e 63 74 69 |../* Thi|s functi|
|00001a40| 6f 6e 20 74 6f 67 67 6c | 65 73 20 75 70 70 65 72 |on toggl|es upper|
|00001a50| 20 26 20 6c 6f 77 65 72 | 20 63 61 73 65 20 6c 65 | & lower| case le|
|00001a60| 74 74 65 72 73 20 2a 2f | 0a 4d 41 52 4b 20 76 5f |tters */|.MARK v_|
|00001a70| 75 6c 63 61 73 65 28 6d | 29 0a 09 4d 41 52 4b 09 |ulcase(m|)..MARK.|
|00001a80| 6d 3b 09 2f 2a 20 77 68 | 65 72 65 20 74 6f 20 6d |m;./* wh|ere to m|
|00001a90| 61 6b 65 20 74 68 65 20 | 63 68 61 6e 67 65 20 2a |ake the |change *|
|00001aa0| 2f 0a 7b 0a 09 63 68 61 | 72 09 6e 65 77 5b 32 5d |/.{..cha|r.new[2]|
|00001ab0| 3b 0a 23 69 66 09 4d 53 | 44 4f 53 20 7c 7c 20 54 |;.#if.MS|DOS || T|
|00001ac0| 4f 53 0a 09 63 68 61 72 | 09 2a 70 6f 73 3b 0a 09 |OS..char|.*pos;..|
|00001ad0| 63 68 61 72 09 2a 6c 6f | 77 65 72 3d 22 5c 32 30 |char.*lo|wer="\20|
|00001ae0| 37 5c 32 30 31 5c 32 30 | 32 5c 32 30 34 5c 32 30 |7\201\20|2\204\20|
|00001af0| 36 5c 32 32 31 5c 32 32 | 34 5c 32 34 34 22 3b 0a |6\221\22|4\244";.|
|00001b00| 09 63 68 61 72 20 09 2a | 75 70 70 65 72 3d 22 5c |.char .*|upper="\|
|00001b10| 32 30 30 5c 32 33 32 5c | 32 32 30 5c 32 31 36 5c |200\232\|220\216\|
|00001b20| 32 31 37 5c 32 32 32 5c | 32 33 31 5c 32 34 35 22 |217\222\|231\245"|
|00001b30| 3b 0a 23 65 6e 64 69 66 | 0a 0a 09 2f 2a 20 65 78 |;.#endif|.../* ex|
|00001b40| 74 72 61 63 74 20 74 68 | 65 20 63 68 61 72 20 74 |tract th|e char t|
|00001b50| 68 61 74 27 73 20 74 68 | 65 72 65 20 6e 6f 77 20 |hat's th|ere now |
|00001b60| 2a 2f 0a 09 70 66 65 74 | 63 68 28 6d 61 72 6b 6c |*/..pfet|ch(markl|
|00001b70| 69 6e 65 28 6d 29 29 3b | 0a 09 6e 65 77 5b 30 5d |ine(m));|..new[0]|
|00001b80| 20 3d 20 70 74 65 78 74 | 5b 6d 61 72 6b 69 64 78 | = ptext|[markidx|
|00001b90| 28 6d 29 5d 3b 0a 09 6e | 65 77 5b 31 5d 20 3d 20 |(m)];..n|ew[1] = |
|00001ba0| 27 5c 30 27 3b 0a 0a 09 | 2f 2a 20 63 68 61 6e 67 |'\0';...|/* chang|
|00001bb0| 65 20 69 74 20 69 66 20 | 6e 65 63 65 73 73 61 72 |e it if |necessar|
|00001bc0| 79 20 2a 2f 0a 09 69 66 | 20 28 6e 65 77 5b 30 5d |y */..if| (new[0]|
|00001bd0| 20 3e 3d 20 27 61 27 20 | 26 26 20 6e 65 77 5b 30 | >= 'a' |&& new[0|
|00001be0| 5d 20 3c 3d 20 27 7a 27 | 20 7c 7c 20 6e 65 77 5b |] <= 'z'| || new[|
|00001bf0| 30 5d 20 3e 3d 20 27 41 | 27 20 26 26 20 6e 65 77 |0] >= 'A|' && new|
|00001c00| 5b 30 5d 20 3c 3d 20 27 | 5a 27 29 0a 09 7b 0a 09 |[0] <= '|Z')..{..|
|00001c10| 09 6e 65 77 5b 30 5d 20 | 5e 3d 20 28 27 41 27 20 |.new[0] |^= ('A' |
|00001c20| 5e 20 27 61 27 29 3b 0a | 09 09 43 68 61 6e 67 65 |^ 'a');.|..Change|
|00001c30| 54 65 78 74 0a 09 09 7b | 0a 09 09 09 63 68 61 6e |Text...{|....chan|
|00001c40| 67 65 28 6d 2c 20 6d 20 | 2b 20 31 2c 20 6e 65 77 |ge(m, m |+ 1, new|
|00001c50| 29 3b 0a 09 09 7d 0a 09 | 7d 0a 23 69 66 09 4d 53 |);...}..|}.#if.MS|
|00001c60| 44 4f 53 20 7c 7c 20 54 | 4f 53 0a 09 69 66 20 28 |DOS || T|OS..if (|
|00001c70| 28 70 6f 73 3d 73 74 72 | 63 68 72 28 6c 6f 77 65 |(pos=str|chr(lowe|
|00001c80| 72 2c 20 6e 65 77 5b 30 | 5d 29 29 21 3d 30 29 0a |r, new[0|]))!=0).|
|00001c90| 09 09 6e 65 77 5b 30 5d | 3d 75 70 70 65 72 5b 28 |..new[0]|=upper[(|
|00001ca0| 69 6e 74 29 28 70 6f 73 | 2d 6c 6f 77 65 72 29 5d |int)(pos|-lower)]|
|00001cb0| 3b 0a 09 65 6c 73 65 20 | 69 66 20 28 28 70 6f 73 |;..else |if ((pos|
|00001cc0| 3d 73 74 72 63 68 72 28 | 75 70 70 65 72 2c 20 6e |=strchr(|upper, n|
|00001cd0| 65 77 5b 30 5d 29 29 21 | 3d 30 29 0a 09 09 6e 65 |ew[0]))!|=0)...ne|
|00001ce0| 77 5b 30 5d 3d 6c 6f 77 | 65 72 5b 28 69 6e 74 29 |w[0]=low|er[(int)|
|00001cf0| 28 70 6f 73 2d 75 70 70 | 65 72 29 5d 3b 0a 09 65 |(pos-upp|er)];..e|
|00001d00| 6c 73 65 0a 09 09 67 6f | 74 6f 20 6e 6f 63 68 61 |lse...go|to nocha|
|00001d10| 6e 67 65 3b 09 09 2f 2a | 20 55 72 67 68 68 20 2d |nge;../*| Urghh -|
|00001d20| 20 47 42 20 2a 2f 0a 09 | 43 68 61 6e 67 65 54 65 | GB */..|ChangeTe|
|00001d30| 78 74 0a 09 7b 0a 09 09 | 63 68 61 6e 67 65 28 6d |xt..{...|change(m|
|00001d40| 2c 20 6d 20 2b 20 31 2c | 20 6e 65 77 29 3b 0a 09 |, m + 1,| new);..|
|00001d50| 7d 0a 6e 6f 63 68 61 6e | 67 65 3a 0a 23 65 6e 64 |}.nochan|ge:.#end|
|00001d60| 69 66 0a 09 69 66 20 28 | 6e 65 77 5b 30 5d 20 26 |if..if (|new[0] &|
|00001d70| 26 20 70 74 65 78 74 5b | 6d 61 72 6b 69 64 78 28 |& ptext[|markidx(|
|00001d80| 6d 29 20 2b 20 31 5d 29 | 0a 09 7b 0a 09 09 6d 2b |m) + 1])|..{...m+|
|00001d90| 2b 3b 0a 09 7d 0a 09 72 | 65 74 75 72 6e 20 6d 3b |+;..}..r|eturn m;|
|00001da0| 0a 7d 0a 0a 0a 4d 41 52 | 4b 20 76 5f 72 65 70 6c |.}...MAR|K v_repl|
|00001db0| 61 63 65 28 6d 2c 20 63 | 6e 74 2c 20 6b 65 79 29 |ace(m, c|nt, key)|
|00001dc0| 0a 09 4d 41 52 4b 09 6d | 3b 09 2f 2a 20 66 69 72 |..MARK.m|;./* fir|
|00001dd0| 73 74 20 63 68 61 72 20 | 74 6f 20 62 65 20 72 65 |st char |to be re|
|00001de0| 70 6c 61 63 65 64 20 2a | 2f 0a 09 6c 6f 6e 67 09 |placed *|/..long.|
|00001df0| 63 6e 74 3b 09 2f 2a 20 | 6e 75 6d 62 65 72 20 6f |cnt;./* |number o|
|00001e00| 66 20 63 68 61 72 73 20 | 74 6f 20 72 65 70 6c 61 |f chars |to repla|
|00001e10| 63 65 20 2a 2f 0a 09 69 | 6e 74 09 6b 65 79 3b 09 |ce */..i|nt.key;.|
|00001e20| 2f 2a 20 77 68 61 74 20 | 74 6f 20 72 65 70 6c 61 |/* what |to repla|
|00001e30| 63 65 20 74 68 65 6d 20 | 77 69 74 68 20 2a 2f 0a |ce them |with */.|
|00001e40| 7b 0a 09 72 65 67 69 73 | 74 65 72 20 63 68 61 72 |{..regis|ter char|
|00001e50| 09 2a 74 65 78 74 3b 0a | 09 72 65 67 69 73 74 65 |.*text;.|.registe|
|00001e60| 72 20 69 6e 74 09 69 3b | 0a 09 73 74 61 74 69 63 |r int.i;|..static|
|00001e70| 20 69 6e 74 09 73 61 6d | 65 6b 65 79 3b 0a 0a 09 | int.sam|ekey;...|
|00001e80| 44 45 46 41 55 4c 54 28 | 31 29 3b 0a 0a 09 2f 2a |DEFAULT(|1);.../*|
|00001e90| 20 6d 61 70 20 5e 4d 20 | 74 6f 20 27 5c 6e 27 20 | map ^M |to '\n' |
|00001ea0| 2a 2f 0a 09 69 66 20 28 | 6b 65 79 20 3d 3d 20 27 |*/..if (|key == '|
|00001eb0| 5c 72 27 29 0a 09 7b 0a | 09 09 6b 65 79 20 3d 20 |\r')..{.|..key = |
|00001ec0| 27 5c 6e 27 3b 0a 09 7d | 0a 09 65 6c 73 65 20 69 |'\n';..}|..else i|
|00001ed0| 66 20 28 6b 65 79 20 3d | 3d 20 63 74 72 6c 28 27 |f (key =|= ctrl('|
|00001ee0| 56 27 29 29 0a 09 7b 0a | 09 09 69 66 20 28 64 6f |V'))..{.|..if (do|
|00001ef0| 69 6e 67 64 6f 74 29 0a | 09 09 09 6b 65 79 20 3d |ingdot).|...key =|
|00001f00| 20 73 61 6d 65 6b 65 79 | 3b 0a 09 09 65 6c 73 65 | samekey|;...else|
|00001f10| 0a 09 09 09 6b 65 79 20 | 3d 20 73 61 6d 65 6b 65 |....key |= sameke|
|00001f20| 79 20 3d 20 67 65 74 6b | 65 79 28 30 29 3b 0a 09 |y = getk|ey(0);..|
|00001f30| 09 69 66 20 28 6b 65 79 | 20 3d 3d 20 30 29 0a 09 |.if (key| == 0)..|
|00001f40| 09 09 72 65 74 75 72 6e | 20 4d 41 52 4b 5f 55 4e |..return| MARK_UN|
|00001f50| 53 45 54 3b 0a 09 7d 0a | 09 65 6c 73 65 20 69 66 |SET;..}.|.else if|
|00001f60| 20 28 21 64 6f 69 6e 67 | 64 6f 74 20 26 26 20 6b | (!doing|dot && k|
|00001f70| 65 79 20 3d 3d 20 63 74 | 72 6c 28 27 5b 27 29 29 |ey == ct|rl('['))|
|00001f80| 0a 09 7b 0a 09 09 73 61 | 6d 65 6b 65 79 20 3d 20 |..{...sa|mekey = |
|00001f90| 30 3b 0a 09 09 72 65 74 | 75 72 6e 20 4d 41 52 4b |0;...ret|urn MARK|
|00001fa0| 5f 55 4e 53 45 54 3b 0a | 09 7d 0a 0a 09 2f 2a 20 |_UNSET;.|.}.../* |
|00001fb0| 6d 61 6b 65 20 73 75 72 | 65 20 74 68 65 20 72 65 |make sur|e the re|
|00001fc0| 73 75 6c 74 69 6e 67 20 | 6c 69 6e 65 20 69 73 6e |sulting |line isn|
|00001fd0| 27 74 20 74 6f 6f 20 6c | 6f 6e 67 20 2a 2f 0a 09 |'t too l|ong */..|
|00001fe0| 69 66 20 28 63 6e 74 20 | 3e 20 42 4c 4b 53 49 5a |if (cnt |> BLKSIZ|
|00001ff0| 45 20 2d 20 32 20 2d 20 | 6d 61 72 6b 69 64 78 28 |E - 2 - |markidx(|
|00002000| 6d 29 29 0a 09 7b 0a 09 | 09 63 6e 74 20 3d 20 42 |m))..{..|.cnt = B|
|00002010| 4c 4b 53 49 5a 45 20 2d | 20 32 20 2d 20 6d 61 72 |LKSIZE -| 2 - mar|
|00002020| 6b 69 64 78 28 6d 29 3b | 0a 09 7d 0a 0a 09 2f 2a |kidx(m);|..}.../*|
|00002030| 20 62 75 69 6c 64 20 61 | 20 73 74 72 69 6e 67 20 | build a| string |
|00002040| 6f 66 20 74 68 65 20 64 | 65 73 69 72 65 64 20 63 |of the d|esired c|
|00002050| 68 61 72 61 63 74 65 72 | 20 77 69 74 68 20 74 68 |haracter| with th|
|00002060| 65 20 64 65 73 69 72 65 | 64 20 6c 65 6e 67 74 68 |e desire|d length|
|00002070| 20 2a 2f 0a 09 66 6f 72 | 20 28 74 65 78 74 20 3d | */..for| (text =|
|00002080| 20 74 6d 70 62 6c 6b 2e | 63 2c 20 69 20 3d 20 63 | tmpblk.|c, i = c|
|00002090| 6e 74 3b 20 69 20 3e 20 | 30 3b 20 69 2d 2d 29 0a |nt; i > |0; i--).|
|000020a0| 09 7b 0a 09 09 2a 74 65 | 78 74 2b 2b 20 3d 20 6b |.{...*te|xt++ = k|
|000020b0| 65 79 3b 0a 09 7d 0a 09 | 2a 74 65 78 74 20 3d 20 |ey;..}..|*text = |
|000020c0| 27 5c 30 27 3b 0a 0a 09 | 2f 2a 20 6d 61 6b 65 20 |'\0';...|/* make |
|000020d0| 73 75 72 65 20 63 6e 74 | 20 64 6f 65 73 6e 27 74 |sure cnt| doesn't|
|000020e0| 20 65 78 74 65 6e 64 20 | 70 61 73 74 20 45 4f 4c | extend |past EOL|
|000020f0| 20 2a 2f 0a 09 70 66 65 | 74 63 68 28 6d 61 72 6b | */..pfe|tch(mark|
|00002100| 6c 69 6e 65 28 6d 29 29 | 3b 0a 09 6b 65 79 20 3d |line(m))|;..key =|
|00002110| 20 6d 61 72 6b 69 64 78 | 28 6d 29 3b 0a 09 69 66 | markidx|(m);..if|
|00002120| 20 28 6b 65 79 20 2b 20 | 63 6e 74 20 3e 20 70 6c | (key + |cnt > pl|
|00002130| 65 6e 29 0a 09 7b 0a 09 | 09 63 6e 74 20 3d 20 70 |en)..{..|.cnt = p|
|00002140| 6c 65 6e 20 2d 20 6b 65 | 79 3b 0a 09 7d 0a 0a 09 |len - ke|y;..}...|
|00002150| 2f 2a 20 64 6f 20 74 68 | 65 20 72 65 70 6c 61 63 |/* do th|e replac|
|00002160| 65 6d 65 6e 74 20 2a 2f | 0a 09 43 68 61 6e 67 65 |ement */|..Change|
|00002170| 54 65 78 74 0a 09 7b 0a | 09 09 63 68 61 6e 67 65 |Text..{.|..change|
|00002180| 28 6d 2c 20 6d 20 2b 20 | 63 6e 74 2c 20 74 6d 70 |(m, m + |cnt, tmp|
|00002190| 62 6c 6b 2e 63 29 3b 0a | 09 7d 0a 0a 09 69 66 20 |blk.c);.|.}...if |
|000021a0| 28 2a 74 6d 70 62 6c 6b | 2e 63 20 3d 3d 20 27 5c |(*tmpblk|.c == '\|
|000021b0| 6e 27 29 0a 09 7b 0a 09 | 09 72 65 74 75 72 6e 20 |n')..{..|.return |
|000021c0| 28 6d 20 26 20 7e 28 42 | 4c 4b 53 49 5a 45 20 2d |(m & ~(B|LKSIZE -|
|000021d0| 20 31 29 29 20 2b 20 63 | 6e 74 20 2a 20 42 4c 4b | 1)) + c|nt * BLK|
|000021e0| 53 49 5a 45 3b 0a 09 7d | 0a 09 65 6c 73 65 0a 09 |SIZE;..}|..else..|
|000021f0| 7b 0a 09 09 72 65 74 75 | 72 6e 20 6d 20 2b 20 63 |{...retu|rn m + c|
|00002200| 6e 74 20 2d 20 31 3b 0a | 09 7d 0a 7d 0a 0a 4d 41 |nt - 1;.|.}.}..MA|
|00002210| 52 4b 20 76 5f 6f 76 65 | 72 74 79 70 65 28 6d 29 |RK v_ove|rtype(m)|
|00002220| 0a 09 4d 41 52 4b 09 09 | 6d 3b 09 2f 2a 20 77 68 |..MARK..|m;./* wh|
|00002230| 65 72 65 20 74 6f 20 73 | 74 61 72 74 20 6f 76 65 |ere to s|tart ove|
|00002240| 72 74 79 70 69 6e 67 20 | 2a 2f 0a 7b 0a 09 4d 41 |rtyping |*/.{..MA|
|00002250| 52 4b 09 09 65 6e 64 3b | 09 2f 2a 20 65 6e 64 20 |RK..end;|./* end |
|00002260| 6f 66 20 61 20 73 75 62 | 73 74 69 74 75 74 69 6f |of a sub|stitutio|
|00002270| 6e 20 2a 2f 0a 09 73 74 | 61 74 69 63 20 6c 6f 6e |n */..st|atic lon|
|00002280| 67 09 77 69 64 74 68 3b | 09 2f 2a 20 77 69 64 74 |g.width;|./* widt|
|00002290| 68 20 6f 66 20 61 20 73 | 69 6e 67 6c 65 2d 6c 69 |h of a s|ingle-li|
|000022a0| 6e 65 20 72 65 70 6c 61 | 63 65 20 2a 2f 0a 0a 09 |ne repla|ce */...|
|000022b0| 2f 2a 20 74 68 65 20 22 | 64 6f 69 6e 67 64 6f 74 |/* the "|doingdot|
|000022c0| 22 20 76 65 72 73 69 6f | 6e 20 6f 66 20 72 65 70 |" versio|n of rep|
|000022d0| 6c 61 63 65 20 69 73 20 | 72 65 61 6c 6c 79 20 61 |lace is |really a|
|000022e0| 20 73 75 62 73 74 69 74 | 75 74 69 6f 6e 20 2a 2f | substit|ution */|
|000022f0| 0a 09 69 66 20 28 64 6f | 69 6e 67 64 6f 74 29 0a |..if (do|ingdot).|
|00002300| 09 7b 0a 09 09 2f 2a 20 | 77 61 73 20 74 68 65 20 |.{.../* |was the |
|00002310| 6c 61 73 74 20 6f 6e 65 | 20 72 65 61 6c 6c 79 20 |last one| really |
|00002320| 72 65 70 65 61 74 61 62 | 6c 65 3f 20 2a 2f 0a 09 |repeatab|le? */..|
|00002330| 09 69 66 20 28 77 69 64 | 74 68 20 3c 20 30 29 0a |.if (wid|th < 0).|
|00002340| 09 09 7b 0a 09 09 09 6d | 73 67 28 22 43 61 6e 27 |..{....m|sg("Can'|
|00002350| 74 20 72 65 70 65 61 74 | 20 61 20 6d 75 6c 74 69 |t repeat| a multi|
|00002360| 2d 6c 69 6e 65 20 6f 76 | 65 72 74 79 70 65 20 63 |-line ov|ertype c|
|00002370| 6f 6d 6d 61 6e 64 22 29 | 3b 0a 09 09 09 72 65 74 |ommand")|;....ret|
|00002380| 75 72 6e 20 4d 41 52 4b | 5f 55 4e 53 45 54 3b 0a |urn MARK|_UNSET;.|
|00002390| 09 09 7d 0a 0a 09 09 2f | 2a 20 72 65 70 6c 61 63 |..}..../|* replac|
|000023a0| 69 6e 67 20 6e 6f 74 68 | 69 6e 67 20 62 79 20 6e |ing noth|ing by n|
|000023b0| 6f 74 68 69 6e 67 3f 20 | 20 44 6f 6e 27 74 20 62 |othing? | Don't b|
|000023c0| 6f 74 68 65 72 20 2a 2f | 0a 09 09 69 66 20 28 77 |other */|...if (w|
|000023d0| 69 64 74 68 20 3d 3d 20 | 30 29 0a 09 09 7b 0a 09 |idth == |0)...{..|
|000023e0| 09 09 72 65 74 75 72 6e | 20 6d 3b 0a 09 09 7d 0a |..return| m;...}.|
|000023f0| 0a 09 09 2f 2a 20 72 65 | 70 6c 61 63 65 20 73 6f |.../* re|place so|
|00002400| 6d 65 20 63 68 61 72 73 | 20 62 79 20 72 65 70 65 |me chars| by repe|
|00002410| 61 74 65 64 20 74 65 78 | 74 20 2a 2f 0a 09 09 72 |ated tex|t */...r|
|00002420| 65 74 75 72 6e 20 76 5f | 73 75 62 73 74 28 6d 2c |eturn v_|subst(m,|
|00002430| 20 77 69 64 74 68 29 3b | 0a 09 7d 0a 0a 09 2f 2a | width);|..}.../*|
|00002440| 20 4e 6f 72 6d 61 6c 6c | 79 2c 20 77 65 20 69 6e | Normall|y, we in|
|00002450| 70 75 74 20 73 74 61 72 | 74 69 6e 67 20 68 65 72 |put star|ting her|
|00002460| 65 2c 20 69 6e 20 72 65 | 70 6c 61 63 65 20 6d 6f |e, in re|place mo|
|00002470| 64 65 20 2a 2f 0a 09 43 | 68 61 6e 67 65 54 65 78 |de */..C|hangeTex|
|00002480| 74 0a 09 7b 0a 09 09 65 | 6e 64 20 3d 20 69 6e 70 |t..{...e|nd = inp|
|00002490| 75 74 28 6d 2c 20 6d 2c | 20 57 48 45 4e 5f 56 49 |ut(m, m,| WHEN_VI|
|000024a0| 52 45 50 29 3b 0a 09 7d | 0a 0a 09 2f 2a 20 69 66 |REP);..}|.../* if|
|000024b0| 20 77 65 20 65 6e 64 65 | 64 20 6f 6e 20 74 68 65 | we ende|d on the|
|000024c0| 20 73 61 6d 65 20 6c 69 | 6e 65 20 77 65 20 73 74 | same li|ne we st|
|000024d0| 61 72 74 65 64 20 6f 6e | 2c 20 74 68 65 6e 20 74 |arted on|, then t|
|000024e0| 68 69 73 0a 09 20 2a 20 | 6f 76 65 72 74 79 70 65 |his.. * |overtype|
|000024f0| 20 69 73 20 72 65 70 65 | 61 74 61 62 6c 65 20 76 | is repe|atable v|
|00002500| 69 61 20 74 68 65 20 64 | 6f 74 20 6b 65 79 2e 0a |ia the d|ot key..|
|00002510| 09 20 2a 2f 0a 09 69 66 | 20 28 6d 61 72 6b 6c 69 |. */..if| (markli|
|00002520| 6e 65 28 65 6e 64 29 20 | 3d 3d 20 6d 61 72 6b 6c |ne(end) |== markl|
|00002530| 69 6e 65 28 6d 29 20 26 | 26 20 65 6e 64 20 3e 3d |ine(m) &|& end >=|
|00002540| 20 6d 20 2d 20 31 4c 29 | 0a 09 7b 0a 09 09 77 69 | m - 1L)|..{...wi|
|00002550| 64 74 68 20 3d 20 65 6e | 64 20 2d 20 6d 20 2b 20 |dth = en|d - m + |
|00002560| 31 4c 3b 0a 09 7d 0a 09 | 65 6c 73 65 20 2f 2a 20 |1L;..}..|else /* |
|00002570| 69 74 20 69 73 6e 27 74 | 20 72 65 70 65 61 74 61 |it isn't| repeata|
|00002580| 62 6c 65 20 2a 2f 0a 09 | 7b 0a 09 09 77 69 64 74 |ble */..|{...widt|
|00002590| 68 20 3d 20 2d 31 4c 3b | 0a 09 7d 0a 0a 09 72 65 |h = -1L;|..}...re|
|000025a0| 74 75 72 6e 20 65 6e 64 | 3b 0a 7d 0a 0a 0a 2f 2a |turn end|;.}.../*|
|000025b0| 20 54 68 69 73 20 66 75 | 6e 63 74 69 6f 6e 20 73 | This fu|nction s|
|000025c0| 65 6c 65 63 74 73 20 77 | 68 69 63 68 20 63 75 74 |elects w|hich cut|
|000025d0| 20 62 75 66 66 65 72 20 | 74 6f 20 75 73 65 20 2a | buffer |to use *|
|000025e0| 2f 0a 2f 2a 41 52 47 53 | 55 53 45 44 2a 2f 0a 4d |/./*ARGS|USED*/.M|
|000025f0| 41 52 4b 20 76 5f 73 65 | 6c 63 75 74 28 6d 2c 20 |ARK v_se|lcut(m, |
|00002600| 63 6e 74 2c 20 6b 65 79 | 29 0a 09 4d 41 52 4b 09 |cnt, key|)..MARK.|
|00002610| 6d 3b 0a 09 6c 6f 6e 67 | 09 63 6e 74 3b 0a 09 69 |m;..long|.cnt;..i|
|00002620| 6e 74 09 6b 65 79 3b 0a | 7b 0a 09 63 75 74 6e 61 |nt.key;.|{..cutna|
|00002630| 6d 65 28 6b 65 79 29 3b | 0a 09 72 65 74 75 72 6e |me(key);|..return|
|00002640| 20 6d 3b 0a 7d 0a 0a 2f | 2a 20 54 68 69 73 20 66 | m;.}../|* This f|
|00002650| 75 6e 63 74 69 6f 6e 20 | 70 61 73 74 65 73 20 74 |unction |pastes t|
|00002660| 65 78 74 20 66 72 6f 6d | 20 61 20 63 75 74 20 62 |ext from| a cut b|
|00002670| 75 66 66 65 72 20 2a 2f | 0a 2f 2a 41 52 47 53 55 |uffer */|./*ARGSU|
|00002680| 53 45 44 2a 2f 0a 4d 41 | 52 4b 20 76 5f 70 61 73 |SED*/.MA|RK v_pas|
|00002690| 74 65 28 6d 2c 20 63 6e | 74 2c 20 63 6d 64 29 0a |te(m, cn|t, cmd).|
|000026a0| 09 4d 41 52 4b 09 6d 3b | 09 2f 2a 20 77 68 65 72 |.MARK.m;|./* wher|
|000026b0| 65 20 74 6f 20 70 61 73 | 74 65 20 74 68 65 20 74 |e to pas|te the t|
|000026c0| 65 78 74 20 2a 2f 0a 09 | 6c 6f 6e 67 09 63 6e 74 |ext */..|long.cnt|
|000026d0| 3b 09 2f 2a 20 28 69 67 | 6e 6f 72 65 64 29 20 2a |;./* (ig|nored) *|
|000026e0| 2f 0a 09 69 6e 74 09 63 | 6d 64 3b 09 2f 2a 20 65 |/..int.c|md;./* e|
|000026f0| 69 74 68 65 72 20 27 70 | 27 20 6f 72 20 27 50 27 |ither 'p|' or 'P'|
|00002700| 20 2a 2f 0a 7b 0a 09 43 | 68 61 6e 67 65 54 65 78 | */.{..C|hangeTex|
|00002710| 74 0a 09 7b 0a 09 09 6d | 20 3d 20 70 61 73 74 65 |t..{...m| = paste|
|00002720| 28 6d 2c 20 63 6d 64 20 | 3d 3d 20 27 70 27 2c 20 |(m, cmd |== 'p', |
|00002730| 46 41 4c 53 45 29 3b 0a | 09 7d 0a 09 72 65 74 75 |FALSE);.|.}..retu|
|00002740| 72 6e 20 6d 3b 0a 7d 0a | 0a 2f 2a 20 54 68 69 73 |rn m;.}.|./* This|
|00002750| 20 66 75 6e 63 74 69 6f | 6e 20 79 61 6e 6b 73 20 | functio|n yanks |
|00002760| 74 65 78 74 20 69 6e 74 | 6f 20 61 20 63 75 74 20 |text int|o a cut |
|00002770| 62 75 66 66 65 72 20 2a | 2f 0a 4d 41 52 4b 20 76 |buffer *|/.MARK v|
|00002780| 5f 79 61 6e 6b 28 6d 2c | 20 6e 29 0a 09 4d 41 52 |_yank(m,| n)..MAR|
|00002790| 4b 09 6d 2c 20 6e 3b 09 | 2f 2a 20 72 61 6e 67 65 |K.m, n;.|/* range|
|000027a0| 20 6f 66 20 74 65 78 74 | 20 74 6f 20 79 61 6e 6b | of text| to yank|
|000027b0| 20 2a 2f 0a 7b 0a 09 63 | 75 74 28 6d 2c 20 6e 29 | */.{..c|ut(m, n)|
|000027c0| 3b 0a 09 72 65 74 75 72 | 6e 20 6d 3b 0a 7d 0a 0a |;..retur|n m;.}..|
|000027d0| 2f 2a 20 54 68 69 73 20 | 66 75 6e 63 74 69 6f 6e |/* This |function|
|000027e0| 20 64 65 6c 65 74 65 73 | 20 61 20 72 61 6e 67 65 | deletes| a range|
|000027f0| 20 6f 66 20 74 65 78 74 | 20 2a 2f 0a 4d 41 52 4b | of text| */.MARK|
|00002800| 20 76 5f 64 65 6c 65 74 | 65 28 6d 2c 20 6e 29 0a | v_delet|e(m, n).|
|00002810| 09 4d 41 52 4b 09 6d 2c | 20 6e 3b 09 2f 2a 20 72 |.MARK.m,| n;./* r|
|00002820| 61 6e 67 65 20 6f 66 20 | 74 65 78 74 20 74 6f 20 |ange of |text to |
|00002830| 64 65 6c 65 74 65 20 2a | 2f 0a 7b 0a 09 2f 2a 20 |delete *|/.{../* |
|00002840| 69 6c 6c 65 67 61 6c 20 | 74 6f 20 74 72 79 20 61 |illegal |to try a|
|00002850| 6e 64 20 64 65 6c 65 74 | 65 20 6e 6f 74 68 69 6e |nd delet|e nothin|
|00002860| 67 20 2a 2f 0a 09 69 66 | 20 28 6e 20 3c 3d 20 6d |g */..if| (n <= m|
|00002870| 29 0a 09 7b 0a 09 09 72 | 65 74 75 72 6e 20 4d 41 |)..{...r|eturn MA|
|00002880| 52 4b 5f 55 4e 53 45 54 | 3b 0a 09 7d 0a 09 2f 2a |RK_UNSET|;..}../*|
|00002890| 20 44 6f 20 69 74 20 2a | 2f 0a 09 43 68 61 6e 67 | Do it *|/..Chang|
|000028a0| 65 54 65 78 74 0a 09 7b | 0a 09 09 63 75 74 28 6d |eText..{|...cut(m|
|000028b0| 2c 20 6e 29 3b 0a 09 09 | 64 65 6c 65 74 65 28 6d |, n);...|delete(m|
|000028c0| 2c 20 6e 29 3b 0a 09 7d | 0a 09 72 65 74 75 72 6e |, n);..}|..return|
|000028d0| 20 6d 3b 0a 7d 0a 0a 0a | 2f 2a 20 54 68 69 73 20 | m;.}...|/* This |
|000028e0| 73 74 61 72 74 73 20 69 | 6e 70 75 74 20 6d 6f 64 |starts i|nput mod|
|000028f0| 65 20 77 69 74 68 6f 75 | 74 20 64 65 6c 65 74 69 |e withou|t deleti|
|00002900| 6e 67 20 61 6e 79 74 68 | 69 6e 67 20 2a 2f 0a 4d |ng anyth|ing */.M|
|00002910| 41 52 4b 20 76 5f 69 6e | 73 65 72 74 28 6d 2c 20 |ARK v_in|sert(m, |
|00002920| 63 6e 74 2c 20 6b 65 79 | 29 0a 09 4d 41 52 4b 09 |cnt, key|)..MARK.|
|00002930| 6d 3b 09 2f 2a 20 77 68 | 65 72 65 20 74 6f 20 73 |m;./* wh|ere to s|
|00002940| 74 61 72 74 20 28 73 6f | 72 74 20 6f 66 29 20 2a |tart (so|rt of) *|
|00002950| 2f 0a 09 6c 6f 6e 67 09 | 63 6e 74 3b 09 2f 2a 20 |/..long.|cnt;./* |
|00002960| 72 65 70 65 61 74 20 68 | 6f 77 20 6d 61 6e 79 20 |repeat h|ow many |
|00002970| 74 69 6d 65 73 3f 20 2a | 2f 0a 09 69 6e 74 09 6b |times? *|/..int.k|
|00002980| 65 79 3b 09 2f 2a 20 77 | 68 61 74 20 63 6f 6d 6d |ey;./* w|hat comm|
|00002990| 61 6e 64 20 69 73 20 74 | 68 69 73 20 66 6f 72 3f |and is t|his for?|
|000029a0| 20 7b 61 2c 41 2c 69 2c | 49 2c 6f 2c 4f 7d 20 2a | {a,A,i,|I,o,O} *|
|000029b0| 2f 0a 7b 0a 09 69 6e 74 | 09 77 61 73 64 6f 74 3b |/.{..int|.wasdot;|
|000029c0| 0a 09 6c 6f 6e 67 09 72 | 65 70 73 3b 0a 0a 09 44 |..long.r|eps;...D|
|000029d0| 45 46 41 55 4c 54 28 31 | 29 3b 0a 0a 09 43 68 61 |EFAULT(1|);...Cha|
|000029e0| 6e 67 65 54 65 78 74 0a | 09 7b 0a 09 09 2f 2a 20 |ngeText.|.{.../* |
|000029f0| 74 77 65 61 6b 20 74 68 | 65 20 69 6e 73 65 72 74 |tweak th|e insert|
|00002a00| 69 6f 6e 20 70 6f 69 6e | 74 2c 20 62 61 73 65 64 |ion poin|t, based|
|00002a10| 20 6f 6e 20 63 6f 6d 6d | 61 6e 64 20 6b 65 79 20 | on comm|and key |
|00002a20| 2a 2f 0a 09 09 73 77 69 | 74 63 68 20 28 6b 65 79 |*/...swi|tch (key|
|00002a30| 29 0a 09 09 7b 0a 09 09 | 20 20 63 61 73 65 20 27 |)...{...| case '|
|00002a40| 69 27 3a 0a 09 09 09 62 | 72 65 61 6b 3b 0a 0a 09 |i':....b|reak;...|
|00002a50| 09 20 20 63 61 73 65 20 | 27 61 27 3a 0a 09 09 09 |. case |'a':....|
|00002a60| 70 66 65 74 63 68 28 6d | 61 72 6b 6c 69 6e 65 28 |pfetch(m|arkline(|
|00002a70| 6d 29 29 3b 0a 09 09 09 | 69 66 20 28 70 6c 65 6e |m));....|if (plen|
|00002a80| 20 3e 20 30 29 0a 09 09 | 09 7b 0a 09 09 09 09 6d | > 0)...|.{.....m|
|00002a90| 2b 2b 3b 0a 09 09 09 7d | 0a 09 09 09 62 72 65 61 |++;....}|....brea|
|00002aa0| 6b 3b 0a 0a 09 09 20 20 | 63 61 73 65 20 27 49 27 |k;.... |case 'I'|
|00002ab0| 3a 0a 09 09 09 6d 20 3d | 20 6d 5f 66 72 6f 6e 74 |:....m =| m_front|
|00002ac0| 28 6d 2c 20 31 4c 29 3b | 0a 09 09 09 62 72 65 61 |(m, 1L);|....brea|
|00002ad0| 6b 3b 0a 0a 09 09 20 20 | 63 61 73 65 20 27 41 27 |k;.... |case 'A'|
|00002ae0| 3a 0a 09 09 09 70 66 65 | 74 63 68 28 6d 61 72 6b |:....pfe|tch(mark|
|00002af0| 6c 69 6e 65 28 6d 29 29 | 3b 0a 09 09 09 6d 20 3d |line(m))|;....m =|
|00002b00| 20 28 6d 20 26 20 7e 28 | 42 4c 4b 53 49 5a 45 20 | (m & ~(|BLKSIZE |
|00002b10| 2d 20 31 29 29 20 2b 20 | 70 6c 65 6e 3b 0a 09 09 |- 1)) + |plen;...|
|00002b20| 09 62 72 65 61 6b 3b 0a | 0a 09 09 20 20 63 61 73 |.break;.|... cas|
|00002b30| 65 20 27 4f 27 3a 0a 09 | 09 09 6d 20 26 3d 20 7e |e 'O':..|..m &= ~|
|00002b40| 28 42 4c 4b 53 49 5a 45 | 20 2d 20 31 29 3b 0a 09 |(BLKSIZE| - 1);..|
|00002b50| 09 09 61 64 64 28 6d 2c | 20 22 5c 6e 22 29 3b 0a |..add(m,| "\n");.|
|00002b60| 09 09 09 62 72 65 61 6b | 3b 0a 0a 09 09 20 20 63 |...break|;.... c|
|00002b70| 61 73 65 20 27 6f 27 3a | 0a 09 09 09 6d 20 3d 20 |ase 'o':|....m = |
|00002b80| 28 6d 20 26 20 7e 28 42 | 4c 4b 53 49 5a 45 20 2d |(m & ~(B|LKSIZE -|
|00002b90| 20 31 29 29 20 2b 20 42 | 4c 4b 53 49 5a 45 3b 0a | 1)) + B|LKSIZE;.|
|00002ba0| 09 09 09 61 64 64 28 6d | 2c 20 22 5c 6e 22 29 3b |...add(m|, "\n");|
|00002bb0| 0a 09 09 09 62 72 65 61 | 6b 3b 0a 09 09 7d 0a 0a |....brea|k;...}..|
|00002bc0| 09 09 2f 2a 20 69 6e 73 | 65 72 74 20 74 68 65 20 |../* ins|ert the |
|00002bd0| 73 61 6d 65 20 74 65 78 | 74 20 6f 6e 63 65 20 6f |same tex|t once o|
|00002be0| 72 20 6d 6f 72 65 20 2a | 2f 0a 09 09 66 6f 72 20 |r more *|/...for |
|00002bf0| 28 72 65 70 73 20 3d 20 | 63 6e 74 2c 20 77 61 73 |(reps = |cnt, was|
|00002c00| 64 6f 74 20 3d 20 64 6f | 69 6e 67 64 6f 74 3b 20 |dot = do|ingdot; |
|00002c10| 72 65 70 73 20 3e 20 30 | 3b 20 72 65 70 73 2d 2d |reps > 0|; reps--|
|00002c20| 2c 20 64 6f 69 6e 67 64 | 6f 74 20 3d 20 54 52 55 |, doingd|ot = TRU|
|00002c30| 45 29 0a 09 09 7b 0a 09 | 09 09 6d 20 3d 20 69 6e |E)...{..|..m = in|
|00002c40| 70 75 74 28 6d 2c 20 6d | 2c 20 57 48 45 4e 5f 56 |put(m, m|, WHEN_V|
|00002c50| 49 49 4e 50 29 3b 0a 09 | 09 7d 0a 0a 09 09 2f 2a |IINP);..|.}..../*|
|00002c60| 20 63 6f 6d 70 65 6e 73 | 61 74 65 20 66 6f 72 20 | compens|ate for |
|00002c70| 69 6e 61 63 63 75 72 61 | 74 65 20 72 65 64 72 61 |inaccura|te redra|
|00002c80| 77 20 63 6c 75 65 73 20 | 66 72 6f 6d 20 69 6e 70 |w clues |from inp|
|00002c90| 75 74 28 29 20 2a 2f 0a | 09 09 69 66 20 28 28 6b |ut() */.|..if ((k|
|00002ca0| 65 79 20 3d 3d 20 27 4f | 27 20 7c 7c 20 6b 65 79 |ey == 'O|' || key|
|00002cb0| 20 3d 3d 20 27 6f 27 29 | 20 26 26 20 77 61 73 64 | == 'o')| && wasd|
|00002cc0| 6f 74 29 0a 09 09 7b 0a | 09 09 09 72 65 64 72 61 |ot)...{.|...redra|
|00002cd0| 77 28 4d 41 52 4b 5f 55 | 4e 53 45 54 29 3b 0a 09 |w(MARK_U|NSET);..|
|00002ce0| 09 7d 0a 0a 09 09 64 6f | 69 6e 67 64 6f 74 20 3d |.}....do|ingdot =|
|00002cf0| 20 46 41 4c 53 45 3b 0a | 09 7d 0a 0a 09 72 65 74 | FALSE;.|.}...ret|
|00002d00| 75 72 6e 20 6d 3b 0a 7d | 0a 0a 2f 2a 20 54 68 69 |urn m;.}|../* Thi|
|00002d10| 73 20 73 74 61 72 74 73 | 20 69 6e 70 75 74 20 6d |s starts| input m|
|00002d20| 6f 64 65 20 77 69 74 68 | 20 73 6f 6d 65 20 74 65 |ode with| some te|
|00002d30| 78 74 20 64 65 6c 65 74 | 65 64 20 2a 2f 0a 4d 41 |xt delet|ed */.MA|
|00002d40| 52 4b 20 76 5f 63 68 61 | 6e 67 65 28 6d 2c 20 6e |RK v_cha|nge(m, n|
|00002d50| 29 0a 09 4d 41 52 4b 09 | 6d 2c 20 6e 3b 09 2f 2a |)..MARK.|m, n;./*|
|00002d60| 20 74 68 65 20 72 61 6e | 67 65 20 6f 66 20 74 65 | the ran|ge of te|
|00002d70| 78 74 20 74 6f 20 63 68 | 61 6e 67 65 20 2a 2f 0a |xt to ch|ange */.|
|00002d80| 7b 0a 09 69 6e 74 09 6c | 6e 6d 6f 64 65 3b 09 2f |{..int.l|nmode;./|
|00002d90| 2a 20 69 73 20 74 68 69 | 73 20 61 20 6c 69 6e 65 |* is thi|s a line|
|00002da0| 2d 6d 6f 64 65 20 63 68 | 61 6e 67 65 3f 20 2a 2f |-mode ch|ange? */|
|00002db0| 0a 0a 09 2f 2a 20 73 77 | 61 70 20 74 68 65 6d 20 |.../* sw|ap them |
|00002dc0| 69 66 20 74 68 65 79 27 | 72 65 20 69 6e 20 72 65 |if they'|re in re|
|00002dd0| 76 65 72 73 65 20 6f 72 | 64 65 72 20 2a 2f 0a 09 |verse or|der */..|
|00002de0| 69 66 20 28 6d 20 3e 20 | 6e 29 0a 09 7b 0a 09 09 |if (m > |n)..{...|
|00002df0| 4d 41 52 4b 09 74 6d 70 | 3b 0a 09 09 74 6d 70 20 |MARK.tmp|;...tmp |
|00002e00| 3d 20 6d 3b 0a 09 09 6d | 20 3d 20 6e 3b 0a 09 09 |= m;...m| = n;...|
|00002e10| 6e 20 3d 20 74 6d 70 3b | 0a 09 7d 0a 0a 09 2f 2a |n = tmp;|..}.../*|
|00002e20| 20 66 6f 72 20 6c 69 6e | 65 20 6d 6f 64 65 2c 20 | for lin|e mode, |
|00002e30| 72 65 74 61 69 6e 20 74 | 68 65 20 6c 61 73 74 20 |retain t|he last |
|00002e40| 6e 65 77 6c 69 6e 65 20 | 63 68 61 72 20 2a 2f 0a |newline |char */.|
|00002e50| 09 6c 6e 6d 6f 64 65 20 | 3d 20 28 6d 61 72 6b 69 |.lnmode |= (marki|
|00002e60| 64 78 28 6d 29 20 3d 3d | 20 30 20 26 26 20 6d 61 |dx(m) ==| 0 && ma|
|00002e70| 72 6b 69 64 78 28 6e 29 | 20 3d 3d 20 30 20 26 26 |rkidx(n)| == 0 &&|
|00002e80| 20 6d 20 21 3d 20 6e 29 | 3b 0a 09 69 66 20 28 6c | m != n)|;..if (l|
|00002e90| 6e 6d 6f 64 65 29 0a 09 | 7b 0a 09 09 6e 20 2d 3d |nmode)..|{...n -=|
|00002ea0| 20 42 4c 4b 53 49 5a 45 | 3b 0a 09 09 70 66 65 74 | BLKSIZE|;...pfet|
|00002eb0| 63 68 28 6d 61 72 6b 6c | 69 6e 65 28 6e 29 29 3b |ch(markl|ine(n));|
|00002ec0| 0a 09 09 6e 20 3d 20 28 | 6e 20 26 20 7e 28 42 4c |...n = (|n & ~(BL|
|00002ed0| 4b 53 49 5a 45 20 2d 20 | 31 29 29 20 2b 20 70 6c |KSIZE - |1)) + pl|
|00002ee0| 65 6e 3b 0a 09 7d 0a 0a | 09 43 68 61 6e 67 65 54 |en;..}..|.ChangeT|
|00002ef0| 65 78 74 0a 09 7b 0a 09 | 09 63 75 74 28 6d 2c 20 |ext..{..|.cut(m, |
|00002f00| 6e 29 3b 0a 09 09 6d 20 | 3d 20 69 6e 70 75 74 28 |n);...m |= input(|
|00002f10| 6d 2c 20 6e 2c 20 57 48 | 45 4e 5f 56 49 49 4e 50 |m, n, WH|EN_VIINP|
|00002f20| 29 3b 0a 09 7d 0a 0a 09 | 2f 2a 20 63 6f 6d 70 65 |);..}...|/* compe|
|00002f30| 6e 73 61 74 65 20 66 6f | 72 20 69 6e 61 63 63 75 |nsate fo|r inaccu|
|00002f40| 72 61 74 65 20 72 65 64 | 72 61 77 20 63 6c 75 65 |rate red|raw clue|
|00002f50| 73 20 66 72 6f 6d 20 70 | 61 73 74 65 28 29 20 2a |s from p|aste() *|
|00002f60| 2f 0a 09 69 66 20 28 64 | 6f 69 6e 67 64 6f 74 29 |/..if (d|oingdot)|
|00002f70| 0a 09 7b 0a 09 09 70 72 | 65 72 65 64 72 61 77 20 |..{...pr|eredraw |
|00002f80| 3d 20 6d 61 72 6b 6c 69 | 6e 65 28 6e 29 3b 0a 09 |= markli|ne(n);..|
|00002f90| 09 69 66 20 28 6c 6e 6d | 6f 64 65 29 0a 09 09 7b |.if (lnm|ode)...{|
|00002fa0| 0a 09 09 09 70 72 65 72 | 65 64 72 61 77 2b 2b 3b |....prer|edraw++;|
|00002fb0| 0a 09 09 09 70 6f 73 74 | 72 65 64 72 61 77 2b 2b |....post|redraw++|
|00002fc0| 3b 0a 09 09 7d 0a 09 7d | 0a 0a 09 72 65 74 75 72 |;...}..}|...retur|
|00002fd0| 6e 20 6d 3b 0a 7d 0a 0a | 2f 2a 20 54 68 69 73 20 |n m;.}..|/* This |
|00002fe0| 66 75 6e 63 74 69 6f 6e | 20 72 65 70 6c 61 63 65 |function| replace|
|00002ff0| 73 20 61 20 67 69 76 65 | 6e 20 6e 75 6d 62 65 72 |s a give|n number|
|00003000| 20 6f 66 20 63 68 61 72 | 61 63 74 65 72 73 20 77 | of char|acters w|
|00003010| 69 74 68 20 69 6e 70 75 | 74 20 2a 2f 0a 4d 41 52 |ith inpu|t */.MAR|
|00003020| 4b 20 76 5f 73 75 62 73 | 74 28 6d 2c 20 63 6e 74 |K v_subs|t(m, cnt|
|00003030| 29 0a 09 4d 41 52 4b 09 | 6d 3b 09 2f 2a 20 77 68 |)..MARK.|m;./* wh|
|00003040| 65 72 65 20 73 75 62 73 | 74 69 74 75 74 69 6f 6e |ere subs|titution|
|00003050| 73 20 73 74 61 72 74 20 | 2a 2f 0a 09 6c 6f 6e 67 |s start |*/..long|
|00003060| 09 63 6e 74 3b 09 2f 2a | 20 6e 75 6d 62 65 72 20 |.cnt;./*| number |
|00003070| 6f 66 20 63 68 61 72 73 | 20 74 6f 20 72 65 70 6c |of chars| to repl|
|00003080| 61 63 65 20 2a 2f 0a 7b | 0a 09 44 45 46 41 55 4c |ace */.{|..DEFAUL|
|00003090| 54 28 31 29 3b 0a 0a 09 | 2f 2a 20 6d 61 6b 65 20 |T(1);...|/* make |
|000030a0| 73 75 72 65 20 77 65 20 | 64 6f 6e 27 74 20 74 72 |sure we |don't tr|
|000030b0| 79 20 72 65 70 6c 61 63 | 69 6e 67 20 70 61 73 74 |y replac|ing past|
|000030c0| 20 45 4f 4c 20 2a 2f 0a | 09 70 66 65 74 63 68 28 | EOL */.|.pfetch(|
|000030d0| 6d 61 72 6b 6c 69 6e 65 | 28 6d 29 29 3b 0a 09 69 |markline|(m));..i|
|000030e0| 66 20 28 6d 61 72 6b 69 | 64 78 28 6d 29 20 2b 20 |f (marki|dx(m) + |
|000030f0| 63 6e 74 20 3e 20 70 6c | 65 6e 29 0a 09 7b 0a 09 |cnt > pl|en)..{..|
|00003100| 09 63 6e 74 20 3d 20 70 | 6c 65 6e 20 2d 20 6d 61 |.cnt = p|len - ma|
|00003110| 72 6b 69 64 78 28 6d 29 | 3b 0a 09 7d 0a 0a 09 2f |rkidx(m)|;..}.../|
|00003120| 2a 20 47 6f 20 66 6f 72 | 20 69 74 21 20 2a 2f 0a |* Go for| it! */.|
|00003130| 09 43 68 61 6e 67 65 54 | 65 78 74 0a 09 7b 0a 09 |.ChangeT|ext..{..|
|00003140| 09 63 75 74 28 6d 2c 20 | 6d 20 2b 20 63 6e 74 29 |.cut(m, |m + cnt)|
|00003150| 3b 0a 09 09 6d 20 3d 20 | 69 6e 70 75 74 28 6d 2c |;...m = |input(m,|
|00003160| 20 6d 20 2b 20 63 6e 74 | 2c 20 57 48 45 4e 5f 56 | m + cnt|, WHEN_V|
|00003170| 49 49 4e 50 29 3b 0a 09 | 7d 0a 09 72 65 74 75 72 |IINP);..|}..retur|
|00003180| 6e 20 6d 3b 0a 7d 0a 0a | 2f 2a 20 54 68 69 73 20 |n m;.}..|/* This |
|00003190| 63 61 6c 6c 73 20 74 68 | 65 20 65 78 20 22 6a 6f |calls th|e ex "jo|
|000031a0| 69 6e 22 20 63 6f 6d 6d | 61 6e 64 20 74 6f 20 6a |in" comm|and to j|
|000031b0| 6f 69 6e 20 73 6f 6d 65 | 20 6c 69 6e 65 73 20 74 |oin some| lines t|
|000031c0| 6f 67 65 74 68 65 72 20 | 2a 2f 0a 4d 41 52 4b 20 |ogether |*/.MARK |
|000031d0| 76 5f 6a 6f 69 6e 28 6d | 2c 20 63 6e 74 29 0a 09 |v_join(m|, cnt)..|
|000031e0| 4d 41 52 4b 09 6d 3b 09 | 2f 2a 20 74 68 65 20 66 |MARK.m;.|/* the f|
|000031f0| 69 72 73 74 20 6c 69 6e | 65 20 74 6f 20 62 65 20 |irst lin|e to be |
|00003200| 6a 6f 69 6e 65 64 20 2a | 2f 0a 09 6c 6f 6e 67 09 |joined *|/..long.|
|00003210| 63 6e 74 3b 09 2f 2a 20 | 6e 75 6d 62 65 72 20 6f |cnt;./* |number o|
|00003220| 66 20 6f 74 68 65 72 20 | 6c 69 6e 65 73 20 74 6f |f other |lines to|
|00003230| 20 6a 6f 69 6e 20 2a 2f | 0a 7b 0a 09 4d 41 52 4b | join */|.{..MARK|
|00003240| 09 6a 6f 69 6e 74 3b 09 | 2f 2a 20 77 68 65 72 65 |.joint;.|/* where|
|00003250| 20 74 68 65 20 6c 69 6e | 65 73 20 77 65 72 65 20 | the lin|es were |
|00003260| 6a 6f 69 6e 65 64 20 2a | 2f 0a 0a 09 44 45 46 41 |joined *|/...DEFA|
|00003270| 55 4c 54 28 31 29 3b 0a | 0a 09 2f 2a 20 66 69 67 |ULT(1);.|../* fig|
|00003280| 75 72 65 20 6f 75 74 20 | 77 68 65 72 65 20 74 68 |ure out |where th|
|00003290| 65 20 6a 6f 69 6e 74 20 | 77 69 6c 6c 20 62 65 20 |e joint |will be |
|000032a0| 2a 2f 0a 09 70 66 65 74 | 63 68 28 6d 61 72 6b 6c |*/..pfet|ch(markl|
|000032b0| 69 6e 65 28 6d 29 29 3b | 0a 09 6a 6f 69 6e 74 20 |ine(m));|..joint |
|000032c0| 3d 20 28 6d 20 26 20 7e | 28 42 4c 4b 53 49 5a 45 |= (m & ~|(BLKSIZE|
|000032d0| 20 2d 20 31 29 29 20 2b | 20 70 6c 65 6e 3b 0a 0a | - 1)) +| plen;..|
|000032e0| 09 2f 2a 20 6a 6f 69 6e | 20 74 68 65 20 6c 69 6e |./* join| the lin|
|000032f0| 65 73 20 2a 2f 0a 09 63 | 6d 64 5f 6a 6f 69 6e 28 |es */..c|md_join(|
|00003300| 6d 2c 20 6d 20 2b 20 4d | 41 52 4b 5f 41 54 5f 4c |m, m + M|ARK_AT_L|
|00003310| 49 4e 45 28 63 6e 74 29 | 2c 20 43 4d 44 5f 4a 4f |INE(cnt)|, CMD_JO|
|00003320| 49 4e 2c 20 30 2c 20 22 | 22 29 3b 0a 09 6d 75 73 |IN, 0, "|");..mus|
|00003330| 74 72 65 64 72 61 77 20 | 3d 20 54 52 55 45 3b 0a |tredraw |= TRUE;.|
|00003340| 0a 09 2f 2a 20 74 68 65 | 20 63 75 72 73 6f 72 20 |../* the| cursor |
|00003350| 73 68 6f 75 6c 64 20 62 | 65 20 6c 65 66 74 20 61 |should b|e left a|
|00003360| 74 20 74 68 65 20 6a 6f | 69 6e 74 20 2a 2f 0a 09 |t the jo|int */..|
|00003370| 72 65 74 75 72 6e 20 6a | 6f 69 6e 74 3b 0a 7d 0a |return j|oint;.}.|
|00003380| 0a 2f 2a 20 54 68 69 73 | 20 63 61 6c 6c 73 20 74 |./* This| calls t|
|00003390| 68 65 20 65 78 20 73 68 | 69 66 74 65 72 20 63 6f |he ex sh|ifter co|
|000033a0| 6d 6d 61 6e 64 20 74 6f | 20 73 68 69 66 74 20 73 |mmand to| shift s|
|000033b0| 6f 6d 65 20 6c 69 6e 65 | 73 20 2a 2f 0a 73 74 61 |ome line|s */.sta|
|000033c0| 74 69 63 20 4d 41 52 4b | 20 73 68 69 66 74 5f 68 |tic MARK| shift_h|
|000033d0| 65 6c 70 28 6d 2c 20 6e | 2c 20 65 78 63 6d 64 29 |elp(m, n|, excmd)|
|000033e0| 0a 09 4d 41 52 4b 09 6d | 2c 20 6e 3b 09 2f 2a 20 |..MARK.m|, n;./* |
|000033f0| 72 61 6e 67 65 20 6f 66 | 20 6c 69 6e 65 73 20 74 |range of| lines t|
|00003400| 6f 20 73 68 69 66 74 20 | 2a 2f 0a 09 43 4d 44 09 |o shift |*/..CMD.|
|00003410| 65 78 63 6d 64 3b 09 2f | 2a 20 77 68 69 63 68 20 |excmd;./|* which |
|00003420| 77 61 79 20 64 6f 20 77 | 65 20 73 68 69 66 74 3f |way do w|e shift?|
|00003430| 20 2a 2f 0a 7b 0a 09 2f | 2a 20 6d 61 6b 65 20 73 | */.{../|* make s|
|00003440| 75 72 65 20 6f 75 72 20 | 65 6e 64 70 6f 69 6e 74 |ure our |endpoint|
|00003450| 73 20 61 72 65 6e 27 74 | 20 69 6e 20 72 65 76 65 |s aren't| in reve|
|00003460| 72 73 65 20 6f 72 64 65 | 72 20 2a 2f 0a 09 69 66 |rse orde|r */..if|
|00003470| 20 28 6d 20 3e 20 6e 29 | 0a 09 7b 0a 09 09 4d 41 | (m > n)|..{...MA|
|00003480| 52 4b 20 74 6d 70 3b 0a | 0a 09 09 74 6d 70 20 3d |RK tmp;.|...tmp =|
|00003490| 20 6e 3b 0a 09 09 6e 20 | 3d 20 6d 3b 0a 09 09 6d | n;...n |= m;...m|
|000034a0| 20 3d 20 74 6d 70 3b 0a | 09 7d 0a 0a 09 2f 2a 20 | = tmp;.|.}.../* |
|000034b0| 6c 69 6e 65 6d 6f 64 65 | 3f 20 61 64 6a 75 73 74 |linemode|? adjust|
|000034c0| 20 66 6f 72 20 69 6e 63 | 6c 75 73 69 76 65 20 65 | for inc|lusive e|
|000034d0| 6e 64 6d 61 72 6b 73 20 | 69 6e 20 65 78 20 2a 2f |ndmarks |in ex */|
|000034e0| 0a 09 69 66 20 28 6d 61 | 72 6b 69 64 78 28 6d 29 |..if (ma|rkidx(m)|
|000034f0| 20 3d 3d 20 30 20 26 26 | 20 6d 61 72 6b 69 64 78 | == 0 &&| markidx|
|00003500| 28 6e 29 20 3d 3d 20 30 | 29 0a 09 7b 0a 09 09 6e |(n) == 0|)..{...n|
|00003510| 20 2d 3d 20 42 4c 4b 53 | 49 5a 45 3b 0a 09 7d 0a | -= BLKS|IZE;..}.|
|00003520| 0a 09 63 6d 64 5f 73 68 | 69 66 74 28 6d 2c 20 6e |..cmd_sh|ift(m, n|
|00003530| 2c 20 65 78 63 6d 64 2c | 20 30 2c 20 22 22 29 3b |, excmd,| 0, "");|
|00003540| 0a 09 72 65 74 75 72 6e | 20 6d 3b 0a 7d 0a 0a 2f |..return| m;.}../|
|00003550| 2a 20 54 68 69 73 20 63 | 61 6c 6c 73 20 74 68 65 |* This c|alls the|
|00003560| 20 65 78 20 22 3c 22 20 | 63 6f 6d 6d 61 6e 64 20 | ex "<" |command |
|00003570| 74 6f 20 73 68 69 66 74 | 20 73 6f 6d 65 20 6c 69 |to shift| some li|
|00003580| 6e 65 73 20 6c 65 66 74 | 20 2a 2f 0a 4d 41 52 4b |nes left| */.MARK|
|00003590| 20 76 5f 6c 73 68 69 66 | 74 28 6d 2c 20 6e 29 0a | v_lshif|t(m, n).|
|000035a0| 09 4d 41 52 4b 09 6d 2c | 20 6e 3b 09 2f 2a 20 72 |.MARK.m,| n;./* r|
|000035b0| 61 6e 67 65 20 6f 66 20 | 6c 69 6e 65 73 20 74 6f |ange of |lines to|
|000035c0| 20 73 68 69 66 74 20 2a | 2f 0a 7b 0a 09 72 65 74 | shift *|/.{..ret|
|000035d0| 75 72 6e 20 73 68 69 66 | 74 5f 68 65 6c 70 28 6d |urn shif|t_help(m|
|000035e0| 2c 20 6e 2c 20 43 4d 44 | 5f 53 48 49 46 54 4c 29 |, n, CMD|_SHIFTL)|
|000035f0| 3b 0a 7d 0a 0a 2f 2a 20 | 54 68 69 73 20 63 61 6c |;.}../* |This cal|
|00003600| 6c 73 20 74 68 65 20 65 | 78 20 22 3e 22 20 63 6f |ls the e|x ">" co|
|00003610| 6d 6d 61 6e 64 20 74 6f | 20 73 68 69 66 74 20 73 |mmand to| shift s|
|00003620| 6f 6d 65 20 6c 69 6e 65 | 73 20 72 69 67 68 74 20 |ome line|s right |
|00003630| 2a 2f 0a 4d 41 52 4b 20 | 76 5f 72 73 68 69 66 74 |*/.MARK |v_rshift|
|00003640| 28 6d 2c 20 6e 29 0a 09 | 4d 41 52 4b 09 6d 2c 20 |(m, n)..|MARK.m, |
|00003650| 6e 3b 09 2f 2a 20 72 61 | 6e 67 65 20 6f 66 20 6c |n;./* ra|nge of l|
|00003660| 69 6e 65 73 20 74 6f 20 | 73 68 69 66 74 20 2a 2f |ines to |shift */|
|00003670| 0a 7b 0a 09 72 65 74 75 | 72 6e 20 73 68 69 66 74 |.{..retu|rn shift|
|00003680| 5f 68 65 6c 70 28 6d 2c | 20 6e 2c 20 43 4d 44 5f |_help(m,| n, CMD_|
|00003690| 53 48 49 46 54 52 29 3b | 0a 7d 0a 0a 2f 2a 20 54 |SHIFTR);|.}../* T|
|000036a0| 68 69 73 20 72 75 6e 73 | 20 73 6f 6d 65 20 6c 69 |his runs| some li|
|000036b0| 6e 65 73 20 74 68 72 6f | 75 67 68 20 61 20 66 69 |nes thro|ugh a fi|
|000036c0| 6c 74 65 72 20 70 72 6f | 67 72 61 6d 20 2a 2f 0a |lter pro|gram */.|
|000036d0| 4d 41 52 4b 20 76 5f 66 | 69 6c 74 65 72 28 6d 2c |MARK v_f|ilter(m,|
|000036e0| 20 6e 29 0a 09 4d 41 52 | 4b 09 6d 2c 20 6e 3b 09 | n)..MAR|K.m, n;.|
|000036f0| 2f 2a 20 72 61 6e 67 65 | 20 6f 66 20 6c 69 6e 65 |/* range| of line|
|00003700| 73 20 74 6f 20 73 68 69 | 66 74 20 2a 2f 0a 7b 0a |s to shi|ft */.{.|
|00003710| 09 63 68 61 72 09 63 6d | 64 6c 6e 5b 31 30 30 5d |.char.cm|dln[100]|
|00003720| 3b 09 2f 2a 20 61 20 73 | 68 65 6c 6c 20 63 6f 6d |;./* a s|hell com|
|00003730| 6d 61 6e 64 20 6c 69 6e | 65 20 2a 2f 0a 0a 09 2f |mand lin|e */.../|
|00003740| 2a 20 6c 69 6e 65 6d 6f | 64 65 3f 20 61 64 6a 75 |* linemo|de? adju|
|00003750| 73 74 20 66 6f 72 20 69 | 6e 63 6c 75 73 69 76 65 |st for i|nclusive|
|00003760| 20 65 6e 64 6d 61 72 6b | 73 20 69 6e 20 65 78 20 | endmark|s in ex |
|00003770| 2a 2f 0a 09 69 66 20 28 | 6d 61 72 6b 69 64 78 28 |*/..if (|markidx(|
|00003780| 6d 29 20 3d 3d 20 30 20 | 26 26 20 6d 61 72 6b 69 |m) == 0 |&& marki|
|00003790| 64 78 28 6e 29 20 3d 3d | 20 30 29 0a 09 7b 0a 09 |dx(n) ==| 0)..{..|
|000037a0| 09 6e 20 2d 3d 20 42 4c | 4b 53 49 5a 45 3b 0a 09 |.n -= BL|KSIZE;..|
|000037b0| 7d 0a 0a 09 69 66 20 28 | 76 67 65 74 73 28 27 21 |}...if (|vgets('!|
|000037c0| 27 2c 20 63 6d 64 6c 6e | 2c 20 73 69 7a 65 6f 66 |', cmdln|, sizeof|
|000037d0| 28 63 6d 64 6c 6e 29 29 | 20 3e 20 30 29 0a 09 7b |(cmdln))| > 0)..{|
|000037e0| 0a 09 09 66 69 6c 74 65 | 72 28 6d 2c 20 6e 2c 20 |...filte|r(m, n, |
|000037f0| 63 6d 64 6c 6e 29 3b 0a | 09 7d 0a 0a 09 72 65 64 |cmdln);.|.}...red|
|00003800| 72 61 77 28 4d 41 52 4b | 5f 55 4e 53 45 54 2c 20 |raw(MARK|_UNSET, |
|00003810| 46 41 4c 53 45 29 3b 0a | 09 72 65 74 75 72 6e 20 |FALSE);.|.return |
|00003820| 6d 3b 0a 7d 0a 0a 0a 2f | 2a 20 54 68 69 73 20 66 |m;.}.../|* This f|
|00003830| 75 6e 63 74 69 6f 6e 20 | 72 75 6e 73 20 74 68 65 |unction |runs the|
|00003840| 20 65 78 20 22 66 69 6c | 65 22 20 63 6f 6d 6d 61 | ex "fil|e" comma|
|00003850| 6e 64 20 74 6f 20 73 68 | 6f 77 20 74 68 65 20 66 |nd to sh|ow the f|
|00003860| 69 6c 65 27 73 20 73 74 | 61 74 75 73 20 2a 2f 0a |ile's st|atus */.|
|00003870| 4d 41 52 4b 20 76 5f 73 | 74 61 74 75 73 28 29 0a |MARK v_s|tatus().|
|00003880| 7b 0a 09 63 6d 64 5f 66 | 69 6c 65 28 63 75 72 73 |{..cmd_f|ile(curs|
|00003890| 6f 72 2c 20 63 75 72 73 | 6f 72 2c 20 43 4d 44 5f |or, curs|or, CMD_|
|000038a0| 46 49 4c 45 2c 20 30 2c | 20 22 22 29 3b 0a 09 72 |FILE, 0,| "");..r|
|000038b0| 65 74 75 72 6e 20 63 75 | 72 73 6f 72 3b 0a 7d 0a |eturn cu|rsor;.}.|
|000038c0| 0a 2f 2a 20 54 68 69 73 | 20 66 75 6e 63 74 69 6f |./* This| functio|
|000038d0| 6e 20 73 77 69 74 63 68 | 65 73 20 74 6f 20 74 68 |n switch|es to th|
|000038e0| 65 20 70 72 65 76 69 6f | 75 73 20 66 69 6c 65 2c |e previo|us file,|
|000038f0| 20 69 66 20 70 6f 73 73 | 69 62 6c 65 20 2a 2f 0a | if poss|ible */.|
|00003900| 4d 41 52 4b 20 76 5f 73 | 77 69 74 63 68 28 29 0a |MARK v_s|witch().|
|00003910| 7b 0a 09 69 66 20 28 21 | 2a 70 72 65 76 6f 72 69 |{..if (!|*prevori|
|00003920| 67 29 0a 09 09 6d 73 67 | 28 22 4e 6f 20 70 72 65 |g)...msg|("No pre|
|00003930| 76 69 6f 75 73 20 66 69 | 6c 65 22 29 3b 0a 09 65 |vious fi|le");..e|
|00003940| 6c 73 65 0a 09 7b 09 73 | 74 72 63 70 79 28 74 6d |lse..{.s|trcpy(tm|
|00003950| 70 62 6c 6b 2e 63 2c 20 | 70 72 65 76 6f 72 69 67 |pblk.c, |prevorig|
|00003960| 29 3b 0a 09 09 63 6d 64 | 5f 65 64 69 74 28 63 75 |);...cmd|_edit(cu|
|00003970| 72 73 6f 72 2c 20 63 75 | 72 73 6f 72 2c 20 43 4d |rsor, cu|rsor, CM|
|00003980| 44 5f 45 44 49 54 2c 20 | 30 2c 20 74 6d 70 62 6c |D_EDIT, |0, tmpbl|
|00003990| 6b 2e 63 29 3b 0a 09 7d | 0a 09 72 65 74 75 72 6e |k.c);..}|..return|
|000039a0| 20 63 75 72 73 6f 72 3b | 0a 7d 0a 0a 2f 2a 20 54 | cursor;|.}../* T|
|000039b0| 68 69 73 20 66 75 6e 63 | 74 69 6f 6e 20 64 6f 65 |his func|tion doe|
|000039c0| 73 20 61 20 74 61 67 20 | 73 65 61 72 63 68 20 6f |s a tag |search o|
|000039d0| 6e 20 61 20 6b 65 79 77 | 6f 72 64 20 2a 2f 0a 2f |n a keyw|ord */./|
|000039e0| 2a 41 52 47 53 55 53 45 | 44 2a 2f 0a 4d 41 52 4b |*ARGSUSE|D*/.MARK|
|000039f0| 20 76 5f 74 61 67 28 6b | 65 79 77 6f 72 64 2c 20 | v_tag(k|eyword, |
|00003a00| 6d 2c 20 63 6e 74 29 0a | 09 63 68 61 72 09 2a 6b |m, cnt).|.char.*k|
|00003a10| 65 79 77 6f 72 64 3b 0a | 09 4d 41 52 4b 09 6d 3b |eyword;.|.MARK.m;|
|00003a20| 0a 09 6c 6f 6e 67 09 63 | 6e 74 3b 0a 7b 0a 09 2f |..long.c|nt;.{../|
|00003a30| 2a 20 72 65 6d 65 6d 62 | 65 72 20 74 68 65 20 69 |* rememb|er the i|
|00003a40| 6e 69 74 69 61 6c 20 63 | 68 61 6e 67 65 20 6c 65 |nitial c|hange le|
|00003a50| 76 65 6c 20 2a 2f 0a 09 | 63 6e 74 20 3d 20 63 68 |vel */..|cnt = ch|
|00003a60| 61 6e 67 65 73 3b 0a 0a | 09 2f 2a 20 6d 6f 76 65 |anges;..|./* move|
|00003a70| 20 74 68 65 20 63 75 72 | 73 6f 72 20 74 6f 20 74 | the cur|sor to t|
|00003a80| 68 65 20 73 74 61 72 74 | 20 6f 66 20 74 68 65 20 |he start| of the |
|00003a90| 74 61 67 20 6e 61 6d 65 | 2c 20 77 68 65 72 65 20 |tag name|, where |
|00003aa0| 6d 20 69 73 20 2a 2f 0a | 09 63 75 72 73 6f 72 20 |m is */.|.cursor |
|00003ab0| 3d 20 6d 3b 0a 0a 09 2f | 2a 20 70 65 72 66 6f 72 |= m;.../|* perfor|
|00003ac0| 6d 20 74 68 65 20 74 61 | 67 20 73 65 61 72 63 68 |m the ta|g search|
|00003ad0| 20 2a 2f 0a 09 63 6d 64 | 5f 74 61 67 28 63 75 72 | */..cmd|_tag(cur|
|00003ae0| 73 6f 72 2c 20 63 75 72 | 73 6f 72 2c 20 43 4d 44 |sor, cur|sor, CMD|
|00003af0| 5f 54 41 47 2c 20 30 2c | 20 6b 65 79 77 6f 72 64 |_TAG, 0,| keyword|
|00003b00| 29 3b 0a 0a 09 72 65 74 | 75 72 6e 20 63 75 72 73 |);...ret|urn curs|
|00003b10| 6f 72 3b 0a 7d 0a 0a 23 | 69 66 6e 64 65 66 20 4e |or;.}..#|ifndef N|
|00003b20| 4f 5f 45 58 54 45 4e 53 | 49 4f 4e 53 0a 2f 2a 20 |O_EXTENS|IONS./* |
|00003b30| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 6c 6f |This fun|ction lo|
|00003b40| 6f 6b 73 20 75 70 20 61 | 20 6b 65 79 77 6f 72 64 |oks up a| keyword|
|00003b50| 20 62 79 20 63 61 6c 6c | 69 6e 67 20 74 68 65 20 | by call|ing the |
|00003b60| 68 65 6c 70 70 72 6f 67 | 20 70 72 6f 67 72 61 6d |helpprog| program|
|00003b70| 20 2a 2f 0a 2f 2a 41 52 | 47 53 55 53 45 44 2a 2f | */./*AR|GSUSED*/|
|00003b80| 0a 4d 41 52 4b 20 76 5f | 6b 65 79 77 6f 72 64 28 |.MARK v_|keyword(|
|00003b90| 6b 65 79 77 6f 72 64 2c | 20 6d 2c 20 63 6e 74 29 |keyword,| m, cnt)|
|00003ba0| 0a 09 63 68 61 72 09 2a | 6b 65 79 77 6f 72 64 3b |..char.*|keyword;|
|00003bb0| 0a 09 4d 41 52 4b 09 6d | 3b 0a 09 6c 6f 6e 67 09 |..MARK.m|;..long.|
|00003bc0| 63 6e 74 3b 0a 7b 0a 09 | 69 6e 74 09 73 74 61 74 |cnt;.{..|int.stat|
|00003bd0| 75 73 3b 0a 23 69 66 09 | 54 4f 53 0a 09 63 68 61 |us;.#if.|TOS..cha|
|00003be0| 72 20 63 6d 64 6c 69 6e | 65 5b 31 33 30 5d 3b 0a |r cmdlin|e[130];.|
|00003bf0| 23 65 6e 64 69 66 0a 0a | 09 6d 6f 76 65 28 4c 49 |#endif..|.move(LI|
|00003c00| 4e 45 53 20 2d 20 31 2c | 20 30 29 3b 0a 09 61 64 |NES - 1,| 0);..ad|
|00003c10| 64 73 74 72 28 22 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |dstr("--|--------|
|00003c20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003c30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00003c40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 5c |--------|-------\|
|00003c50| 6e 22 29 3b 0a 09 63 6c | 72 74 6f 65 6f 6c 28 29 |n");..cl|rtoeol()|
|00003c60| 3b 0a 09 72 65 66 72 65 | 73 68 28 29 3b 0a 09 73 |;..refre|sh();..s|
|00003c70| 75 73 70 65 6e 64 5f 63 | 75 72 73 65 73 28 29 3b |uspend_c|urses();|
|00003c80| 0a 0a 23 69 66 09 41 4e | 59 5f 55 4e 49 58 0a 0a |..#if.AN|Y_UNIX..|
|00003c90| 09 73 77 69 74 63 68 20 | 28 66 6f 72 6b 28 29 29 |.switch |(fork())|
|00003ca0| 0a 09 7b 0a 09 20 20 63 | 61 73 65 20 2d 31 3a 09 |..{.. c|ase -1:.|
|00003cb0| 09 09 09 09 09 2f 2a 20 | 65 72 72 6f 72 20 2a 2f |...../* |error */|
|00003cc0| 0a 09 09 62 72 65 61 6b | 3b 0a 0a 09 20 20 63 61 |...break|;... ca|
|00003cd0| 73 65 20 30 3a 09 09 09 | 09 09 09 2f 2a 20 63 68 |se 0:...|.../* ch|
|00003ce0| 69 6c 64 20 2a 2f 0a 09 | 09 65 78 65 63 6c 28 6f |ild */..|.execl(o|
|00003cf0| 5f 6b 65 79 77 6f 72 64 | 70 72 67 2c 20 6f 5f 6b |_keyword|prg, o_k|
|00003d00| 65 79 77 6f 72 64 70 72 | 67 2c 20 6b 65 79 77 6f |eywordpr|g, keywo|
|00003d10| 72 64 2c 20 28 63 68 61 | 72 20 2a 29 30 29 3b 0a |rd, (cha|r *)0);.|
|00003d20| 09 09 65 78 69 74 28 32 | 29 3b 20 2f 2a 20 69 66 |..exit(2|); /* if|
|00003d30| 20 77 65 20 67 65 74 20 | 68 65 72 65 2c 20 74 68 | we get |here, th|
|00003d40| 65 20 65 78 65 63 20 66 | 61 69 6c 65 64 20 2a 2f |e exec f|ailed */|
|00003d50| 0a 0a 09 20 20 64 65 66 | 61 75 6c 74 3a 09 09 09 |... def|ault:...|
|00003d60| 09 09 09 2f 2a 20 70 61 | 72 65 6e 74 20 2a 2f 0a |.../* pa|rent */.|
|00003d70| 09 09 77 61 69 74 28 26 | 73 74 61 74 75 73 29 3b |..wait(&|status);|
|00003d80| 0a 09 09 69 66 20 28 73 | 74 61 74 75 73 20 3e 20 |...if (s|tatus > |
|00003d90| 30 29 0a 09 09 7b 0a 09 | 09 09 77 72 69 74 65 28 |0)...{..|..write(|
|00003da0| 32 2c 20 22 3c 3c 3c 20 | 66 61 69 6c 65 64 20 3e |2, "<<< |failed >|
|00003db0| 3e 3e 5c 6e 22 2c 20 31 | 35 29 3b 0a 09 09 7d 0a |>>\n", 1|5);...}.|
|00003dc0| 09 7d 0a 0a 23 65 6e 64 | 69 66 0a 23 69 66 09 4d |.}..#end|if.#if.M|
|00003dd0| 53 44 4f 53 0a 09 69 66 | 20 28 28 73 74 61 74 75 |SDOS..if| ((statu|
|00003de0| 73 3d 73 70 61 77 6e 6c | 70 28 50 5f 57 41 49 54 |s=spawnl|p(P_WAIT|
|00003df0| 2c 20 6f 5f 6b 65 79 77 | 6f 72 64 70 72 67 2c 20 |, o_keyw|ordprg, |
|00003e00| 6f 5f 6b 65 79 77 6f 72 | 64 70 72 67 2c 20 6b 65 |o_keywor|dprg, ke|
|00003e10| 79 77 6f 72 64 2c 0a 09 | 09 09 09 09 09 28 63 68 |yword,..|.....(ch|
|00003e20| 61 72 20 2a 29 30 29 29 | 3d 3d 2d 31 29 0a 09 09 |ar *)0))|==-1)...|
|00003e30| 77 72 69 74 65 28 32 2c | 20 22 3c 3c 3c 20 66 61 |write(2,| "<<< fa|
|00003e40| 69 6c 65 64 20 3e 3e 3e | 5c 6e 22 2c 20 31 35 29 |iled >>>|\n", 15)|
|00003e50| 3b 0a 23 65 6e 64 69 66 | 0a 23 69 66 09 54 4f 53 |;.#endif|.#if.TOS|
|00003e60| 0a 09 73 74 72 63 70 79 | 28 63 6d 64 6c 69 6e 65 |..strcpy|(cmdline|
|00003e70| 2b 31 2c 20 6b 65 79 77 | 6f 72 64 29 3b 0a 09 63 |+1, keyw|ord);..c|
|00003e80| 6d 64 6c 69 6e 65 5b 30 | 5d 3d 73 74 72 6c 65 6e |mdline[0|]=strlen|
|00003e90| 28 6b 65 79 77 6f 72 64 | 29 3b 0a 09 69 66 20 28 |(keyword|);..if (|
|00003ea0| 28 73 74 61 74 75 73 3d | 50 65 78 65 63 28 30 2c |(status=|Pexec(0,|
|00003eb0| 20 6f 5f 6b 65 79 77 6f | 72 64 70 72 67 2c 20 63 | o_keywo|rdprg, c|
|00003ec0| 6d 64 6c 69 6e 65 2c 20 | 22 5c 30 22 29 29 3c 30 |mdline, |"\0"))<0|
|00003ed0| 29 0a 09 09 77 72 69 74 | 65 28 32 2c 20 22 3c 3c |)...writ|e(2, "<<|
|00003ee0| 3c 20 66 61 69 6c 65 64 | 20 3e 3e 3e 5c 6e 22 2c |< failed| >>>\n",|
|00003ef0| 20 31 35 29 3b 0a 23 65 | 6e 64 69 66 0a 0a 09 72 | 15);.#e|ndif...r|
|00003f00| 65 73 75 6d 65 5f 63 75 | 72 73 65 73 28 46 41 4c |esume_cu|rses(FAL|
|00003f10| 53 45 29 3b 20 2f 2a 20 | 22 72 65 73 75 6d 65 2c |SE); /* |"resume,|
|00003f20| 20 62 75 74 20 6e 6f 74 | 20 71 75 69 65 74 6c 79 | but not| quietly|
|00003f30| 22 20 2a 2f 0a 09 72 65 | 64 72 61 77 28 4d 41 52 |" */..re|draw(MAR|
|00003f40| 4b 5f 55 4e 53 45 54 2c | 20 46 41 4c 53 45 29 3b |K_UNSET,| FALSE);|
|00003f50| 0a 09 72 65 74 75 72 6e | 20 6d 3b 0a 7d 0a 0a 0a |..return| m;.}...|
|00003f60| 0a 4d 41 52 4b 20 76 5f | 69 6e 63 72 65 6d 65 6e |.MARK v_|incremen|
|00003f70| 74 28 6b 65 79 77 6f 72 | 64 2c 20 6d 2c 20 63 6e |t(keywor|d, m, cn|
|00003f80| 74 29 0a 09 63 68 61 72 | 09 2a 6b 65 79 77 6f 72 |t)..char|.*keywor|
|00003f90| 64 3b 0a 09 4d 41 52 4b | 09 6d 3b 0a 09 6c 6f 6e |d;..MARK|.m;..lon|
|00003fa0| 67 09 63 6e 74 3b 0a 7b | 0a 09 73 74 61 74 69 63 |g.cnt;.{|..static|
|00003fb0| 09 73 69 67 6e 3b 0a 09 | 63 68 61 72 09 6e 65 77 |.sign;..|char.new|
|00003fc0| 76 61 6c 5b 31 32 5d 3b | 0a 09 6c 6f 6e 67 09 61 |val[12];|..long.a|
|00003fd0| 74 6f 6c 28 29 3b 0a 0a | 09 44 45 46 41 55 4c 54 |tol();..|.DEFAULT|
|00003fe0| 28 31 29 3b 0a 0a 09 2f | 2a 20 67 65 74 20 6f 6e |(1);.../|* get on|
|00003ff0| 65 20 6d 6f 72 65 20 6b | 65 79 73 74 72 6f 6b 65 |e more k|eystroke|
|00004000| 2c 20 75 6e 6c 65 73 73 | 20 64 6f 69 6e 67 64 6f |, unless| doingdo|
|00004010| 74 20 2a 2f 0a 09 69 66 | 20 28 21 64 6f 69 6e 67 |t */..if| (!doing|
|00004020| 64 6f 74 29 0a 09 7b 0a | 09 09 73 69 67 6e 20 3d |dot)..{.|..sign =|
|00004030| 20 67 65 74 6b 65 79 28 | 30 29 3b 0a 09 7d 0a 0a | getkey(|0);..}..|
|00004040| 09 2f 2a 20 61 64 6a 75 | 73 74 20 74 68 65 20 6e |./* adju|st the n|
|00004050| 75 6d 62 65 72 2c 20 62 | 61 73 65 64 20 6f 6e 20 |umber, b|ased on |
|00004060| 74 68 61 74 20 73 65 63 | 6f 6e 64 20 6b 65 79 73 |that sec|ond keys|
|00004070| 74 72 6f 6b 65 20 2a 2f | 0a 09 73 77 69 74 63 68 |troke */|..switch|
|00004080| 20 28 73 69 67 6e 29 0a | 09 7b 0a 09 20 20 63 61 | (sign).|.{.. ca|
|00004090| 73 65 20 27 2b 27 3a 0a | 09 20 20 63 61 73 65 20 |se '+':.|. case |
|000040a0| 27 23 27 3a 0a 09 09 63 | 6e 74 20 3d 20 61 74 6f |'#':...c|nt = ato|
|000040b0| 6c 28 6b 65 79 77 6f 72 | 64 29 20 2b 20 63 6e 74 |l(keywor|d) + cnt|
|000040c0| 3b 0a 09 09 62 72 65 61 | 6b 3b 0a 0a 09 20 20 63 |;...brea|k;... c|
|000040d0| 61 73 65 20 27 2d 27 3a | 0a 09 09 63 6e 74 20 3d |ase '-':|...cnt =|
|000040e0| 20 61 74 6f 6c 28 6b 65 | 79 77 6f 72 64 29 20 2d | atol(ke|yword) -|
|000040f0| 20 63 6e 74 3b 0a 09 09 | 62 72 65 61 6b 3b 0a 0a | cnt;...|break;..|
|00004100| 09 20 20 63 61 73 65 20 | 27 3d 27 3a 0a 09 09 62 |. case |'=':...b|
|00004110| 72 65 61 6b 3b 0a 0a 09 | 20 20 64 65 66 61 75 6c |reak;...| defaul|
|00004120| 74 3a 0a 09 09 72 65 74 | 75 72 6e 20 4d 41 52 4b |t:...ret|urn MARK|
|00004130| 5f 55 4e 53 45 54 3b 0a | 09 7d 0a 09 73 70 72 69 |_UNSET;.|.}..spri|
|00004140| 6e 74 66 28 6e 65 77 76 | 61 6c 2c 20 22 25 6c 64 |ntf(newv|al, "%ld|
|00004150| 22 2c 20 63 6e 74 29 3b | 0a 0a 09 43 68 61 6e 67 |", cnt);|...Chang|
|00004160| 65 54 65 78 74 0a 09 7b | 0a 09 09 63 68 61 6e 67 |eText..{|...chang|
|00004170| 65 28 6d 2c 20 6d 20 2b | 20 73 74 72 6c 65 6e 28 |e(m, m +| strlen(|
|00004180| 6b 65 79 77 6f 72 64 29 | 2c 20 6e 65 77 76 61 6c |keyword)|, newval|
|00004190| 29 3b 0a 09 7d 0a 0a 09 | 72 65 74 75 72 6e 20 6d |);..}...|return m|
|000041a0| 3b 0a 7d 0a 23 65 6e 64 | 69 66 0a 0a 0a 2f 2a 20 |;.}.#end|if.../* |
|000041b0| 54 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 61 63 |This fun|ction ac|
|000041c0| 74 73 20 6c 69 6b 65 20 | 74 68 65 20 45 58 20 63 |ts like |the EX c|
|000041d0| 6f 6d 6d 61 6e 64 20 22 | 78 69 74 22 20 2a 2f 0a |ommand "|xit" */.|
|000041e0| 2f 2a 41 52 47 53 55 53 | 45 44 2a 2f 0a 4d 41 52 |/*ARGSUS|ED*/.MAR|
|000041f0| 4b 20 76 5f 78 69 74 28 | 6d 2c 20 63 6e 74 2c 20 |K v_xit(|m, cnt, |
|00004200| 6b 65 79 29 0a 09 4d 41 | 52 4b 09 6d 3b 09 2f 2a |key)..MA|RK.m;./*|
|00004210| 20 69 67 6e 6f 72 65 64 | 20 2a 2f 0a 09 6c 6f 6e | ignored| */..lon|
|00004220| 67 09 63 6e 74 3b 09 2f | 2a 20 69 67 6e 6f 72 65 |g.cnt;./|* ignore|
|00004230| 64 20 2a 2f 0a 09 69 6e | 74 09 6b 65 79 3b 09 2f |d */..in|t.key;./|
|00004240| 2a 20 6d 75 73 74 20 62 | 65 20 61 20 73 65 63 6f |* must b|e a seco|
|00004250| 6e 64 20 27 5a 27 20 2a | 2f 0a 7b 0a 09 2f 2a 20 |nd 'Z' *|/.{../* |
|00004260| 69 66 20 73 65 63 6f 6e | 64 20 63 68 61 72 20 77 |if secon|d char w|
|00004270| 61 73 6e 27 74 20 27 5a | 27 2c 20 66 61 69 6c 20 |asn't 'Z|', fail |
|00004280| 2a 2f 0a 09 69 66 20 28 | 6b 65 79 20 21 3d 20 27 |*/..if (|key != '|
|00004290| 5a 27 29 0a 09 7b 0a 09 | 09 72 65 74 75 72 6e 20 |Z')..{..|.return |
|000042a0| 4d 41 52 4b 5f 55 4e 53 | 45 54 3b 0a 09 7d 0a 0a |MARK_UNS|ET;..}..|
|000042b0| 09 2f 2a 20 6d 6f 76 65 | 20 74 68 65 20 70 68 79 |./* move| the phy|
|000042c0| 73 69 63 61 6c 20 63 75 | 72 73 6f 72 20 74 6f 20 |sical cu|rsor to |
|000042d0| 74 68 65 20 65 6e 64 20 | 6f 66 20 74 68 65 20 73 |the end |of the s|
|000042e0| 63 72 65 65 6e 20 2a 2f | 0a 09 6d 6f 76 65 28 4c |creen */|..move(L|
|000042f0| 49 4e 45 53 20 2d 20 31 | 2c 20 30 29 3b 0a 09 63 |INES - 1|, 0);..c|
|00004300| 6c 72 74 6f 65 6f 6c 28 | 29 3b 0a 09 72 65 66 72 |lrtoeol(|);..refr|
|00004310| 65 73 68 28 29 3b 0a 0a | 09 2f 2a 20 64 6f 20 74 |esh();..|./* do t|
|00004320| 68 65 20 78 69 74 20 63 | 6f 6d 6d 61 6e 64 20 2a |he xit c|ommand *|
|00004330| 2f 0a 09 63 6d 64 5f 78 | 69 74 28 6d 2c 20 6d 2c |/..cmd_x|it(m, m,|
|00004340| 20 43 4d 44 5f 58 49 54 | 2c 20 46 41 4c 53 45 2c | CMD_XIT|, FALSE,|
|00004350| 20 22 22 29 3b 0a 0a 09 | 2f 2a 20 69 66 20 77 65 | "");...|/* if we|
|00004360| 27 72 65 20 72 65 61 6c | 6c 79 20 67 6f 69 6e 67 |'re real|ly going|
|00004370| 20 74 6f 20 71 75 69 74 | 2c 20 74 68 65 6e 20 73 | to quit|, then s|
|00004380| 63 72 6f 6c 6c 20 74 68 | 65 20 73 63 72 65 65 6e |croll th|e screen|
|00004390| 20 75 70 20 31 20 6c 69 | 6e 65 20 2a 2f 0a 09 69 | up 1 li|ne */..i|
|000043a0| 66 20 28 6d 6f 64 65 20 | 3d 3d 20 4d 4f 44 45 5f |f (mode |== MODE_|
|000043b0| 51 55 49 54 29 0a 09 7b | 0a 09 09 61 64 64 63 68 |QUIT)..{|...addch|
|000043c0| 28 27 5c 6e 27 29 3b 0a | 09 09 72 65 66 72 65 73 |('\n');.|..refres|
|000043d0| 68 28 29 3b 0a 09 7d 0a | 0a 09 2f 2a 20 72 65 67 |h();..}.|../* reg|
|000043e0| 61 72 64 6c 65 73 73 20 | 6f 66 20 77 68 65 74 68 |ardless |of wheth|
|000043f0| 65 72 20 77 65 20 73 75 | 63 63 65 65 64 65 64 20 |er we su|cceeded |
|00004400| 6f 72 20 66 61 69 6c 65 | 64 2c 20 72 65 74 75 72 |or faile|d, retur|
|00004410| 6e 20 74 68 65 20 63 75 | 72 73 6f 72 20 2a 2f 0a |n the cu|rsor */.|
|00004420| 09 72 65 74 75 72 6e 20 | 6d 3b 0a 7d 0a 0a 0a 2f |.return |m;.}.../|
|00004430| 2a 20 54 68 69 73 20 66 | 75 6e 63 74 69 6f 6e 20 |* This f|unction |
|00004440| 75 6e 64 6f 65 73 20 63 | 68 61 6e 67 65 73 20 74 |undoes c|hanges t|
|00004450| 6f 20 61 20 73 69 6e 67 | 6c 65 20 6c 69 6e 65 2c |o a sing|le line,|
|00004460| 20 69 66 20 70 6f 73 73 | 69 62 6c 65 20 2a 2f 0a | if poss|ible */.|
|00004470| 4d 41 52 4b 20 76 5f 75 | 6e 64 6f 6c 69 6e 65 28 |MARK v_u|ndoline(|
|00004480| 6d 29 0a 09 4d 41 52 4b | 09 6d 3b 09 2f 2a 20 77 |m)..MARK|.m;./* w|
|00004490| 68 65 72 65 20 77 65 20 | 68 6f 70 65 20 74 6f 20 |here we |hope to |
|000044a0| 75 6e 64 6f 20 74 68 65 | 20 63 68 61 6e 67 65 20 |undo the| change |
|000044b0| 2a 2f 0a 7b 0a 09 69 66 | 20 28 6d 61 72 6b 6c 69 |*/.{..if| (markli|
|000044c0| 6e 65 28 6d 29 20 21 3d | 20 55 5f 6c 69 6e 65 29 |ne(m) !=| U_line)|
|000044d0| 0a 09 7b 0a 09 09 72 65 | 74 75 72 6e 20 4d 41 52 |..{...re|turn MAR|
|000044e0| 4b 5f 55 4e 53 45 54 3b | 0a 09 7d 0a 0a 09 43 68 |K_UNSET;|..}...Ch|
|000044f0| 61 6e 67 65 54 65 78 74 | 0a 09 7b 0a 09 09 63 68 |angeText|..{...ch|
|00004500| 61 6e 67 65 6c 69 6e 65 | 28 55 5f 6c 69 6e 65 2c |angeline|(U_line,|
|00004510| 20 55 5f 74 65 78 74 29 | 3b 0a 09 7d 0a 09 72 65 | U_text)|;..}..re|
|00004520| 74 75 72 6e 20 6d 20 26 | 20 7e 28 42 4c 4b 53 49 |turn m &| ~(BLKSI|
|00004530| 5a 45 20 2d 20 31 29 3b | 0a 7d 0a 53 48 41 52 5f |ZE - 1);|.}.SHAR_|
|00004540| 45 4f 46 0a 66 69 0a 69 | 66 20 74 65 73 74 20 2d |EOF.fi.i|f test -|
|00004550| 66 20 27 76 69 2e 63 27 | 0a 74 68 65 6e 0a 09 65 |f 'vi.c'|.then..e|
|00004560| 63 68 6f 20 73 68 61 72 | 3a 20 22 77 69 6c 6c 20 |cho shar|: "will |
|00004570| 6e 6f 74 20 6f 76 65 72 | 2d 77 72 69 74 65 20 65 |not over|-write e|
|00004580| 78 69 73 74 69 6e 67 20 | 66 69 6c 65 20 27 76 69 |xisting |file 'vi|
|00004590| 2e 63 27 22 0a 65 6c 73 | 65 0a 63 61 74 20 3c 3c |.c'".els|e.cat <<|
|000045a0| 20 5c 53 48 41 52 5f 45 | 4f 46 20 3e 20 27 76 69 | \SHAR_E|OF > 'vi|
|000045b0| 2e 63 27 0a 2f 2a 20 76 | 69 2e 63 20 2a 2f 0a 0a |.c'./* v|i.c */..|
|000045c0| 2f 2a 20 41 75 74 68 6f | 72 3a 0a 20 2a 09 53 74 |/* Autho|r:. *.St|
|000045d0| 65 76 65 20 4b 69 72 6b | 65 6e 64 61 6c 6c 0a 20 |eve Kirk|endall. |
|000045e0| 2a 09 31 36 38 32 30 20 | 53 57 20 54 61 6c 6c 61 |*.16820 |SW Talla|
|000045f0| 63 20 57 61 79 0a 20 2a | 09 42 65 61 76 65 72 74 |c Way. *|.Beavert|
|00004600| 6f 6e 2c 20 4f 52 20 39 | 37 30 30 36 0a 20 2a 09 |on, OR 9|7006. *.|
|00004610| 6b 69 72 6b 65 6e 64 61 | 40 6a 6f 76 65 2e 63 73 |kirkenda|@jove.cs|
|00004620| 2e 70 64 78 2e 65 64 75 | 2c 20 6f 72 20 2e 2e 2e |.pdx.edu|, or ...|
|00004630| 75 75 6e 65 74 21 74 65 | 6b 74 72 6f 6e 69 78 21 |uunet!te|ktronix!|
|00004640| 70 73 75 65 65 61 21 6a | 6f 76 65 21 6b 69 72 6b |psueea!j|ove!kirk|
|00004650| 65 6e 64 61 0a 20 2a 2f | 0a 0a 0a 23 69 6e 63 6c |enda. */|...#incl|
|00004660| 75 64 65 20 22 63 6f 6e | 66 69 67 2e 68 22 0a 23 |ude "con|fig.h".#|
|00004670| 69 6e 63 6c 75 64 65 20 | 3c 63 74 79 70 65 2e 68 |include |<ctype.h|
|00004680| 3e 0a 23 69 6e 63 6c 75 | 64 65 20 22 76 69 2e 68 |>.#inclu|de "vi.h|
|00004690| 22 0a 0a 0a 0a 2f 2a 20 | 54 68 69 73 20 61 72 72 |"..../* |This arr|
|000046a0| 61 79 20 64 65 73 63 72 | 69 62 65 73 20 77 68 61 |ay descr|ibes wha|
|000046b0| 74 20 65 61 63 68 20 6b | 65 79 20 64 6f 65 73 20 |t each k|ey does |
|000046c0| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 4e 4f 5f 46 55 |*/.#defi|ne NO_FU|
|000046d0| 4e 43 09 09 28 4d 41 52 | 4b 20 28 2a 29 28 29 29 |NC..(MAR|K (*)())|
|000046e0| 30 0a 23 64 65 66 69 6e | 65 20 4e 4f 5f 41 52 47 |0.#defin|e NO_ARG|
|000046f0| 53 09 09 30 0a 23 64 65 | 66 69 6e 65 20 43 55 52 |S..0.#de|fine CUR|
|00004700| 53 4f 52 5f 43 4f 55 4e | 54 09 31 0a 23 64 65 66 |SOR_COUN|T.1.#def|
|00004710| 69 6e 65 20 43 55 52 53 | 4f 52 09 09 32 0a 23 64 |ine CURS|OR..2.#d|
|00004720| 65 66 69 6e 65 20 43 55 | 52 53 4f 52 5f 43 4e 54 |efine CU|RSOR_CNT|
|00004730| 5f 4b 45 59 09 33 0a 23 | 64 65 66 69 6e 65 20 43 |_KEY.3.#|define C|
|00004740| 55 52 53 4f 52 5f 4d 4f | 56 45 44 09 34 0a 23 64 |URSOR_MO|VED.4.#d|
|00004750| 65 66 69 6e 65 20 43 55 | 52 53 4f 52 5f 45 4f 4c |efine CU|RSOR_EOL|
|00004760| 09 35 0a 23 64 65 66 69 | 6e 65 20 5a 45 52 4f 09 |.5.#defi|ne ZERO.|
|00004770| 09 36 0a 23 64 65 66 69 | 6e 65 20 44 49 47 49 54 |.6.#defi|ne DIGIT|
|00004780| 09 09 37 0a 23 64 65 66 | 69 6e 65 20 43 55 52 53 |..7.#def|ine CURS|
|00004790| 4f 52 5f 54 45 58 54 09 | 38 0a 23 64 65 66 69 6e |OR_TEXT.|8.#defin|
|000047a0| 65 20 43 55 52 53 4f 52 | 5f 43 4e 54 5f 43 4d 44 |e CURSOR|_CNT_CMD|
|000047b0| 09 39 0a 23 64 65 66 69 | 6e 65 20 4b 45 59 57 4f |.9.#defi|ne KEYWO|
|000047c0| 52 44 09 09 31 30 0a 23 | 64 65 66 69 6e 65 20 4e |RD..10.#|define N|
|000047d0| 4f 5f 46 4c 41 47 53 09 | 30 78 30 30 0a 23 64 65 |O_FLAGS.|0x00.#de|
|000047e0| 66 69 6e 65 09 4d 56 4d | 54 09 09 30 78 30 31 09 |fine.MVM|T..0x01.|
|000047f0| 2f 2a 20 74 68 69 73 20 | 69 73 20 61 20 6d 6f 76 |/* this |is a mov|
|00004800| 65 6d 65 6e 74 20 63 6f | 6d 6d 61 6e 64 20 2a 2f |ement co|mmand */|
|00004810| 0a 23 64 65 66 69 6e 65 | 20 50 54 4d 56 09 09 30 |.#define| PTMV..0|
|00004820| 78 30 32 09 2f 2a 20 74 | 68 69 73 20 63 61 6e 20 |x02./* t|his can |
|00004830| 62 65 20 2a 70 61 72 74 | 2a 20 6f 66 20 61 20 6d |be *part|* of a m|
|00004840| 6f 76 65 6d 65 6e 74 20 | 63 6f 6d 6d 61 6e 64 20 |ovement |command |
|00004850| 2a 2f 0a 23 64 65 66 69 | 6e 65 20 46 52 4e 54 09 |*/.#defi|ne FRNT.|
|00004860| 09 30 78 30 34 09 2f 2a | 20 61 66 74 65 72 20 6d |.0x04./*| after m|
|00004870| 6f 76 65 2c 20 67 6f 20 | 74 6f 20 66 72 6f 6e 74 |ove, go |to front|
|00004880| 20 6f 66 20 6c 69 6e 65 | 20 2a 2f 0a 23 64 65 66 | of line| */.#def|
|00004890| 69 6e 65 20 49 4e 43 4c | 09 09 30 78 30 38 09 2f |ine INCL|..0x08./|
|000048a0| 2a 20 69 6e 63 6c 75 64 | 65 20 6c 61 73 74 20 63 |* includ|e last c|
|000048b0| 68 61 72 20 77 68 65 6e | 20 75 73 65 64 20 77 69 |har when| used wi|
|000048c0| 74 68 20 63 2f 64 2f 79 | 20 2a 2f 0a 23 64 65 66 |th c/d/y| */.#def|
|000048d0| 69 6e 65 20 4c 4e 4d 44 | 09 09 30 78 31 30 09 2f |ine LNMD|..0x10./|
|000048e0| 2a 20 75 73 65 20 6c 69 | 6e 65 20 6d 6f 64 65 20 |* use li|ne mode |
|000048f0| 6f 66 20 63 2f 64 2f 79 | 20 2a 2f 0a 23 64 65 66 |of c/d/y| */.#def|
|00004900| 69 6e 65 20 4e 43 4f 4c | 09 09 30 78 32 30 09 2f |ine NCOL|..0x20./|
|00004910| 2a 20 74 68 69 73 20 63 | 6f 6d 6d 61 6e 64 20 63 |* this c|ommand c|
|00004920| 61 6e 27 74 20 63 68 61 | 6e 67 65 20 74 68 65 20 |an't cha|nge the |
|00004930| 63 6f 6c 75 6d 6e 23 20 | 2a 2f 0a 23 64 65 66 69 |column# |*/.#defi|
|00004940| 6e 65 20 4e 52 45 4c 09 | 09 30 78 34 30 09 2f 2a |ne NREL.|.0x40./*|
|00004950| 20 74 68 69 73 20 69 73 | 20 22 6e 6f 6e 2d 72 65 | this is| "non-re|
|00004960| 6c 61 74 69 76 65 22 20 | 2d 2d 20 73 65 74 20 74 |lative" |-- set t|
|00004970| 68 65 20 27 27 20 6d 61 | 72 6b 20 2a 2f 0a 23 64 |he '' ma|rk */.#d|
|00004980| 65 66 69 6e 65 20 53 44 | 4f 54 09 09 30 78 38 30 |efine SD|OT..0x80|
|00004990| 09 2f 2a 20 73 65 74 20 | 74 68 65 20 22 64 6f 74 |./* set |the "dot|
|000049a0| 22 20 76 61 72 69 61 62 | 6c 65 73 2c 20 66 6f 72 |" variab|les, for|
|000049b0| 20 74 68 65 20 22 2e 22 | 20 63 6d 64 20 2a 2f 0a | the "."| cmd */.|
|000049c0| 73 74 61 74 69 63 20 73 | 74 72 75 63 74 20 6b 65 |static s|truct ke|
|000049d0| 79 73 74 72 75 0a 7b 0a | 09 4d 41 52 4b 09 28 2a |ystru.{.|.MARK.(*|
|000049e0| 66 75 6e 63 29 28 29 3b | 09 2f 2a 20 74 68 65 20 |func)();|./* the |
|000049f0| 66 75 6e 63 74 69 6f 6e | 20 74 6f 20 72 75 6e 20 |function| to run |
|00004a00| 2a 2f 0a 09 63 68 61 72 | 09 61 72 67 73 3b 09 09 |*/..char|.args;..|
|00004a10| 2f 2a 20 64 65 73 63 72 | 69 70 74 69 6f 6e 20 6f |/* descr|iption o|
|00004a20| 66 20 74 68 65 20 61 72 | 67 73 20 6e 65 65 64 65 |f the ar|gs neede|
|00004a30| 64 20 2a 2f 0a 09 63 68 | 61 72 09 66 6c 61 67 73 |d */..ch|ar.flags|
|00004a40| 3b 09 09 2f 2a 20 6f 74 | 68 65 72 20 73 74 75 66 |;../* ot|her stuf|
|00004a50| 66 20 2a 2f 0a 7d 0a 09 | 76 69 6b 65 79 73 5b 5d |f */.}..|vikeys[]|
|00004a60| 20 3d 0a 7b 0a 2f 2a 20 | 4e 55 4c 20 6e 6f 74 20 | =.{./* |NUL not |
|00004a70| 64 65 66 69 6e 65 64 09 | 2a 2f 09 7b 4e 4f 5f 46 |defined.|*/.{NO_F|
|00004a80| 55 4e 43 2c 09 4e 4f 5f | 41 52 47 53 2c 09 4e 4f |UNC,.NO_|ARGS,.NO|
|00004a90| 5f 46 4c 41 47 53 7d 2c | 0a 2f 2a 20 5e 41 20 20 |_FLAGS},|./* ^A |
|00004aa0| 6e 6f 74 20 64 65 66 69 | 6e 65 64 09 2a 2f 09 7b |not defi|ned.*/.{|
|00004ab0| 4e 4f 5f 46 55 4e 43 2c | 09 4e 4f 5f 41 52 47 53 |NO_FUNC,|.NO_ARGS|
|00004ac0| 2c 09 4e 4f 5f 46 4c 41 | 47 53 7d 2c 0a 2f 2a 20 |,.NO_FLA|GS},./* |
|00004ad0| 5e 42 20 20 70 61 67 65 | 20 62 61 63 6b 77 61 72 |^B page| backwar|
|00004ae0| 64 09 2a 2f 09 7b 6d 5f | 73 63 72 6f 6c 6c 2c 09 |d.*/.{m_|scroll,.|
|00004af0| 43 55 52 53 4f 52 5f 43 | 4e 54 5f 43 4d 44 2c 09 |CURSOR_C|NT_CMD,.|
|00004b00| 46 52 4e 54 7d 2c 0a 2f | 2a 20 5e 43 20 20 6e 6f |FRNT},./|* ^C no|
|00004b10| 74 20 64 65 66 69 6e 65 | 64 09 2a 2f 09 7b 4e 4f |t define|d.*/.{NO|
|00004b20| 5f 46 55 4e 43 2c 09 4e | 4f 5f 41 52 47 53 2c 09 |_FUNC,.N|O_ARGS,.|
|00004b30| 4e 4f 5f 46 4c 41 47 53 | 7d 2c 0a 2f 2a 20 5e 44 |NO_FLAGS|},./* ^D|
|00004b40| 20 20 73 63 72 6f 6c 6c | 20 64 6e 20 31 2f 32 70 | scroll| dn 1/2p|
|00004b50| 61 67 65 2a 2f 09 7b 6d | 5f 73 63 72 6f 6c 6c 2c |age*/.{m|_scroll,|
|00004b60| 09 43 55 52 53 4f 52 5f | 43 4e 54 5f 43 4d 44 2c |.CURSOR_|CNT_CMD,|
|00004b70| 09 4e 43 4f 4c 7d 2c 0a | 2f 2a 20 5e 45 20 20 73 |.NCOL},.|/* ^E s|
|00004b80| 63 72 6f 6c 6c 20 75 70 | 09 2a 2f 09 7b 6d 5f 73 |croll up|.*/.{m_s|
|00004b90| 63 72 6f 6c 6c 2c 09 43 | 55 52 53 4f 52 5f 43 4e |croll,.C|URSOR_CN|
|00004ba0| 54 5f 43 4d 44 2c 09 4e | 43 4f 4c 7d 2c 0a 2f 2a |T_CMD,.N|COL},./*|
|00004bb0| 20 5e 46 20 20 70 61 67 | 65 20 66 6f 72 77 61 72 | ^F pag|e forwar|
|00004bc0| 64 09 2a 2f 09 7b 6d 5f | 73 63 72 6f 6c 6c 2c 09 |d.*/.{m_|scroll,.|
|00004bd0| 43 55 52 53 4f 52 5f 43 | 4e 54 5f 43 4d 44 2c 09 |CURSOR_C|NT_CMD,.|
|00004be0| 46 52 4e 54 7d 2c 0a 2f | 2a 20 5e 47 20 20 73 68 |FRNT},./|* ^G sh|
|00004bf0| 6f 77 20 66 69 6c 65 20 | 73 74 61 74 75 73 09 2a |ow file |status.*|
|00004c00| 2f 09 7b 76 5f 73 74 61 | 74 75 73 2c 09 4e 4f 5f |/.{v_sta|tus,.NO_|
|00004c10| 41 52 47 53 2c 20 09 4e | 4f 5f 46 4c 41 47 53 7d |ARGS, .N|O_FLAGS}|
|00004c20| 2c 0a 2f 2a 20 5e 48 20 | 20 6d 6f 76 65 20 6c 65 |,./* ^H | move le|
|00004c30| 66 74 2c 20 6c 69 6b 65 | 20 68 2a 2f 09 7b 6d 5f |ft, like| h*/.{m_|
|00004c40| 6c 65 66 74 2c 09 43 55 | 52 53 4f 52 5f 43 4f 55 |left,.CU|RSOR_COU|
|00004c50| 4e 54 2c 09 4d 56 4d 54 | 7d 2c 0a 2f 2a 20 5e 49 |NT,.MVMT|},./* ^I|
|00004c60| 20 20 6e 6f 74 20 64 65 | 66 69 6e 65 64 09 2a 2f | not de|fined.*/|
|00004c70| 09 7b 4e 4f 5f 46 55 4e | 43 2c 09 4e 4f 5f 41 52 |.{NO_FUN|C,.NO_AR|
|00004c80| 47 53 2c 09 4e 4f 5f 46 | 4c 41 47 53 7d 2c 0a 2f |GS,.NO_F|LAGS},./|
|00004c90| 2a 20 5e 4a 20 20 6d 6f | 76 65 20 64 6f 77 6e 09 |* ^J mo|ve down.|
|00004ca0| 2a 2f 09 7b 6d 5f 64 6f | 77 6e 2c 09 43 55 52 53 |*/.{m_do|wn,.CURS|
|00004cb0| 4f 52 5f 43 4f 55 4e 54 | 2c 09 4d 56 4d 54 7c 4c |OR_COUNT|,.MVMT|L|
|00004cc0| 4e 4d 44 7d 2c 0a 2f 2a | 20 5e 4b 20 20 6e 6f 74 |NMD},./*| ^K not|
|00004cd0| 20 64 65 66 69 6e 65 64 | 09 2a 2f 09 7b 4e 4f 5f | defined|.*/.{NO_|
|00004ce0| 46 55 4e 43 2c 09 4e 4f | 5f 41 52 47 53 2c 09 4e |FUNC,.NO|_ARGS,.N|
|00004cf0| 4f 5f 46 4c 41 47 53 7d | 2c 0a 2f 2a 20 5e 4c 20 |O_FLAGS}|,./* ^L |
|00004d00| 20 72 65 64 72 61 77 20 | 73 63 72 65 65 6e 09 2a | redraw |screen.*|
|00004d10| 2f 09 7b 76 5f 72 65 64 | 72 61 77 2c 09 4e 4f 5f |/.{v_red|raw,.NO_|
|00004d20| 41 52 47 53 2c 09 4e 4f | 5f 46 4c 41 47 53 7d 2c |ARGS,.NO|_FLAGS},|
|00004d30| 0a 2f 2a 20 5e 4d 20 20 | 6d 76 20 66 72 6f 6e 74 |./* ^M |mv front|
|00004d40| 20 6e 65 78 74 20 6c 6e | 20 2a 2f 09 7b 6d 5f 64 | next ln| */.{m_d|
|00004d50| 6f 77 6e 2c 09 43 55 52 | 53 4f 52 5f 43 4f 55 4e |own,.CUR|SOR_COUN|
|00004d60| 54 2c 09 4d 56 4d 54 7c | 46 52 4e 54 7c 4c 4e 4d |T,.MVMT||FRNT|LNM|
|00004d70| 44 7d 2c 0a 2f 2a 20 5e | 4e 20 20 6d 6f 76 65 20 |D},./* ^|N move |
|00004d80| 64 6f 77 6e 09 2a 2f 09 | 7b 6d 5f 64 6f 77 6e 2c |down.*/.|{m_down,|
|00004d90| 09 43 55 52 53 4f 52 5f | 43 4f 55 4e 54 2c 09 4d |.CURSOR_|COUNT,.M|
|00004da0| 56 4d 54 7c 4c 4e 4d 44 | 7d 2c 0a 2f 2a 20 5e 4f |VMT|LNMD|},./* ^O|
|00004db0| 20 20 6e 6f 74 20 64 65 | 66 69 6e 65 64 09 2a 2f | not de|fined.*/|
|00004dc0| 09 7b 4e 4f 5f 46 55 4e | 43 2c 09 4e 4f 5f 41 52 |.{NO_FUN|C,.NO_AR|
|00004dd0| 47 53 2c 09 4e 4f 5f 46 | 4c 41 47 53 7d 2c 0a 2f |GS,.NO_F|LAGS},./|
|00004de0| 2a 20 5e 50 20 20 6e 6f | 74 20 64 65 66 69 6e 65 |* ^P no|t define|
|00004df0| 64 09 2a 2f 09 7b 6d 5f | 75 70 2c 09 09 43 55 52 |d.*/.{m_|up,..CUR|
|00004e00| 53 4f 52 5f 43 4f 55 4e | 54 2c 09 4d 56 4d 54 7c |SOR_COUN|T,.MVMT||
|00004e10| 4c 4e 4d 44 7d 2c 0a 2f | 2a 20 5e 51 20 20 6e 6f |LNMD},./|* ^Q no|
|00004e20| 74 20 64 65 66 69 6e 65 | 64 09 2a 2f 09 7b 4e 4f |t define|d.*/.{NO|
|00004e30| 5f 46 55 4e 43 2c 09 4e | 4f 5f 41 52 47 53 2c 09 |_FUNC,.N|O_ARGS,.|
|00004e40| 4e 4f 5f 46 4c 41 47 53 | 7d 2c 0a 2f 2a 20 5e 52 |NO_FLAGS|},./* ^R|
|00004e50| 20 20 72 65 64 72 61 77 | 20 73 63 72 65 65 6e 09 | redraw| screen.|
|00004e60| 2a 2f 09 7b 76 5f 72 65 | 64 72 61 77 2c 09 4e 4f |*/.{v_re|draw,.NO|
|00004e70| 5f 41 52 47 53 2c 09 4e | 4f 5f 46 4c 41 47 53 7d |_ARGS,.N|O_FLAGS}|
|00004e80| 2c 0a 2f 2a 20 5e 53 20 | 20 6e 6f 74 20 64 65 66 |,./* ^S | not def|
|00004e90| 69 6e 65 64 09 2a 2f 09 | 7b 4e 4f 5f 46 55 4e 43 |ined.*/.|{NO_FUNC|
|00004ea0| 2c 09 4e 4f 5f 41 52 47 | 53 2c 09 4e 4f 5f 46 4c |,.NO_ARG|S,.NO_FL|
|00004eb0| 41 47 53 7d 2c 0a 2f 2a | 20 5e 54 20 20 6e 6f 74 |AGS},./*| ^T not|
|00004ec0| 20 64 65 66 69 6e 65 64 | 09 2a 2f 09 7b 4e 4f 5f | defined|.*/.{NO_|
|00004ed0| 46 55 4e 43 2c 09 4e 4f | 5f 41 52 47 53 2c 09 4e |FUNC,.NO|_ARGS,.N|
|00004ee0| 4f 5f 46 4c 41 47 53 7d | 2c 0a 2f 2a 20 5e 55 20 |O_FLAGS}|,./* ^U |
|00004ef0| 20 73 63 72 6f 6c 6c 20 | 75 70 20 31 2f 32 70 61 | scroll |up 1/2pa|
|00004f00| 67 65 2a 2f 09 7b 6d 5f | 73 63 72 6f 6c 6c 2c 09 |ge*/.{m_|scroll,.|
|00004f10| 43 55 52 53 4f 52 5f 43 | 4e 54 5f 43 4d 44 2c 09 |CURSOR_C|NT_CMD,.|
|00004f20| 4e 43 4f 4c 7d 2c 0a 2f | 2a 20 5e 56 20 20 6e 6f |NCOL},./|* ^V no|
|00004f30| 74 20 64 65 66 69 6e 65 | 64 09 2a 2f 09 7b 4e 4f |t define|d.*/.{NO|
|00004f40| 5f 46 55 4e 43 2c 09 4e | 4f 5f 41 52 47 53 2c 09 |_FUNC,.N|O_ARGS,.|
|00004f50| 4e 4f 5f 46 4c 41 47 53 | 7d 2c 0a 2f 2a 20 5e 57 |NO_FLAGS|},./* ^W|
|00004f60| 20 20 6e 6f 74 20 64 65 | 66 69 6e 65 64 09 2a 2f | not de|fined.*/|
|00004f70| 09 7b 4e 4f 5f 46 55 4e | 43 2c 09 4e 4f 5f 41 52 |.{NO_FUN|C,.NO_AR|
|00004f80| 47 53 2c 09 4e 4f 5f 46 | 4c 41 47 53 7d 2c 0a 2f |GS,.NO_F|LAGS},./|
|00004f90| 2a 20 5e 58 20 20 6e 6f | 74 20 64 65 66 69 6e 65 |* ^X no|t define|
|00004fa0| 64 09 2a 2f 09 7b 4e 4f | 5f 46 55 4e 43 2c 09 4e |d.*/.{NO|_FUNC,.N|
|00004fb0| 4f 5f 41 52 47 53 2c 09 | 4e 4f 5f 46 4c 41 47 53 |O_ARGS,.|NO_FLAGS|
|00004fc0| 7d 2c 0a 2f 2a 20 5e 59 | 20 20 73 63 72 6f 6c 6c |},./* ^Y| scroll|
|00004fd0| 20 64 6f 77 6e 09 2a 2f | 09 7b 6d 5f 73 63 72 6f | down.*/|.{m_scro|
|00004fe0| 6c 6c 2c 09 43 55 52 53 | 4f 52 5f 43 4e 54 5f 43 |ll,.CURS|OR_CNT_C|
|00004ff0| 4d 44 2c 09 4e 43 4f 4c | 7d 2c 0a 2f 2a 20 5e 5a |MD,.NCOL|},./* ^Z|
|00005000| 20 20 6e 6f 74 20 64 65 | 66 69 6e 65 64 09 2a 2f | not de|fined.*/|
|00005010| 09 7b 4e 4f 5f 46 55 4e | 43 2c 09 4e 4f 5f 41 52 |.{NO_FUN|C,.NO_AR|
|00005020| 47 53 2c 09 4e 4f 5f 46 | 4c 41 47 53 7d 2c 0a 2f |GS,.NO_F|LAGS},./|
|00005030| 2a 20 45 53 43 20 6e 6f | 74 20 64 65 66 69 6e 65 |* ESC no|t define|
|00005040| 64 09 2a 2f 09 7b 4e 4f | 5f 46 55 4e 43 2c 09 4e |d.*/.{NO|_FUNC,.N|
|00005050| 4f 5f 41 52 47 53 2c 09 | 4e 4f 5f 46 4c 41 47 53 |O_ARGS,.|NO_FLAGS|
|00005060| 7d 2c 0a 2f 2a 20 5e 5c | 20 20 6e 6f 74 20 64 65 |},./* ^\| not de|
|00005070| 66 69 6e 65 64 09 2a 2f | 09 7b 4e 4f 5f 46 55 4e |fined.*/|.{NO_FUN|
|00005080| 43 2c 09 4e 4f 5f 41 52 | 47 53 2c 09 4e 4f 5f 46 |C,.NO_AR|GS,.NO_F|
|00005090| 4c 41 47 53 7d 2c 0a 2f | 2a 20 5e 5d 20 20 6b 65 |LAGS},./|* ^] ke|
|000050a0| 79 77 6f 72 64 20 69 73 | 20 74 61 67 09 2a 2f 09 |yword is| tag.*/.|
|000050b0| 7b 76 5f 74 61 67 2c 09 | 09 4b 45 59 57 4f 52 44 |{v_tag,.|.KEYWORD|
|000050c0| 2c 09 4e 4f 5f 46 4c 41 | 47 53 7d 2c 0a 2f 2a 20 |,.NO_FLA|GS},./* |
|000050d0| 5e 5e 20 20 70 72 65 76 | 69 6f 75 73 20 66 69 6c |^^ prev|ious fil|
|000050e0| 65 09 2a 2f 09 7b 76 5f | 73 77 69 74 63 68 2c 09 |e.*/.{v_|switch,.|
|000050f0| 43 55 52 53 4f 52 2c 09 | 09 4e 4f 5f 46 4c 41 47 |CURSOR,.|.NO_FLAG|
|00005100| 53 7d 2c 0a 2f 2a 20 5e | 5f 20 20 6e 6f 74 20 64 |S},./* ^|_ not d|
|00005110| 65 66 69 6e 65 64 09 2a | 2f 09 7b 4e 4f 5f 46 55 |efined.*|/.{NO_FU|
|00005120| 4e 43 2c 09 4e 4f 5f 41 | 52 47 53 2c 09 4e 4f 5f |NC,.NO_A|RGS,.NO_|
|00005130| 46 4c 41 47 53 7d 2c 0a | 2f 2a 20 53 50 43 20 6d |FLAGS},.|/* SPC m|
|00005140| 6f 76 65 20 72 69 67 68 | 74 2c 6c 69 6b 65 20 6c |ove righ|t,like l|
|00005150| 2a 2f 09 7b 6d 5f 72 69 | 67 68 74 2c 09 43 55 52 |*/.{m_ri|ght,.CUR|
|00005160| 53 4f 52 5f 43 4f 55 4e | 54 2c 09 4d 56 4d 54 7d |SOR_COUN|T,.MVMT}|
|00005170| 2c 0a 2f 2a 20 20 21 20 | 20 72 75 6e 20 74 68 72 |,./* ! | run thr|
|00005180| 75 20 66 69 6c 74 65 72 | 09 2a 2f 09 7b 76 5f 66 |u filter|.*/.{v_f|
|00005190| 69 6c 74 65 72 2c 09 43 | 55 52 53 4f 52 5f 4d 4f |ilter,.C|URSOR_MO|
|000051a0| 56 45 44 2c 09 4e 4f 5f | 46 4c 41 47 53 7d 2c 0a |VED,.NO_|FLAGS},.|
|000051b0| 2f 2a 20 20 22 20 20 73 | 65 6c 65 63 74 20 63 75 |/* " s|elect cu|
|000051c0| 74 20 62 75 66 66 65 72 | 2a 2f 09 7b 76 5f 73 65 |t buffer|*/.{v_se|
|000051d0| 6c 63 75 74 2c 09 43 55 | 52 53 4f 52 5f 43 4e 54 |lcut,.CU|RSOR_CNT|
|000051e0| 5f 4b 45 59 2c 09 50 54 | 4d 56 7d 2c 0a 23 69 66 |_KEY,.PT|MV},.#if|
|000051f0| 6e 64 65 66 20 4e 4f 5f | 45 58 54 45 4e 53 49 4f |ndef NO_|EXTENSIO|
|00005200| 4e 53 0a 2f 2a 20 20 23 | 20 20 69 6e 63 72 65 6d |NS./* #| increm|
|00005210| 65 6e 74 20 6e 75 6d 62 | 65 72 09 2a 2f 09 7b 76 |ent numb|er.*/.{v|
|00005220| 5f 69 6e 63 72 65 6d 65 | 6e 74 2c 09 4b 45 59 57 |_increme|nt,.KEYW|
|00005230| 4f 52 44 2c 09 53 44 4f | 54 7d 2c 0a 23 65 6c 73 |ORD,.SDO|T},.#els|
|00005240| 65 0a 2f 2a 20 20 23 20 | 20 6e 6f 74 20 64 65 66 |e./* # | not def|
|00005250| 69 6e 65 64 09 2a 2f 09 | 7b 4e 4f 5f 46 55 4e 43 |ined.*/.|{NO_FUNC|
|00005260| 2c 09 4e 4f 5f 41 52 47 | 53 2c 09 4e 4f 5f 46 4c |,.NO_ARG|S,.NO_FL|
|00005270| 41 47 53 7d 2c 0a 23 65 | 6e 64 69 66 0a 2f 2a 20 |AGS},.#e|ndif./* |
|00005280| 20 24 20 20 6d 6f 76 65 | 20 74 6f 20 72 65 61 72 | $ move| to rear|
|00005290| 09 2a 2f 09 7b 6d 5f 72 | 65 61 72 2c 09 43 55 52 |.*/.{m_r|ear,.CUR|
|000052a0| 53 4f 52 2c 09 09 4d 56 | 4d 54 7c 49 4e 43 4c 7d |SOR,..MV|MT|INCL}|
|000052b0| 2c 0a 2f 2a 20 20 25 20 | 20 6d 6f 76 65 20 74 6f |,./* % | move to|
|000052c0| 20 6d 61 74 63 68 09 2a | 2f 09 7b 6d 5f 6d 61 74 | match.*|/.{m_mat|
|000052d0| 63 68 2c 09 43 55 52 53 | 4f 52 2c 09 09 4d 56 4d |ch,.CURS|OR,..MVM|
|000052e0| 54 7c 49 4e 43 4c 7d 2c | 0a 2f 2a 20 20 26 20 20 |T|INCL},|./* & |
|000052f0| 6e 6f 74 20 64 65 66 69 | 6e 65 64 09 2a 2f 09 7b |not defi|ned.*/.{|
|00005300| 4e 4f 5f 46 55 4e 43 2c | 09 4e 4f 5f 41 52 47 53 |NO_FUNC,|.NO_ARGS|
|00005310| 2c 09 4e 4f 5f 46 4c 41 | 47 53 7d 2c 0a 2f 2a 20 |,.NO_FLA|GS},./* |
|00005320| 20 27 20 20 6d 6f 76 65 | 20 74 6f 20 61 20 6d 61 | ' move| to a ma|
|00005330| 72 6b 09 2a 2f 09 7b 6d | 5f 74 6f 6d 61 72 6b 2c |rk.*/.{m|_tomark,|
|00005340| 09 43 55 52 53 4f 52 5f | 43 4e 54 5f 4b 45 59 2c |.CURSOR_|CNT_KEY,|
|00005350| 09 4d 56 4d 54 7c 46 52 | 4e 54 7c 4e 52 45 4c 7c |.MVMT|FR|NT|NREL||
|00005360| 4c 4e 4d 44 7d 2c 0a 23 | 69 66 6e 64 65 66 20 4e |LNMD},.#|ifndef N|
|00005370| 4f 5f 53 45 4e 54 45 4e | 43 45 0a 2f 2a 20 20 28 |O_SENTEN|CE./* (|
|00005380| 20 20 6d 76 20 62 61 63 | 6b 20 73 65 6e 74 65 6e | mv bac|k senten|
|00005390| 63 65 09 2a 2f 09 7b 6d | 5f 62 73 65 6e 74 65 6e |ce.*/.{m|_bsenten|
|000053a0| 63 65 2c 09 43 55 52 53 | 4f 52 5f 43 4f 55 4e 54 |ce,.CURS|OR_COUNT|
|000053b0| 2c 09 4d 56 4d 54 7d 2c | 0a 2f 2a 20 20 29 20 20 |,.MVMT},|./* ) |
|000053c0| 6d 76 20 66 77 64 20 73 | 65 6e 74 65 6e 63 65 09 |mv fwd s|entence.|
|000053d0| 2a 2f 09 7b 6d 5f 66 73 | 65 6e 74 65 6e 63 65 2c |*/.{m_fs|entence,|
|000053e0| 09 43 55 52 53 4f 52 5f | 43 4f 55 4e 54 2c 09 4d |.CURSOR_|COUNT,.M|
|000053f0| 56 4d 54 7d 2c 0a 23 65 | 6c 73 65 0a 2f 2a 20 20 |VMT},.#e|lse./* |
|00005400| 28 20 20 6e 6f 74 20 64 | 65 66 69 6e 65 64 09 2a |( not d|efined.*|
|00005410| 2f 09 7b 4e 4f 5f 46 55 | 4e 43 2c 09 4e 4f 5f 41 |/.{NO_FU|NC,.NO_A|
|00005420| 52 47 53 2c 09 4e 4f 5f | 46 4c 41 47 53 7d 2c 0a |RGS,.NO_|FLAGS},.|
|00005430| 2f 2a 20 20 29 20 20 6e | 6f 74 20 64 65 66 69 6e |/* ) n|ot defin|
|00005440| 65 64 09 2a 2f 09 7b 4e | 4f 5f 46 55 4e 43 2c 09 |ed.*/.{N|O_FUNC,.|
|00005450| 4e 4f 5f 41 52 47 53 2c | 09 4e 4f 5f 46 4c 41 47 |NO_ARGS,|.NO_FLAG|
|00005460| 53 7d 2c 0a 23 65 6e 64 | 69 66 0a 2f 2a 20 20 2a |S},.#end|if./* *|
|00005470| 20 20 6e 6f 74 20 64 65 | 66 69 6e 65 64 09 2a 2f | not de|fined.*/|
|00005480| 09 7b 4e 4f 5f 46 55 4e | 43 2c 09 4e 4f 5f 41 52 |.{NO_FUN|C,.NO_AR|
|00005490| 47 53 2c 09 4e 4f 5f 46 | 4c 41 47 53 7d 2c 0a 2f |GS,.NO_F|LAGS},./|
|000054a0| 2a 20 20 2b 20 20 6d 76 | 20 66 72 6f 6e 74 20 6e |* + mv| front n|
|000054b0| 65 78 74 20 6c 6e 20 2a | 2f 09 7b 6d 5f 64 6f 77 |ext ln *|/.{m_dow|
|000054c0| 6e 2c 09 43 55 52 53 4f | 52 5f 43 4f 55 4e 54 2c |n,.CURSO|R_COUNT,|
|000054d0| 09 4d 56 4d 54 7c 46 52 | 4e 54 7c 4c 4e 4d 44 7d |.MVMT|FR|NT|LNMD}|
|000054e0| 2c 0a 23 69 66 6e 64 65 | 66 20 4e 4f 5f 43 48 41 |,.#ifnde|f NO_CHA|
|000054f0| 52 53 45 41 52 43 48 0a | 2f 2a 20 20 2c 20 20 72 |RSEARCH.|/* , r|
|00005500| 65 76 65 72 73 65 20 5b | 66 46 74 54 5d 20 63 6d |everse [|fFtT] cm|
|00005510| 64 2a 2f 09 7b 6d 5f 5f | 63 68 2c 09 09 43 55 52 |d*/.{m__|ch,..CUR|
|00005520| 53 4f 52 5f 43 4e 54 5f | 43 4d 44 2c 09 4d 56 4d |SOR_CNT_|CMD,.MVM|
|00005530| 54 7c 49 4e 43 4c 7d 2c | 0a 23 65 6c 73 65 0a 2f |T|INCL},|.#else./|
|00005540| 2a 20 20 2c 20 20 6e 6f | 74 20 64 65 66 69 6e 65 |* , no|t define|
|00005550| 64 09 2a 2f 09 7b 4e 4f | 5f 46 55 4e 43 2c 09 4e |d.*/.{NO|_FUNC,.N|
|00005560| 4f 5f 41 52 47 53 2c 09 | 4e 4f 5f 46 4c 41 47 53 |O_ARGS,.|NO_FLAGS|
|00005570| 7d 2c 0a 23 65 6e 64 69 | 66 0a 2f 2a 20 20 2d 20 |},.#endi|f./* - |
|00005580| 20 6d 76 20 66 72 6f 6e | 74 20 70 72 65 76 20 6c | mv fron|t prev l|
|00005590| 6e 09 2a 2f 09 7b 6d 5f | 75 70 2c 09 09 43 55 52 |n.*/.{m_|up,..CUR|
|000055a0| 53 4f 52 5f 43 4f 55 4e | 54 2c 09 4d 56 4d 54 7c |SOR_COUN|T,.MVMT||
|000055b0| 46 52 4e 54 7c 4c 4e 4d | 44 7d 2c 0a 2f 2a 20 20 |FRNT|LNM|D},./* |
|000055c0| 2e 20 20 73 70 65 63 69 | 61 6c 2e 2e 2e 09 2a 2f |. speci|al....*/|
|000055d0| 09 7b 4e 4f 5f 46 55 4e | 43 2c 09 4e 4f 5f 41 52 |.{NO_FUN|C,.NO_AR|
|000055e0| 47 53 2c 09 4e 4f 5f 46 | 4c 41 47 53 7d 2c 0a 2f |GS,.NO_F|LAGS},./|
|000055f0| 2a 20 20 2f 20 20 66 6f | 72 77 61 72 64 20 73 65 |* / fo|rward se|
|00005600| 61 72 63 68 09 2a 2f 09 | 7b 6d 5f 66 73 72 63 68 |arch.*/.|{m_fsrch|
|00005610| 2c 09 43 55 52 53 4f 52 | 5f 54 45 58 54 2c 09 4d |,.CURSOR|_TEXT,.M|
|00005620| 56 4d 54 7c 4e 52 45 4c | 7d 2c 0a 2f 2a 20 20 30 |VMT|NREL|},./* 0|
|00005630| 20 20 70 61 72 74 20 6f | 66 20 63 6f 75 6e 74 3f | part o|f count?|
|00005640| 09 2a 2f 09 7b 4e 4f 5f | 46 55 4e 43 2c 09 5a 45 |.*/.{NO_|FUNC,.ZE|
|00005650| 52 4f 2c 09 09 4d 56 4d | 54 7c 50 54 4d 56 7d 2c |RO,..MVM|T|PTMV},|
|00005660| 0a 2f 2a 20 20 31 20 20 | 70 61 72 74 20 6f 66 20 |./* 1 |part of |
|00005670| 63 6f 75 6e 74 09 2a 2f | 09 7b 4e 4f 5f 46 55 4e |count.*/|.{NO_FUN|
|00005680| 43 2c 09 44 49 47 49 54 | 2c 09 09 50 54 4d 56 7d |C,.DIGIT|,..PTMV}|
|00005690| 2c 0a 2f 2a 20 20 32 20 | 20 70 61 72 74 20 6f 66 |,./* 2 | part of|
|000056a0| 20 63 6f 75 6e 74 09 2a | 2f 09 7b 4e 4f 5f 46 55 | count.*|/.{NO_FU|
|000056b0| 4e 43 2c 09 44 49 47 49 | 54 2c 09 09 50 54 4d 56 |NC,.DIGI|T,..PTMV|
|000056c0| 7d 2c 0a 2f 2a 20 20 33 | 20 20 70 61 72 74 20 6f |},./* 3| part o|
|000056d0| 66 20 63 6f 75 6e 74 09 | 2a 2f 09 7b 4e 4f 5f 46 |f count.|*/.{NO_F|
|000056e0| 55 4e 43 2c 09 44 49 47 | 49 54 2c 09 09 50 54 4d |UNC,.DIG|IT,..PTM|
|000056f0| 56 7d 2c 0a 2f 2a 20 20 | 34 20 20 70 61 72 74 20 |V},./* |4 part |
|00005700| 6f 66 20 63 6f 75 6e 74 | 09 2a 2f 09 7b 4e 4f 5f |of count|.*/.{NO_|
|00005710| 46 55 4e 43 2c 09 44 49 | 47 49 54 2c 09 09 50 54 |FUNC,.DI|GIT,..PT|
|00005720| 4d 56 7d 2c 0a 2f 2a 20 | 20 35 20 20 70 61 72 74 |MV},./* | 5 part|
|00005730| 20 6f 66 20 63 6f 75 6e | 74 09 2a 2f 09 7b 4e 4f | of coun|t.*/.{NO|
|00005740| 5f 46 55 4e 43 2c 09 44 | 49 47 49 54 2c 09 09 50 |_FUNC,.D|IGIT,..P|
|00005750| 54 4d 56 7d 2c 0a 2f 2a | 20 20 36 20 20 70 61 72 |TMV},./*| 6 par|
|00005760| 74 20 6f 66 20 63 6f 75 | 6e 74 09 2a 2f 09 7b 4e |t of cou|nt.*/.{N|
|00005770| 4f 5f 46 55 4e 43 2c 09 | 44 49 47 49 54 2c 09 09 |O_FUNC,.|DIGIT,..|
|00005780| 50 54 4d 56 7d 2c 0a 2f | 2a 20 20 37 20 20 70 61 |PTMV},./|* 7 pa|
|00005790| 72 74 20 6f 66 20 63 6f | 75 6e 74 09 2a 2f 09 7b |rt of co|unt.*/.{|
|000057a0| 4e 4f 5f 46 55 4e 43 2c | 09 44 49 47 49 54 2c 09 |NO_FUNC,|.DIGIT,.|
|000057b0| 09 50 54 4d 56 7d 2c 0a | 2f 2a 20 20 38 20 20 70 |.PTMV},.|/* 8 p|
|000057c0| 61 72 74 20 6f 66 20 63 | 6f 75 6e 74 09 2a 2f 09 |art of c|ount.*/.|
|000057d0| 7b 4e 4f 5f 46 55 4e 43 | 2c 09 44 49 47 49 54 2c |{NO_FUNC|,.DIGIT,|
|000057e0| 09 09 50 54 4d 56 7d 2c | 0a 2f 2a 20 20 39 20 20 |..PTMV},|./* 9 |
|000057f0| 70 61 72 74 20 6f 66 20 | 63 6f 75 6e 74 09 2a 2f |part of |count.*/|
|00005800| 09 7b 4e 4f 5f 46 55 4e | 43 2c 09 44 49 47 49 54 |.{NO_FUN|C,.DIGIT|
|00005810| 2c 09 09 50 54 4d 56 7d | 2c 0a 2f 2a 20 20 3a 20 |,..PTMV}|,./* : |
|00005820| 20 72 75 6e 20 73 69 6e | 67 6c 65 20 45 58 20 63 | run sin|gle EX c|
|00005830| 6d 64 2a 2f 09 7b 76 5f | 31 65 78 2c 09 09 43 55 |md*/.{v_|1ex,..CU|
|00005840| 52 53 4f 52 5f 54 45 58 | 54 2c 09 4e 4f 5f 46 4c |RSOR_TEX|T,.NO_FL|
|00005850| 41 47 53 7d 2c 0a 23 69 | 66 6e 64 65 66 20 4e 4f |AGS},.#i|fndef NO|
|00005860| 5f 43 48 41 52 53 45 41 | 52 43 48 0a 2f 2a 20 20 |_CHARSEA|RCH./* |
|00005870| 3b 20 20 72 65 70 65 61 | 74 20 5b 66 46 74 54 5d |; repea|t [fFtT]|
|00005880| 20 63 6d 64 2a 2f 09 7b | 6d 5f 5f 63 68 2c 09 09 | cmd*/.{|m__ch,..|
|00005890| 43 55 52 53 4f 52 5f 43 | 4e 54 5f 43 4d 44 2c 09 |CURSOR_C|NT_CMD,.|
|000058a0| 4d 56 4d 54 7c 49 4e 43 | 4c 7d 2c 0a 23 65 6c 73 |MVMT|INC|L},.#els|
|000058b0| 65 0a 2f 2a 20 20 3b 20 | 20 6e 6f 74 20 64 65 66 |e./* ; | not def|
|000058c0| 69 6e 65 64 09 2a 2f 09 | 7b 4e 4f 5f 46 55 4e 43 |ined.*/.|{NO_FUNC|
|000058d0| 2c 09 4e 4f 5f 41 52 47 | 53 2c 09 4e 4f 5f 46 4c |,.NO_ARG|S,.NO_FL|
|000058e0| 41 47 53 7d 2c 0a 23 65 | 6e 64 69 66 0a 2f 2a 20 |AGS},.#e|ndif./* |
|000058f0| 20 3c 20 20 73 68 69 66 | 74 20 74 65 78 74 20 6c | < shif|t text l|
|00005900| 65 66 74 09 2a 2f 09 7b | 76 5f 6c 73 68 69 66 74 |eft.*/.{|v_lshift|
|00005910| 2c 09 43 55 52 53 4f 52 | 5f 4d 4f 56 45 44 2c 09 |,.CURSOR|_MOVED,.|
|00005920| 53 44 4f 54 7c 46 52 4e | 54 7d 2c 0a 2f 2a 20 20 |SDOT|FRN|T},./* |
|00005930| 3d 20 20 6e 6f 74 20 64 | 65 66 69 6e 65 64 09 2a |= not d|efined.*|
|00005940| 2f 09 7b 4e 4f 5f 46 55 | 4e 43 2c 09 4e 4f 5f 41 |/.{NO_FU|NC,.NO_A|
|00005950| 52 47 53 2c 09 4e 4f 5f | 46 4c 41 47 53 7d 2c 0a |RGS,.NO_|FLAGS},.|
|00005960| 2f 2a 20 20 3e 20 20 73 | 68 69 66 74 20 74 65 78 |/* > s|hift tex|
|00005970| 74 20 72 69 67 68 74 09 | 2a 2f 09 7b 76 5f 72 73 |t right.|*/.{v_rs|
|00005980| 68 69 66 74 2c 09 43 55 | 52 53 4f 52 5f 4d 4f 56 |hift,.CU|RSOR_MOV|
|00005990| 45 44 2c 09 53 44 4f 54 | 7c 46 52 4e 54 7d 2c 0a |ED,.SDOT||FRNT},.|
|000059a0| 2f 2a 20 20 3f 20 20 62 | 61 63 6b 77 61 72 64 20 |/* ? b|ackward |
|000059b0| 73 65 61 72 63 68 09 2a | 2f 09 7b 6d 5f 62 73 72 |search.*|/.{m_bsr|
|000059c0| 63 68 2c 09 43 55 52 53 | 4f 52 5f 54 45 58 54 2c |ch,.CURS|OR_TEXT,|
|000059d0| 09 4d 56 4d 54 7c 4e 52 | 45 4c 7d 2c 0a 2f 2a 20 |.MVMT|NR|EL},./* |
|000059e0| 20 40 20 20 6e 6f 74 20 | 64 65 66 69 6e 65 64 09 | @ not |defined.|
|000059f0| 2a 2f 09 7b 4e 4f 5f 46 | 55 4e 43 2c 09 4e 4f 5f |*/.{NO_F|UNC,.NO_|
|00005a00| 41 52 47 53 2c 09 4e 4f | 5f 46 4c 41 47 53 7d 2c |ARGS,.NO|_FLAGS},|
|00005a10| 0a 2f 2a 20 20 41 20 20 | 61 70 70 65 6e 64 20 61 |./* A |append a|
|00005a20| 74 20 45 4f 4c 09 2a 2f | 09 7b 76 5f 69 6e 73 65 |t EOL.*/|.{v_inse|
|00005a30| 72 74 2c 09 43 55 52 53 | 4f 52 5f 43 4e 54 5f 43 |rt,.CURS|OR_CNT_C|
|00005a40| 4d 44 2c 09 53 44 4f 54 | 7d 2c 0a 2f 2a 20 20 42 |MD,.SDOT|},./* B|
|00005a50| 20 20 6d 6f 76 65 20 62 | 61 63 6b 20 57 6f 72 64 | move b|ack Word|
|00005a60| 09 2a 2f 09 7b 6d 5f 62 | 57 6f 72 64 2c 09 43 55 |.*/.{m_b|Word,.CU|
|00005a70| 52 53 4f 52 5f 43 4f 55 | 4e 54 2c 09 4d 56 4d 54 |RSOR_COU|NT,.MVMT|
|00005a80| 7d 2c 0a 2f 2a 20 20 43 | 20 20 63 68 61 6e 67 65 |},./* C| change|
|00005a90| 20 74 6f 20 45 4f 4c 09 | 2a 2f 09 7b 76 5f 63 68 | to EOL.|*/.{v_ch|
|00005aa0| 61 6e 67 65 2c 09 43 55 | 52 53 4f 52 5f 45 4f 4c |ange,.CU|RSOR_EOL|
|00005ab0| 2c 09 53 44 4f 54 7d 2c | 0a 2f 2a 20 20 44 20 20 |,.SDOT},|./* D |
|00005ac0| 64 65 6c 65 74 65 20 74 | 6f 20 45 4f 4c 09 2a 2f |delete t|o EOL.*/|
|00005ad0| 09 7b 76 5f 64 65 6c 65 | 74 65 2c 09 43 55 52 53 |.{v_dele|te,.CURS|
|00005ae0| 4f 52 5f 45 4f 4c 2c 09 | 53 44 4f 54 7d 2c 0a 2f |OR_EOL,.|SDOT},./|
|00005af0| 2a 20 20 45 20 20 6d 6f | 76 65 20 65 6e 64 20 6f |* E mo|ve end o|
|00005b00| 66 20 57 6f 72 64 09 2a | 2f 09 7b 6d 5f 65 57 6f |f Word.*|/.{m_eWo|
|00005b10| 72 64 2c 09 43 55 52 53 | 4f 52 5f 43 4f 55 4e 54 |rd,.CURS|OR_COUNT|
|00005b20| 2c 09 4d 56 4d 54 7c 49 | 4e 43 4c 7d 2c 0a 23 69 |,.MVMT|I|NCL},.#i|
|00005b30| 66 6e 64 65 66 20 4e 4f | 5f 43 48 41 52 53 45 41 |fndef NO|_CHARSEA|
|00005b40| 52 43 48 0a 2f 2a 20 20 | 46 20 20 6d 6f 76 65 20 |RCH./* |F move |
|00005b50| 62 6b 20 74 6f 20 63 68 | 61 72 09 2a 2f 09 7b 6d |bk to ch|ar.*/.{m|
|00005b60| 5f 46 63 68 2c 09 09 43 | 55 52 53 4f 52 5f 43 4e |_Fch,..C|URSOR_CN|
|00005b70| 54 5f 4b 45 59 2c 09 4d | 56 4d 54 7c 49 4e 43 4c |T_KEY,.M|VMT|INCL|
|00005b80| 7d 2c 0a 23 65 6c 73 65 | 0a 2f 2a 20 20 46 20 20 |},.#else|./* F |
|00005b90| 6e 6f 74 20 64 65 66 69 | 6e 65 64 09 2a 2f 09 7b |not defi|ned.*/.{|
|00005ba0| 4e 4f 5f 46 55 4e 43 2c | 09 4e 4f 5f 41 52 47 53 |NO_FUNC,|.NO_ARGS|
|00005bb0| 2c 09 4e 4f 5f 46 4c 41 | 47 53 7d 2c 0a 23 65 6e |,.NO_FLA|GS},.#en|
|00005bc0| 64 69 66 0a 2f 2a 20 20 | 47 20 20 6d 6f 76 65 20 |dif./* |G move |
|00005bd0| 74 6f 20 6c 69 6e 65 20 | 23 09 2a 2f 09 7b 6d 5f |to line |#.*/.{m_|
|00005be0| 74 6f 6c 69 6e 65 2c 09 | 43 55 52 53 4f 52 5f 43 |toline,.|CURSOR_C|
|00005bf0| 4f 55 4e 54 2c 09 4d 56 | 4d 54 7c 4e 52 45 4c 7c |OUNT,.MV|MT|NREL||
|00005c00| 4c 4e 4d 44 7d 2c 0a 2f | 2a 20 20 48 20 20 6d 6f |LNMD},./|* H mo|
|00005c10| 76 65 20 74 6f 20 72 6f | 77 09 2a 2f 09 7b 6d 5f |ve to ro|w.*/.{m_|
|00005c20| 72 6f 77 2c 09 09 43 55 | 52 53 4f 52 5f 43 4e 54 |row,..CU|RSOR_CNT|
|00005c30| 5f 43 4d 44 2c 09 4d 56 | 4d 54 7c 46 52 4e 54 7d |_CMD,.MV|MT|FRNT}|
|00005c40| 2c 0a 2f 2a 20 20 49 20 | 20 69 6e 73 65 72 74 20 |,./* I | insert |
|00005c50| 61 74 20 66 72 6f 6e 74 | 09 2a 2f 09 7b 76 5f 69 |at front|.*/.{v_i|
|00005c60| 6e 73 65 72 74 2c 09 43 | 55 52 53 4f 52 5f 43 4e |nsert,.C|URSOR_CN|
|00005c70| 54 5f 43 4d 44 2c 09 53 | 44 4f 54 7d 2c 0a 2f 2a |T_CMD,.S|DOT},./*|
|00005c80| 20 20 4a 20 20 6a 6f 69 | 6e 20 6c 69 6e 65 73 09 | J joi|n lines.|
|00005c90| 2a 2f 09 7b 76 5f 6a 6f | 69 6e 2c 09 43 55 52 53 |*/.{v_jo|in,.CURS|
|00005ca0| 4f 52 5f 43 4f 55 4e 54 | 2c 09 53 44 4f 54 7d 2c |OR_COUNT|,.SDOT},|
|00005cb0| 0a 23 69 66 6e 64 65 66 | 20 4e 4f 5f 45 58 54 45 |.#ifndef| NO_EXTE|
|00005cc0| 4e 53 49 4f 4e 53 0a 2f | 2a 20 20 4b 20 20 6c 6f |NSIONS./|* K lo|
|00005cd0| 6f 6b 20 75 70 20 6b 65 | 79 77 6f 72 64 09 2a 2f |ok up ke|yword.*/|
|00005ce0| 09 7b 76 5f 6b 65 79 77 | 6f 72 64 2c 09 4b 45 59 |.{v_keyw|ord,.KEY|
|00005cf0| 57 4f 52 44 2c 09 4e 4f | 5f 46 4c 41 47 53 7d 2c |WORD,.NO|_FLAGS},|
|00005d00| 0a 23 65 6c 73 65 0a 2f | 2a 20 20 4b 20 20 6e 6f |.#else./|* K no|
|00005d10| 74 20 64 65 66 69 6e 65 | 64 09 2a 2f 09 7b 4e 4f |t define|d.*/.{NO|
|00005d20| 5f 46 55 4e 43 2c 09 4e | 4f 5f 41 52 47 53 2c 09 |_FUNC,.N|O_ARGS,.|
|00005d30| 4e 4f 5f 46 4c 41 47 53 | 7d 2c 0a 23 65 6e 64 69 |NO_FLAGS|},.#endi|
|00005d40| 66 0a 2f 2a 20 20 4c 20 | 20 6d 6f 76 65 20 74 6f |f./* L | move to|
|00005d50| 20 6c 61 73 74 20 72 6f | 77 09 2a 2f 09 7b 6d 5f | last ro|w.*/.{m_|
|00005d60| 72 6f 77 2c 09 09 43 55 | 52 53 4f 52 5f 43 4e 54 |row,..CU|RSOR_CNT|
|00005d70| 5f 43 4d 44 2c 09 4d 56 | 4d 54 7c 46 52 4e 54 7d |_CMD,.MV|MT|FRNT}|
|00005d80| 2c 0a 2f 2a 20 20 4d 20 | 20 6d 6f 76 65 20 74 6f |,./* M | move to|
|00005d90| 20 6d 69 64 20 72 6f 77 | 09 2a 2f 09 7b 6d 5f 72 | mid row|.*/.{m_r|
|00005da0| 6f 77 2c 09 09 43 55 52 | 53 4f 52 5f 43 4e 54 5f |ow,..CUR|SOR_CNT_|
|00005db0| 43 4d 44 2c 09 4d 56 4d | 54 7c 46 52 4e 54 7d 2c |CMD,.MVM|T|FRNT},|
|00005dc0| 0a 2f 2a 20 20 4e 20 20 | 72 65 76 65 72 73 65 20 |./* N |reverse |
|00005dd0| 70 72 65 76 20 73 72 63 | 68 2a 2f 09 7b 6d 5f 4e |prev src|h*/.{m_N|
|00005de0| 73 72 63 68 2c 09 43 55 | 52 53 4f 52 2c 09 09 4d |srch,.CU|RSOR,..M|
|00005df0| 56 4d 54 7d 2c 0a 2f 2a | 20 20 4f 20 20 69 6e 73 |VMT},./*| O ins|
|00005e00| 65 72 74 20 61 62 6f 76 | 65 20 6c 69 6e 65 2a 2f |ert abov|e line*/|
|00005e10| 09 7b 76 5f 69 6e 73 65 | 72 74 2c 09 43 55 52 53 |.{v_inse|rt,.CURS|
|00005e20| 4f 52 5f 43 4e 54 5f 43 | 4d 44 2c 09 53 44 4f 54 |OR_CNT_C|MD,.SDOT|
|00005e30| 7d 2c 0a 2f 2a 20 20 50 | 20 20 70 61 73 74 65 20 |},./* P| paste |
|00005e40| 62 65 66 6f 72 65 09 2a | 2f 09 7b 76 5f 70 61 73 |before.*|/.{v_pas|
|00005e50| 74 65 2c 09 43 55 52 53 | 4f 52 5f 43 4e 54 5f 43 |te,.CURS|OR_CNT_C|
|00005e60| 4d 44 2c 09 4e 4f 5f 46 | 4c 41 47 53 7d 2c 0a 2f |MD,.NO_F|LAGS},./|
|00005e70| 2a 20 20 51 20 20 71 75 | 69 74 20 74 6f 20 45 58 |* Q qu|it to EX|
|00005e80| 20 6d 6f 64 65 09 2a 2f | 09 7b 76 5f 71 75 69 74 | mode.*/|.{v_quit|
|00005e90| 2c 09 4e 4f 5f 41 52 47 | 53 2c 09 4e 4f 5f 46 4c |,.NO_ARG|S,.NO_FL|
|00005ea0| 41 47 53 7d 2c 0a 2f 2a | 20 20 52 20 20 6f 76 65 |AGS},./*| R ove|
|00005eb0| 72 74 79 70 65 09 09 2a | 2f 09 7b 76 5f 6f 76 65 |rtype..*|/.{v_ove|
|00005ec0| 72 74 79 70 65 2c 09 43 | 55 52 53 4f 52 2c 09 09 |rtype,.C|URSOR,..|
|00005ed0| 53 44 4f 54 7d 2c 0a 2f | 2a 20 20 53 20 20 63 68 |SDOT},./|* S ch|
|00005ee0| 61 6e 67 65 20 6c 69 6e | 65 09 2a 2f 09 7b 76 5f |ange lin|e.*/.{v_|
|00005ef0| 63 68 61 6e 67 65 2c 09 | 43 55 52 53 4f 52 5f 4d |change,.|CURSOR_M|
|00005f00| 4f 56 45 44 2c 09 53 44 | 4f 54 7d 2c 0a 23 69 66 |OVED,.SD|OT},.#if|
|00005f10| 6e 64 65 66 20 4e 4f 5f | 43 48 41 52 53 45 41 52 |ndef NO_|CHARSEAR|
|00005f20| 43 48 0a 2f 2a 20 20 54 | 20 20 6d 6f 76 65 20 62 |CH./* T| move b|
|00005f30| 6b 20 74 6f 20 63 68 61 | 72 09 2a 2f 09 7b 6d 5f |k to cha|r.*/.{m_|
|00005f40| 54 63 68 2c 09 09 43 55 | 52 53 4f 52 5f 43 4e 54 |Tch,..CU|RSOR_CNT|
|00005f50| 5f 4b 45 59 2c 09 4d 56 | 4d 54 7c 49 4e 43 4c 7d |_KEY,.MV|MT|INCL}|
|00005f60| 2c 0a 23 65 6c 73 65 0a | 2f 2a 20 20 54 20 20 6e |,.#else.|/* T n|
|00005f70| 6f 74 20 64 65 66 69 6e | 65 64 09 2a 2f 09 7b 4e |ot defin|ed.*/.{N|
|00005f80| 4f 5f 46 55 4e 43 2c 09 | 4e 4f 5f 41 52 47 53 2c |O_FUNC,.|NO_ARGS,|
|00005f90| 09 4e 4f 5f 46 4c 41 47 | 53 7d 2c 0a 23 65 6e 64 |.NO_FLAG|S},.#end|
|00005fa0| 69 66 0a 2f 2a 20 20 55 | 20 20 75 6e 64 6f 20 77 |if./* U| undo w|
|00005fb0| 68 6f 6c 65 20 6c 69 6e | 65 09 2a 2f 09 7b 76 5f |hole lin|e.*/.{v_|
|00005fc0| 75 6e 64 6f 6c 69 6e 65 | 2c 09 43 55 52 53 4f 52 |undoline|,.CURSOR|
|00005fd0| 2c 09 09 46 52 4e 54 7d | 2c 0a 2f 2a 20 20 56 20 |,..FRNT}|,./* V |
|00005fe0| 20 6e 6f 74 20 64 65 66 | 69 6e 65 64 09 2a 2f 09 | not def|ined.*/.|
|00005ff0| 7b 4e 4f 5f 46 55 4e 43 | 2c 09 4e 4f 5f 41 52 47 |{NO_FUNC|,.NO_ARG|
|00006000| 53 2c 09 4e 4f 5f 46 4c | 41 47 53 7d 2c 0a 2f 2a |S,.NO_FL|AGS},./*|
|00006010| 20 20 57 20 20 6d 6f 76 | 65 20 66 6f 72 77 61 72 | W mov|e forwar|
|00006020| 64 20 57 6f 72 64 2a 2f | 09 7b 6d 5f 66 57 6f 72 |d Word*/|.{m_fWor|
|00006030| 64 2c 09 43 55 52 53 4f | 52 5f 43 4f 55 4e 54 2c |d,.CURSO|R_COUNT,|
|00006040| 09 4d 56 4d 54 7d 2c 0a | 2f 2a 20 20 58 20 20 64 |.MVMT},.|/* X d|
|00006050| 65 6c 65 74 65 20 74 6f | 20 6c 65 66 74 09 2a 2f |elete to| left.*/|
|00006060| 09 7b 76 5f 58 63 68 61 | 72 2c 09 43 55 52 53 4f |.{v_Xcha|r,.CURSO|
|00006070| 52 5f 43 4f 55 4e 54 2c | 09 53 44 4f 54 7d 2c 0a |R_COUNT,|.SDOT},.|
|00006080| 2f 2a 20 20 59 20 20 79 | 61 6e 6b 20 74 65 78 74 |/* Y y|ank text|
|00006090| 09 2a 2f 09 7b 76 5f 79 | 61 6e 6b 2c 09 43 55 52 |.*/.{v_y|ank,.CUR|
|000060a0| 53 4f 52 5f 4d 4f 56 45 | 44 2c 09 4e 4f 5f 46 4c |SOR_MOVE|D,.NO_FL|
|000060b0| 41 47 53 7d 2c 0a 2f 2a | 20 20 5a 20 20 73 61 76 |AGS},./*| Z sav|
|000060c0| 65 20 66 69 6c 65 20 26 | 20 65 78 69 74 09 2a 2f |e file &| exit.*/|
|000060d0| 09 7b 76 5f 78 69 74 2c | 09 09 43 55 52 53 4f 52 |.{v_xit,|..CURSOR|
|000060e0| 5f 43 4e 54 5f 4b 45 59 | 2c 09 4e 4f 5f 46 4c 41 |_CNT_KEY|,.NO_FLA|
|000060f0| 47 53 7d 2c 0a 2f 2a 20 | 20 5b 20 20 6d 6f 76 65 |GS},./* | [ move|
|00006100| 20 62 61 63 6b 20 73 65 | 63 74 69 6f 6e 2a 2f 09 | back se|ction*/.|
|00006110| 7b 6d 5f 62 73 65 63 74 | 69 6f 6e 2c 09 43 55 52 |{m_bsect|ion,.CUR|
|00006120| 53 4f 52 5f 43 4e 54 5f | 4b 45 59 2c 09 4d 56 4d |SOR_CNT_|KEY,.MVM|
|00006130| 54 7c 4c 4e 4d 44 7c 4e | 52 45 4c 7d 2c 0a 2f 2a |T|LNMD|N|REL},./*|
|00006140| 20 20 5c 20 20 6e 6f 74 | 20 64 65 66 69 6e 65 64 | \ not| defined|
|00006150| 09 2a 2f 09 7b 4e 4f 5f | 46 55 4e 43 2c 09 4e 4f |.*/.{NO_|FUNC,.NO|
|00006160| 5f 41 52 47 53 2c 09 4e | 4f 5f 46 4c 41 47 53 7d |_ARGS,.N|O_FLAGS}|
|00006170| 2c 0a 2f 2a 20 20 5d 20 | 20 6d 6f 76 65 20 66 77 |,./* ] | move fw|
|00006180| 64 20 73 65 63 74 69 6f | 6e 20 2a 2f 09 7b 6d 5f |d sectio|n */.{m_|
|00006190| 66 73 65 63 74 69 6f 6e | 2c 09 43 55 52 53 4f 52 |fsection|,.CURSOR|
|000061a0| 5f 43 4e 54 5f 4b 45 59 | 2c 09 4d 56 4d 54 7c 4c |_CNT_KEY|,.MVMT|L|
|000061b0| 4e 4d 44 7c 4e 52 45 4c | 7d 2c 0a 2f 2a 20 20 5e |NMD|NREL|},./* ^|
|000061c0| 20 20 6d 6f 76 65 20 74 | 6f 20 66 72 6f 6e 74 09 | move t|o front.|
|000061d0| 2a 2f 09 7b 6d 5f 66 72 | 6f 6e 74 2c 09 43 55 52 |*/.{m_fr|ont,.CUR|
|000061e0| 53 4f 52 2c 09 09 4d 56 | 4d 54 7d 2c 0a 2f 2a 20 |SOR,..MV|MT},./* |
|000061f0| 20 5f 20 20 6e 6f 74 20 | 64 65 66 69 6e 65 64 09 | _ not |defined.|
|00006200| 2a 2f 09 7b 4e 4f 5f 46 | 55 4e 43 2c 09 4e 4f 5f |*/.{NO_F|UNC,.NO_|
|00006210| 41 52 47 53 2c 09 4e 4f | 5f 46 4c 41 47 53 7d 2c |ARGS,.NO|_FLAGS},|
|00006220| 0a 2f 2a 20 20 60 20 20 | 6d 6f 76 65 20 74 6f 20 |./* ` |move to |
|00006230| 6d 61 72 6b 09 2a 2f 09 | 7b 6d 5f 74 6f 6d 61 72 |mark.*/.|{m_tomar|
|00006240| 6b 2c 09 43 55 52 53 4f | 52 5f 43 4e 54 5f 4b 45 |k,.CURSO|R_CNT_KE|
|00006250| 59 2c 09 4d 56 4d 54 7c | 4e 52 45 4c 7d 2c 0a 2f |Y,.MVMT||NREL},./|
|00006260| 2a 20 20 61 20 20 61 70 | 70 65 6e 64 20 61 74 20 |* a ap|pend at |
|00006270| 63 75 72 73 6f 72 09 2a | 2f 09 7b 76 5f 69 6e 73 |cursor.*|/.{v_ins|
|00006280| 65 72 74 2c 09 43 55 52 | 53 4f 52 5f 43 4e 54 5f |ert,.CUR|SOR_CNT_|
|00006290| 43 4d 44 2c 09 53 44 4f | 54 7d 2c 0a 2f 2a 20 20 |CMD,.SDO|T},./* |
|000062a0| 62 20 20 6d 6f 76 65 20 | 62 61 63 6b 20 77 6f 72 |b move |back wor|
|000062b0| 64 09 2a 2f 09 7b 6d 5f | 62 77 6f 72 64 2c 09 43 |d.*/.{m_|bword,.C|
|000062c0| 55 52 53 4f 52 5f 43 4f | 55 4e 54 2c 09 4d 56 4d |URSOR_CO|UNT,.MVM|
|000062d0| 54 7d 2c 0a 2f 2a 20 20 | 63 20 20 63 68 61 6e 67 |T},./* |c chang|
|000062e0| 65 20 74 65 78 74 09 2a | 2f 09 7b 76 5f 63 68 61 |e text.*|/.{v_cha|
|000062f0| 6e 67 65 2c 09 43 55 52 | 53 4f 52 5f 4d 4f 56 45 |nge,.CUR|SOR_MOVE|
|00006300| 44 2c 09 53 44 4f 54 7d | 2c 0a 2f 2a 20 20 64 20 |D,.SDOT}|,./* d |
|00006310| 20 64 65 6c 65 74 65 20 | 6f 70 09 2a 2f 09 7b 76 | delete |op.*/.{v|
|00006320| 5f 64 65 6c 65 74 65 2c | 09 43 55 52 53 4f 52 5f |_delete,|.CURSOR_|
|00006330| 4d 4f 56 45 44 2c 09 53 | 44 4f 54 7d 2c 0a 2f 2a |MOVED,.S|DOT},./*|
|00006340| 20 20 65 20 20 6d 6f 76 | 65 20 65 6e 64 20 77 6f | e mov|e end wo|
|00006350| 72 64 09 2a 2f 09 7b 6d | 5f 65 77 6f 72 64 2c 09 |rd.*/.{m|_eword,.|
|00006360| 43 55 52 53 4f 52 5f 43 | 4f 55 4e 54 2c 09 4d 56 |CURSOR_C|OUNT,.MV|
|00006370| 4d 54 7c 49 4e 43 4c 7d | 2c 0a 23 69 66 6e 64 65 |MT|INCL}|,.#ifnde|
|00006380| 66 20 4e 4f 5f 43 48 41 | 52 53 45 41 52 43 48 0a |f NO_CHA|RSEARCH.|
|00006390| 2f 2a 20 20 66 20 20 6d | 6f 76 65 20 66 77 64 20 |/* f m|ove fwd |
|000063a0| 66 6f 72 20 63 68 61 72 | 2a 2f 09 7b 6d 5f 66 63 |for char|*/.{m_fc|
|000063b0| 68 2c 09 09 43 55 52 53 | 4f 52 5f 43 4e 54 5f 4b |h,..CURS|OR_CNT_K|
|000063c0| 45 59 2c 09 4d 56 4d 54 | 7c 49 4e 43 4c 7d 2c 0a |EY,.MVMT||INCL},.|
|000063d0| 23 65 6c 73 65 0a 2f 2a | 20 20 66 20 20 6e 6f 74 |#else./*| f not|
|000063e0| 20 64 65 66 69 6e 65 64 | 09 2a 2f 09 7b 4e 4f 5f | defined|.*/.{NO_|
|000063f0| 46 55 4e 43 2c 09 4e 4f | 5f 41 52 47 53 2c 09 4e |FUNC,.NO|_ARGS,.N|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.