VE: load Block Editor and reuse some of its words
This commit is contained in:
parent
297c187426
commit
e36080d7b8
2
blk/101
2
blk/101
@ -5,7 +5,7 @@ F xxx: find typed string in block.
|
||||
I xxx: insert typed string at cursor.
|
||||
E: Delete previously found string.
|
||||
|
||||
|
||||
Note that "I" shadows core word. Use "i" to access core word.
|
||||
|
||||
|
||||
|
||||
|
4
blk/102
4
blk/102
@ -1,5 +1,5 @@
|
||||
'? CASE NOT [IF] 51 52 LOADR+ [THEN] DROP ( B152-153 )
|
||||
'? FILL NOT [IF] 53 LOAD+ [THEN] DROP ( B154 )
|
||||
'? FILL NOT [IF] 53 LOAD+ [THEN] DROP ( B155 )
|
||||
1 7 LOADR+
|
||||
: BROWSE
|
||||
0 ACC ! L
|
||||
@ -12,5 +12,3 @@
|
||||
ENDCASE
|
||||
AGAIN
|
||||
;
|
||||
( I masks DO..LOOP's I. Do it as late as possible. )
|
||||
: I _I ;
|
||||
|
3
blk/108
3
blk/108
@ -2,7 +2,8 @@
|
||||
DUP BEGIN C@+ EOL? UNTIL -^ 1- ;
|
||||
: _rbufsz ( size of linebuf to the right of curpos )
|
||||
EDPOS @ 64 MOD 63 -^ ;
|
||||
: _I
|
||||
: i I ; ( save overshoadowed )
|
||||
: I
|
||||
IBUF _type _rbufsz IBUF _blen 2DUP > IF
|
||||
TUCK - ( ilen chars-to-move )
|
||||
SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen )
|
||||
|
4
blk/120
4
blk/120
@ -4,7 +4,8 @@ This editor, unlike the Block Editor (B100), is grid-based
|
||||
instead of being command-based. It requires the AT-XY, COLS
|
||||
and LINES words to be implemented.
|
||||
|
||||
It is loaded with "125 LOAD" and invoked with "VE".
|
||||
It is loaded with "125 LOAD" and invoked with "VE". Note that
|
||||
this also fully loads the Block Editor (B100).
|
||||
|
||||
This editor uses 17 lines. The top line is the status line and
|
||||
the 16 others are contents lines. The content shown is that
|
||||
@ -12,5 +13,4 @@ of the currently selected block.
|
||||
|
||||
All keystrokes are directly interpreted by VE and have the
|
||||
effect described below.
|
||||
|
||||
(cont.)
|
||||
|
1
blk/125
1
blk/125
@ -1,2 +1,3 @@
|
||||
'? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 )
|
||||
-23 LOAD+ ( B102, block editor )
|
||||
1 4 LOADR+
|
||||
|
6
blk/126
6
blk/126
@ -1,13 +1,13 @@
|
||||
CREATE CMD 2 C, '$' C, 0 C,
|
||||
VARIABLE MODE VARIABLE MODEC VARIABLE ACC VARIABLE POS
|
||||
VARIABLE MODE VARIABLE MODEC
|
||||
: 0acc 0 ACC ! ;
|
||||
: acc@ ACC @ 1 MAX 0acc ;
|
||||
: num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ;
|
||||
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
|
||||
: aty 0 SWAP AT-XY ;
|
||||
: clrln DUP aty COLS nspcs aty ;
|
||||
: clrscr LINES 0 DO I clrln LOOP ;
|
||||
: clrscr LINES 0 DO i clrln LOOP ;
|
||||
: status 0 clrln ." BLK" SPC BLK> ? SPC ACC ?
|
||||
SPC POS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ;
|
||||
SPC EDPOS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ;
|
||||
: contents 1 aty BLK> @ LIST ;
|
||||
: selblk BLK@ contents ;
|
||||
|
8
blk/127
8
blk/127
@ -1,11 +1,11 @@
|
||||
: setpos POS @ 64 /MOD
|
||||
: setpos EDPOS @ 64 /MOD
|
||||
1+ ( status line ) SWAP 3 + ( gutter ) SWAP AT-XY ;
|
||||
: pos+ POS @ + 1024 MOD POS ! ;
|
||||
: pos+ EDPOS @ + 1024 MOD EDPOS ! ;
|
||||
: cmv ( n -- , char movement ) acc@ * pos+ ;
|
||||
: $; 0acc ;
|
||||
: $g ACC @ selblk 0acc ;
|
||||
: $[ BLK> @ acc@ - selblk ;
|
||||
: $] BLK> @ acc@ + selblk ;
|
||||
: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ;
|
||||
: $H 0acc POS @ 0x3c0 AND POS ! ;
|
||||
: $L 0acc POS @ 0x3f OR POS ! ;
|
||||
: $H 0acc EDPOS @ 0x3c0 AND EDPOS ! ;
|
||||
: $L 0acc EDPOS @ 0x3f OR EDPOS ! ;
|
||||
|
8
blk/128
8
blk/128
@ -1,9 +1,9 @@
|
||||
: $w POS @ BLK( + acc@ 0 DO
|
||||
: $w EDPOS @ BLK( + acc@ 0 DO
|
||||
BEGIN C@+ WS? UNTIL BEGIN C@+ WS? NOT UNTIL LOOP
|
||||
1- BLK( - 1023 MIN POS ! ;
|
||||
: $W POS @ BLK( + acc@ 0 DO
|
||||
1- BLK( - 1023 MIN EDPOS ! ;
|
||||
: $W EDPOS @ BLK( + acc@ 0 DO
|
||||
BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP
|
||||
1+ BLK( - DUP 0< IF DROP 0 THEN POS ! ;
|
||||
1+ BLK( - DUP 0< IF DROP 0 THEN EDPOS ! ;
|
||||
: handleM ( c -- f )
|
||||
DUP '0' '9' =><= IF num 0 EXIT THEN
|
||||
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
|
||||
|
Loading…
Reference in New Issue
Block a user