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. "4af93d53e35d95b8398de262a30b2f0d9481b77b" and "77aedd7338906505233adef30ca93ac194e769b4" have entirely different histories.

11 changed files with 29 additions and 55 deletions

View File

@ -5,7 +5,7 @@ F xxx: find typed string in block.
I xxx: insert typed string at cursor. I xxx: insert typed string at cursor.
E: Delete previously found string. E: Delete previously found string.
Note that "I" shadows core word. Use "i" to access core word.

View File

@ -1,5 +1,5 @@
'? CASE NOT [IF] 51 52 LOADR+ [THEN] DROP ( B152-153 ) '? CASE NOT [IF] 51 52 LOADR+ [THEN] DROP ( B152-153 )
'? FILL NOT [IF] 53 LOAD+ [THEN] DROP ( B155 ) '? FILL NOT [IF] 53 LOAD+ [THEN] DROP ( B154 )
1 7 LOADR+ 1 7 LOADR+
: BROWSE : BROWSE
0 ACC ! L 0 ACC ! L
@ -12,3 +12,5 @@
ENDCASE ENDCASE
AGAIN AGAIN
; ;
( I masks DO..LOOP's I. Do it as late as possible. )
: I _I ;

View File

@ -2,8 +2,7 @@
DUP BEGIN C@+ EOL? UNTIL -^ 1- ; DUP BEGIN C@+ EOL? UNTIL -^ 1- ;
: _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
: 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 )
@ -12,5 +11,5 @@
ELSE DROP ( ilen becomes rbuffsize ) ELSE DROP ( ilen becomes rbuffsize )
THEN THEN
DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen ) DUP IBUF EDPOS @ _cpos ROT MOVE ( ilen )
BLK!! EDPOS +! EDPOS @ 64 / _pln EDPOS +! EDPOS @ 64 / _pln
; ;

View File

@ -4,8 +4,7 @@ This editor, unlike the Block Editor (B100), is grid-based
instead of being command-based. It requires the AT-XY, COLS instead of being command-based. It requires the AT-XY, COLS
and LINES words to be implemented. and LINES words to be implemented.
It is loaded with "125 LOAD" and invoked with "VE". Note that It is loaded with "125 LOAD" and invoked with "VE".
this also fully loads the Block Editor (B100).
This editor uses 17 lines. The top line is the status line and This editor uses 17 lines. The top line is the status line and
the 16 others are contents lines. The content shown is that the 16 others are contents lines. The content shown is that
@ -13,4 +12,5 @@ of the currently selected block.
All keystrokes are directly interpreted by VE and have the All keystrokes are directly interpreted by VE and have the
effect described below. effect described below.
(cont.) (cont.)

View File

@ -4,13 +4,13 @@ keystokes described below. The modifier starts at zero, but
most commands interpret a zero as a 1 so that they can have an most commands interpret a zero as a 1 so that they can have an
effect. effect.
'g' selects the block specified by the modifier as the current 'G' selects the block specified by the modifier as the current
block. Any change madde to the previously selected block is block. Any change madde to the previously selected block is
saved beforehand. saved beforehand.
'[' and ']' advance the selected block by modifier. '[' and ']' advance the selected block by modifier.
';' resets the modifier. 'q' quits. ';' resets the modifier
'h' and 'l' move the cursor by "modifier" characters. 'j' and H and L move the cursor by "modifier" characters. J and K, by
'k', by lines. (cont.) lines.

View File

@ -1,6 +0,0 @@
'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.

View File

@ -1,3 +1,2 @@
'? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 ) '? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 )
-23 LOAD+ ( B102, block editor ) 1 2 LOADR+
1 4 LOADR+

View File

@ -1,13 +1,14 @@
CREATE CMD 2 C, '$' C, 0 C, CREATE CMD 2 C, '$' C, 0 C,
VARIABLE MODE VARIABLE MODEC VARIABLE ACC
VARIABLE POS
: 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 ;
: clrln DUP aty COLS nspcs aty ; : 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 ? : status 0 clrln ." BLK" SPC BLK> ? SPC ACC ?
SPC EDPOS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ; SPC POS @ 64 /MOD . ',' EMIT . ;
: contents 3 aty BLK> @ LIST ; : contents 1 aty BLK> @ LIST ;
: selblk BLK@ contents ; : selblk BLK@ contents ;

19
blk/127
View File

@ -1,12 +1,15 @@
: setpos EDPOS @ 64 /MOD : setpos POS @ 64 /MOD 1+ ( status line ) AT-XY ;
3 + ( header ) SWAP 3 + ( gutter ) SWAP AT-XY ; : pos+ POS @ + 1024 MOD POS ! ;
: pos+ EDPOS @ + 1024 MOD EDPOS ! ;
: cmv ( n -- , char movement ) acc@ * pos+ ; : cmv ( n -- , char movement ) acc@ * pos+ ;
: $; 0acc ; : $; 0acc ;
: $g ACC @ selblk 0acc ; : $G ACC @ selblk 0acc ;
: $[ BLK> @ acc@ - selblk ; : $[ BLK> @ acc@ - selblk ;
: $] 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 -1 cmv ; : $l 1 cmv ; : $k -64 cmv ; : $j 64 cmv ; : handle ( c -- f )
: $H 0acc EDPOS @ 0x3c0 AND EDPOS ! ; UPPER DUP '0' '9' =><= IF num 0 EXIT THEN
: $L 0acc EDPOS @ 0x3f OR EDPOS ! ; DUP CMD 2+ C! CMD FIND IF EXECUTE ELSE DROP THEN
'Q' = ;
: VE clrscr 0acc 0 POS ! contents
BEGIN status setpos KEY handle UNTIL 18 aty ;

11
blk/128
View File

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

13
blk/129
View File

@ -1,13 +0,0 @@
: 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<over KEY DUP EMIT DUP 0x0a = IF DROP 0x0d THEN ;
: VE ['] c<over 0x08 ( C< override ) RAM+ !
clrscr 0acc 0 EDPOS ! modeM contents
BEGIN status bufs setpos KEY MODE @ EXECUTE UNTIL
0 0x08 RAM+ ! 19 aty ;