diff --git a/blk/106 b/blk/106 index 2029994..9b2d09e 100644 --- a/blk/106 +++ b/blk/106 @@ -1,5 +1,5 @@ -: U +: _U ( U without P, used in VE ) 15 EDPOS @ 64 / - 0 DO 14 I - _mvln+ - LOOP P -; + LOOP ; +: U _U P ; diff --git a/blk/122 b/blk/122 index 09101ca..deb62f6 100644 --- a/blk/122 +++ b/blk/122 @@ -6,11 +6,11 @@ 'I', 'F' and 'E' invoke the corresponding command from the Block Editor (B100). Refer to documentation there. +'o' inserts a blank line after the cursor. 'O', before. + 'f' puts the contents of your previous cursor movement into the find buffer. If that movement was a forward movement, it brings the cursor back where it was. This allows for an efficient combination of movements and 'E'. For example, if you want to delete the next word, you type 'w', then 'f', then check your -"F" buffer to be sure, then press 'E'. - -'X' deletes "modifier" characters following cursor. (cont.) +"F" buffer to be sure, then press 'E'. (cont.) diff --git a/blk/123 b/blk/123 index 7175e0b..c8dca32 100644 --- a/blk/123 +++ b/blk/123 @@ -1,4 +1,5 @@ +'X' deletes "modifier" characters following cursor. + 'R' goes into replace mode at current cursor position. Following keystrokes replace current character and advance cursor. Press return to return to normal mode. - diff --git a/blk/125 b/blk/125 index ea0312f..19e4dcb 100644 --- a/blk/125 +++ b/blk/125 @@ -1,3 +1,3 @@ '? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 ) -23 LOAD+ ( B102, block editor ) -1 5 LOADR+ +1 6 LOADR+ diff --git a/blk/126 b/blk/126 index 1a3fe80..98043fa 100644 --- a/blk/126 +++ b/blk/126 @@ -11,5 +11,3 @@ VARIABLE PREVPOS : contents 3 aty BLK> @ LIST ; : selblk BLK@ contents ; : mode! ( c -- ) 63 0 AT-XY ; -: pos! EDPOS @ PREVPOS ! - 1023 MIN DUP 0< IF DROP 0 THEN EDPOS ! ; diff --git a/blk/127 b/blk/127 index 0896f6b..17e3555 100644 --- a/blk/127 +++ b/blk/127 @@ -1,14 +1,5 @@ -: setpos EDPOS @ 64 /MOD +: pos! ( newpos -- ) EDPOS @ PREVPOS ! + DUP 0< IF DROP 0 THEN 1023 MIN EDPOS ! ; +: setpos ( -- ) EDPOS @ 64 /MOD 3 + ( header ) SWAP 3 + ( gutter ) SWAP AT-XY ; : cmv ( n -- , char movement ) acc@ * EDPOS @ + pos! ; -: $; 0acc ; -: $g ACC @ selblk 0acc ; -: $[ BLK> @ acc@ - selblk ; -: $] BLK> @ acc@ + selblk ; -: $I mode! 'I' EMIT 3 1 AT-XY _I contents mode! SPC ; -: $F mode! 'F' EMIT 3 2 AT-XY _F setpos mode! SPC ; -: $E E contents ; -: $X acc@ X contents ; -: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ; -: $H 0acc EDPOS @ 0x3c0 AND pos! ; -: $L 0acc EDPOS @ 0x3f OR pos! ; diff --git a/blk/128 b/blk/128 index 8536a4b..4c580e0 100644 --- a/blk/128 +++ b/blk/128 @@ -1,12 +1,12 @@ -: $w EDPOS @ BLK( + acc@ 0 DO - BEGIN C@+ WS? UNTIL BEGIN C@+ WS? NOT UNTIL LOOP - 1- BLK( - pos! ; -: $W EDPOS @ BLK( + acc@ 0 DO - 1+ BEGIN C@+ WS? NOT UNTIL BEGIN C@+ WS? UNTIL LOOP - 2- BLK( - pos! ; -: $b EDPOS @ BLK( + acc@ 0 DO - 1- BEGIN C@- WS? NOT UNTIL BEGIN C@- WS? UNTIL LOOP - 2+ BLK( - pos! ; -: $B EDPOS @ BLK( + acc@ 0 DO - BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP - 1+ BLK( - pos! ; +: $; 0acc ; +: $g ACC @ selblk 0acc ; +: $[ BLK> @ acc@ - selblk ; +: $] BLK> @ acc@ + selblk ; +: $I mode! 'I' EMIT 3 1 AT-XY _I contents mode! SPC ; +: $F mode! 'F' EMIT 3 2 AT-XY _F setpos mode! SPC ; +: $E E contents ; +: $X acc@ X contents ; +: $h -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ; +: $H 0acc EDPOS @ 0x3c0 AND pos! ; +: $L 0acc EDPOS @ 0x3f OR pos! ; + diff --git a/blk/129 b/blk/129 index f9b9546..8536a4b 100644 --- a/blk/129 +++ b/blk/129 @@ -1,13 +1,12 @@ -: $f EDPOS @ PREVPOS @ 2DUP = IF 2DROP EXIT THEN - 2DUP > IF DUP pos! SWAP THEN - ( p1 p2, p1 < p2 ) OVER - 64 MIN ( pos len ) FBUF _zbuf - SWAP _cpos FBUF ( len src dst ) ROT MOVE ; -: $R ( replace mode ) - mode! 'R' EMIT - BEGIN setpos C< DUP 0xd = NOT IF - EDPOS @ _cpos C! 1 EDPOS +! BLK!! 0 - THEN UNTIL mode! SPC contents ; -: handle ( c -- f ) - DUP '0' '9' =><= IF num 0 EXIT THEN - DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN - UPPER 'Q' = ; +: $w EDPOS @ BLK( + acc@ 0 DO + BEGIN C@+ WS? UNTIL BEGIN C@+ WS? NOT UNTIL LOOP + 1- BLK( - pos! ; +: $W EDPOS @ BLK( + acc@ 0 DO + 1+ BEGIN C@+ WS? NOT UNTIL BEGIN C@+ WS? UNTIL LOOP + 2- BLK( - pos! ; +: $b EDPOS @ BLK( + acc@ 0 DO + 1- BEGIN C@- WS? NOT UNTIL BEGIN C@- WS? UNTIL LOOP + 2+ BLK( - pos! ; +: $B EDPOS @ BLK( + acc@ 0 DO + BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP + 1+ BLK( - pos! ; diff --git a/blk/130 b/blk/130 index c538f7e..05e9803 100644 --- a/blk/130 +++ b/blk/130 @@ -1,13 +1,12 @@ -: 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 IF DUP pos! SWAP THEN + ( p1 p2, p1 < p2 ) OVER - 64 MIN ( pos len ) FBUF _zbuf + SWAP _cpos FBUF ( len src dst ) ROT MOVE ; +: $R ( replace mode ) + mode! 'R' EMIT + BEGIN setpos C< DUP 0xd = NOT IF + EDPOS @ _cpos C! 1 EDPOS +! BLK!! 0 + THEN UNTIL mode! SPC contents ; +: $O EDPOS @ 0x3c0 ( 15 * 64 ) >= IF EXIT THEN + _U EDPOS @ 0x3c0 AND DUP pos! _cpos _zbuf contents ; +: $o EDPOS @ 64 < IF EXIT THEN EDPOS @ 64 + EDPOS ! $O ; diff --git a/blk/131 b/blk/131 new file mode 100644 index 0000000..4cce49b --- /dev/null +++ b/blk/131 @@ -0,0 +1,16 @@ +: handle ( c -- f ) + DUP '0' '9' =><= IF num 0 EXIT THEN + DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN + UPPER 'Q' = ; +: 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