1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-02 08:20:57 +11:00

Compare commits

..

No commits in common. "9d4e9ef08dc3b9e831f16380dcf7220e14d4e408" and "4af93d53e35d95b8398de262a30b2f0d9481b77b" have entirely different histories.

8 changed files with 25 additions and 34 deletions

View File

@ -1,4 +1,4 @@
: _F ( F without _pln. used in VE ) : F
FBUF _type FBUF EDPOS @ _cpos ( a1 a2 ) FBUF _type FBUF EDPOS @ _cpos ( a1 a2 )
BEGIN BEGIN
C@+ ROT ( a2+1 c2 a1 ) C@+ ROT ( a2+1 a1+1 c1 c2 ) C@+ ROT ( a2+1 c2 a1 ) C@+ ROT ( a2+1 a1+1 c1 c2 )
@ -6,5 +6,7 @@
TUCK C@ 0xd = ( a1 a2 f1 ) TUCK C@ 0xd = ( a1 a2 f1 )
OVER BLK) = OR ( a1 a2 f1|f2 ) OVER BLK) = OR ( a1 a2 f1|f2 )
UNTIL UNTIL
DUP BLK) < IF BLK( - FBUF + -^ EDPOS ! THEN DROP ; DUP BLK) < IF BLK( - FBUF + -^ EDPOS ! THEN
: F _F EDPOS @ 64 / _pln ; EDPOS @ 64 / _pln DROP
;

View File

@ -3,7 +3,7 @@
: _rbufsz ( size of linebuf to the right of curpos ) : _rbufsz ( size of linebuf to the right of curpos )
EDPOS @ 64 MOD 63 -^ ; EDPOS @ 64 MOD 63 -^ ;
: i COMPILE I ; IMMEDIATE ( save overshadowed ) : i COMPILE I ; IMMEDIATE ( save overshadowed )
: _I ( I without _pln. used in VE ) : I
IBUF _type _rbufsz IBUF _blen 2DUP > IF IBUF _type _rbufsz IBUF _blen 2DUP > IF
TUCK - ( ilen chars-to-move ) TUCK - ( ilen chars-to-move )
SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen ) SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen )
@ -11,5 +11,6 @@
NIP ( ilen ) NIP ( ilen )
ELSE DROP ( ilen becomes rbuffsize ) ELSE DROP ( ilen becomes rbuffsize )
THEN THEN
DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen ) EDPOS +! BLK!! ; DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen )
: I _I EDPOS @ 64 / _pln ; BLK!! EDPOS +! EDPOS @ 64 / _pln
;

View File

@ -1,9 +1,9 @@
: X ( len -- , delete len chars after curpos ) : E
EDPOS @ _cpos 2DUP + ( l a1 a1+l ) FBUF _blen EDPOS @ _cpos 2DUP + ( l a1 a1+l )
SWAP _rbufsz MOVE ( l ) SWAP _rbufsz MOVE ( l )
( get to next line - l ) ( get to next line - l )
DUP EDPOS @ 0xffc0 AND 0x40 + -^ _cpos ( l a ) DUP EDPOS @ 0xffc0 AND 0x40 + -^ _cpos ( l a )
SWAP 0 FILL SWAP 0 FILL
EDPOS @ 64 / _pln ; EDPOS @ 64 / _pln
: E FBUF _blen X ; ;

10
blk/122
View File

@ -2,11 +2,5 @@
'w' moves forward by a word. 'W' moves backward by a word. 'w' moves forward by a word. 'W' moves backward by a word.
'I', 'F' and 'E' invoke the corresponding command from the 'I' inserts text by calling the "I" command from the Block
Block Editor (B100). Refer to documentation there. editor.
'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.

View File

@ -1,12 +1,13 @@
CREATE CMD 2 C, '$' C, 0 C, CREATE CMD 2 C, '$' C, 0 C,
VARIABLE MODE VARIABLE MODEC
: 0acc 0 ACC ! ; : 0acc 0 ACC ! ;
: acc@ ACC @ 1 MAX 0acc ; : acc@ ACC @ 1 MAX 0acc ;
: num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ; : num ACC @ SWAP _pdacc IF DROP ELSE ACC ! THEN ;
: nspcs ( n -- , spit n space ) 0 DO SPC LOOP ; : nspcs ( n -- , spit n space ) 0 DO SPC LOOP ;
: aty 0 SWAP AT-XY ; : aty 0 SWAP AT-XY ;
: clrscr LINES 0 DO i aty COLS nspcs LOOP ; : clrln DUP aty COLS nspcs aty ;
: status 0 aty ." BLK" SPC BLK> ? SPC ACC ? : clrscr LINES 0 DO i clrln LOOP ;
SPC EDPOS @ 64 /MOD . ',' EMIT . 10 nspcs ; : status 0 clrln ." BLK" SPC BLK> ? SPC ACC ?
SPC EDPOS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ;
: contents 3 aty BLK> @ LIST ; : contents 3 aty BLK> @ LIST ;
: selblk BLK@ contents ; : selblk BLK@ contents ;
: mode! ( c -- ) 63 0 AT-XY ;

View File

@ -6,10 +6,7 @@
: $g ACC @ selblk 0acc ; : $g ACC @ selblk 0acc ;
: $[ BLK> @ acc@ - selblk ; : $[ BLK> @ acc@ - selblk ;
: $] BLK> @ acc@ + selblk ; : $] BLK> @ acc@ + selblk ;
: $I mode! 'I' EMIT 3 1 AT-XY _I contents mode! SPC ; : $I 3 1 AT-XY I contents ;
: $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 -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ;
: $H 0acc EDPOS @ 0x3c0 AND EDPOS ! ; : $H 0acc EDPOS @ 0x3c0 AND EDPOS ! ;
: $L 0acc EDPOS @ 0x3f OR EDPOS ! ; : $L 0acc EDPOS @ 0x3f OR EDPOS ! ;

View File

@ -4,12 +4,8 @@
: $W EDPOS @ BLK( + acc@ 0 DO : $W EDPOS @ BLK( + acc@ 0 DO
BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL LOOP
1+ BLK( - DUP 0< IF DROP 0 THEN EDPOS ! ; 1+ BLK( - DUP 0< IF DROP 0 THEN EDPOS ! ;
: $R ( replace mode ) : handleM ( c -- f )
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 '0' '9' =><= IF num 0 EXIT THEN
DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
UPPER 'Q' = ; UPPER 'Q' = ;
: modeM ['] handleM MODE ! 'M' MODEC C! ;

View File

@ -7,7 +7,7 @@
2 aty ." F: " FBUF bufp ; 2 aty ." F: " FBUF bufp ;
: c<over KEY DUP EMIT DUP 0x0a = IF DROP 0x0d THEN ; : c<over KEY DUP EMIT DUP 0x0a = IF DROP 0x0d THEN ;
: VE ['] c<over 0x08 ( C< override ) RAM+ ! : VE ['] c<over 0x08 ( C< override ) RAM+ !
clrscr 0acc 0 EDPOS ! contents clrscr 0acc 0 EDPOS ! modeM contents
BEGIN status bufs setpos KEY handle UNTIL BEGIN status bufs setpos KEY MODE @ EXECUTE UNTIL
0 0x08 RAM+ ! 19 aty ; 0 0x08 RAM+ ! 19 aty ;