From 4af93d53e35d95b8398de262a30b2f0d9481b77b Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 4 Jun 2020 22:54:27 -0400 Subject: [PATCH] VE: add I command Also, add insert and find buffers to the header, making it 3 lines high. Also, fix the "I" overshadowing word which wasn't operating on the proper RSP level. Also, fix I which didn't mark the block as dirty. --- blk/108 | 4 ++-- blk/122 | 3 +++ blk/126 | 2 +- blk/127 | 3 ++- blk/129 | 14 ++++++++++++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/blk/108 b/blk/108 index 761da06..3a2d8e6 100644 --- a/blk/108 +++ b/blk/108 @@ -2,7 +2,7 @@ DUP BEGIN C@+ EOL? UNTIL -^ 1- ; : _rbufsz ( size of linebuf to the right of curpos ) EDPOS @ 64 MOD 63 -^ ; -: i I ; ( save overshoadowed ) +: i COMPILE I ; IMMEDIATE ( save overshadowed ) : I IBUF _type _rbufsz IBUF _blen 2DUP > IF TUCK - ( ilen chars-to-move ) @@ -12,5 +12,5 @@ ELSE DROP ( ilen becomes rbuffsize ) THEN DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen ) - EDPOS +! EDPOS @ 64 / _pln + BLK!! EDPOS +! EDPOS @ 64 / _pln ; diff --git a/blk/122 b/blk/122 index 7346d56..966de1a 100644 --- a/blk/122 +++ b/blk/122 @@ -1,3 +1,6 @@ 'H' goes to the beginning of the line, 'L' to the end. 'w' moves forward by a word. 'W' moves backward by a word. + +'I' inserts text by calling the "I" command from the Block +editor. diff --git a/blk/126 b/blk/126 index 329382a..9b6d2fe 100644 --- a/blk/126 +++ b/blk/126 @@ -9,5 +9,5 @@ VARIABLE MODE VARIABLE MODEC : clrscr LINES 0 DO i clrln LOOP ; : status 0 clrln ." BLK" SPC BLK> ? SPC ACC ? SPC EDPOS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ; -: contents 1 aty BLK> @ LIST ; +: contents 3 aty BLK> @ LIST ; : selblk BLK@ contents ; diff --git a/blk/127 b/blk/127 index 9119bbb..24ebb2a 100644 --- a/blk/127 +++ b/blk/127 @@ -1,11 +1,12 @@ : setpos EDPOS @ 64 /MOD - 1+ ( status line ) SWAP 3 + ( gutter ) SWAP AT-XY ; + 3 + ( header ) SWAP 3 + ( gutter ) SWAP AT-XY ; : pos+ EDPOS @ + 1024 MOD EDPOS ! ; : cmv ( n -- , char movement ) acc@ * pos+ ; : $; 0acc ; : $g ACC @ selblk 0acc ; : $[ BLK> @ acc@ - selblk ; : $] BLK> @ acc@ + selblk ; +: $I 3 1 AT-XY I contents ; : $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ; : $H 0acc EDPOS @ 0x3c0 AND EDPOS ! ; : $L 0acc EDPOS @ 0x3f OR EDPOS ! ; diff --git a/blk/129 b/blk/129 index 71d3301..ea3e751 100644 --- a/blk/129 +++ b/blk/129 @@ -1,3 +1,13 @@ -: VE clrscr 0acc 0 EDPOS ! modeM contents - BEGIN status setpos KEY MODE @ EXECUTE UNTIL 18 aty ; +: bufp ( buf -- ) + DUP 64 + SWAP DO + i C@ DUP 0x20 < IF DROP 0x20 THEN EMIT + LOOP ; +: bufs + 1 aty ." I: " IBUF bufp + 2 aty ." F: " FBUF bufp ; +: c