mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-02 04:20:55 +11:00
Compare commits
7 Commits
77aedd7338
...
4af93d53e3
Author | SHA1 | Date | |
---|---|---|---|
|
4af93d53e3 | ||
|
e36080d7b8 | ||
|
297c187426 | ||
|
2bf4db59ed | ||
|
878df2d53b | ||
|
98e820cf51 | ||
|
11843cc613 |
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 ;
|
||||
|
5
blk/108
5
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 COMPILE I ; IMMEDIATE ( save overshadowed )
|
||||
: I
|
||||
IBUF _type _rbufsz IBUF _blen 2DUP > IF
|
||||
TUCK - ( ilen chars-to-move )
|
||||
SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen )
|
||||
@ -11,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
|
||||
;
|
||||
|
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.)
|
||||
|
8
blk/121
8
blk/121
@ -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
|
||||
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
|
||||
saved beforehand.
|
||||
|
||||
'[' and ']' advance the selected block by modifier.
|
||||
|
||||
';' resets the modifier
|
||||
';' resets the modifier. 'q' quits.
|
||||
|
||||
H and L move the cursor by "modifier" characters. J and K, by
|
||||
lines.
|
||||
'h' and 'l' move the cursor by "modifier" characters. 'j' and
|
||||
'k', by lines. (cont.)
|
||||
|
6
blk/122
Normal file
6
blk/122
Normal file
@ -0,0 +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.
|
3
blk/125
3
blk/125
@ -1,2 +1,3 @@
|
||||
'? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 )
|
||||
1 2 LOADR+
|
||||
-23 LOAD+ ( B102, block editor )
|
||||
1 4 LOADR+
|
||||
|
9
blk/126
9
blk/126
@ -1,14 +1,13 @@
|
||||
CREATE CMD 2 C, '$' C, 0 C,
|
||||
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 . ;
|
||||
: contents 1 aty BLK> @ LIST ;
|
||||
SPC EDPOS @ 64 /MOD . ',' EMIT . SPC MODEC C@ EMIT ;
|
||||
: contents 3 aty BLK> @ LIST ;
|
||||
: selblk BLK@ contents ;
|
||||
|
19
blk/127
19
blk/127
@ -1,15 +1,12 @@
|
||||
: setpos POS @ 64 /MOD 1+ ( status line ) AT-XY ;
|
||||
: pos+ POS @ + 1024 MOD POS ! ;
|
||||
: setpos EDPOS @ 64 /MOD
|
||||
3 + ( header ) SWAP 3 + ( gutter ) SWAP AT-XY ;
|
||||
: pos+ EDPOS @ + 1024 MOD EDPOS ! ;
|
||||
: cmv ( n -- , char movement ) acc@ * pos+ ;
|
||||
: $; 0acc ;
|
||||
: $G ACC @ selblk 0acc ;
|
||||
: $g ACC @ selblk 0acc ;
|
||||
: $[ BLK> @ acc@ - selblk ;
|
||||
: $] BLK> @ acc@ + selblk ;
|
||||
: $H -1 cmv ; : $L 1 cmv ; : $K -64 cmv ; : $J 64 cmv ;
|
||||
: handle ( c -- f )
|
||||
UPPER DUP '0' '9' =><= IF num 0 EXIT THEN
|
||||
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 ;
|
||||
|
||||
: $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 ! ;
|
||||
|
11
blk/128
Normal file
11
blk/128
Normal file
@ -0,0 +1,11 @@
|
||||
: $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
Normal file
13
blk/129
Normal file
@ -0,0 +1,13 @@
|
||||
: 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 ;
|
||||
|
Loading…
Reference in New Issue
Block a user