1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-26 16:38:06 +11:00

Compare commits

..

No commits in common. "1871c46614efa06eae207a82b1b1e712ae8a6139" and "4146110e0d3d7cabc4294a68ac249a9bb370bab7" have entirely different histories.

15 changed files with 56 additions and 74 deletions

24
blk/121
View File

@ -1,16 +1,16 @@
The status line displays the active block number, then the
"modifier" and then the cursor position. When the block is dir-
ty, an "*" is displayed next. At the right corner, a mode letter
can appear. 'R' for replace, 'I' for insert, 'F' for find.
All keystrokes are directly interpreted by VE and have the
effect described below.
Pressing a 0-9 digit accumulates that digit into what is named
the "modifier". That modifier affects the behavior of many
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
block. Any change made to the previously selected block is
saved beforehand.
'[' and ']' advances the selected block by "modifier". 't' opens
the previously opened block.
(cont.)

24
blk/122
View File

@ -1,16 +1,16 @@
All keystrokes are directly interpreted by VE and have the
effect described below.
'h' and 'l' move the cursor by "modifier" characters. 'j' and
'k', by lines.
Pressing a 0-9 digit accumulates that digit into what is named
the "modifier". That modifier affects the behavior of many
keystokes described below. The modifier starts at zero, but
most commands interpret a zero as a 1 so that they can have an
effect.
'H' goes to the beginning of the line, 'L' to the end.
'g' selects the block specified by the modifier as the current
block. Any change made to the previously selected block is
saved beforehand.
'w' moves forward by "modifier" words. 'b' moves backward.
'W' moves to end-of-word. 'B', backwards.
'[' and ']' advances the selected block by "modifier". 't' opens
the previously opened block.
'I', 'F', 'Y', 'X' 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.
'D' deletes "modifier" lines at the cursor. The first of those
lines is copied to IBUF.
(cont.)

20
blk/123
View File

@ -1,16 +1,16 @@
'h' and 'l' move the cursor by "modifier" characters. 'j' and
'k', by lines.
'f' puts the contents of your previous cursor movement into
FBUF. If that movement was a forward movement, it brings the
cursor back where it was. This allows for an efficient combi-
nation of movements and 'E'. For example, if you want to delete
the next word, you type 'w', then 'f', then check your FBUF to
be sure, then press 'E'.
'R' goes into replace mode at current cursor position.
Following keystrokes replace current character and advance
cursor. Press return to return to normal mode.
'H' goes to the beginning of the line, 'L' to the end.
'w' moves forward by "modifier" words. 'b' moves backward.
'W' moves to end-of-word. 'B', backwards.
'I', 'F', 'Y', 'X' and 'E' invoke the corresponding command
'o' inserts a blank line after the cursor. 'O', before.
'D' deletes "modifier" lines at the cursor. The first of those
lines is copied to IBUF.
(cont.)

16
blk/124
View File

@ -1,16 +0,0 @@
'f' puts the contents of your previous cursor movement into
FBUF. If that movement was a forward movement, it brings the
cursor back where it was. This allows for an efficient combi-
nation of movements and 'E'. For example, if you want to delete
the next word, you type 'w', then 'f', then check your FBUF to
be sure, then press 'E'.
'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

@ -7,10 +7,10 @@ CREATE PREVPOS 0 , CREATE PREVBLK 0 ,
: clrscr LINES 0 DO i aty COLS nspcs LOOP ;
: gutter ( ln n ) OVER + SWAP DO 67 i AT-XY '|' EMIT LOOP ;
: status 0 aty ." BLK" SPC BLK> ? SPC ACC ?
SPC EDPOS @ 64 /MOD . ',' EMIT . SPC
BLKDTY @ IF '*' EMIT THEN 10 nspcs ;
SPC EDPOS @ 64 /MOD . ',' EMIT . 10 nspcs ;
: contents 3 aty BLK> @ LIST 3 16 gutter ;
: selblk BLK> @ PREVBLK ! BLK@ contents ;
: mode! ( c -- ) 63 0 AT-XY ;

View File

@ -4,10 +4,10 @@
3 + ( header ) SWAP 3 + ( gutter ) SWAP AT-XY ;
: cmv ( n -- , char movement ) acc@ * EDPOS @ + pos! ;
: buftype ( buf ln -- )
3 OVER AT-XY KEY DUP EMIT
DUP 0x20 < IF 2DROP DROP EXIT THEN
( buf ln c ) 63 nspcs SWAP 4 SWAP AT-XY ( buf c ) SWAP C!+
IN( _zbuf (rdln) IN( SWAP 63 MOVE ;
3 OVER AT-XY C< DUP 0xd = IF 2DROP DROP EXIT THEN
( buf ln c ) 63 nspcs SWAP 4 SWAP AT-XY ( buf c )
SWAP DUP _zbuf C!+ DUP 63 + SWAP DO
C< DUP 0x0d = IF LEAVE THEN i C! LOOP ;

View File

@ -4,9 +4,8 @@
SWAP _cpos FBUF ( len src dst ) ROT MOVE ;
: $R ( replace mode )
mode! 'R' EMIT
BEGIN setpos KEY DUP BS? IF -1 EDPOS +! DROP 0 THEN
DUP 0x20 >= IF
DUP EMIT EDPOS @ _cpos C! 1 EDPOS +! BLK!! 0
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 BLK!! contents ;
@ -14,3 +13,4 @@
: $D $H 64 icpy
acc@ 0 DO 16 EDPOS @ 64 / DO i _mvln- LOOP LOOP
BLK!! contents ;

View File

@ -7,10 +7,10 @@
: bufs
1 aty ." I: " IBUF bufp
2 aty ." F: " FBUF bufp 0 3 gutter ;
: VE
: c<over KEY DUP EMIT DUP 0x0a = IF DROP 0x0d THEN ;
: VE ['] c<over 0x08 ( C< override ) RAM+ !
clrscr 0 ACC ! 0 PREVPOS ! contents
BEGIN status bufs setpos KEY handle UNTIL
19 aty (infl) ;
0 0x08 RAM+ ! 19 aty ;

View File

@ -13,4 +13,3 @@

View File

@ -1,7 +1,7 @@
: WIPE BLK( 1024 0 FILL BLK!! ;
( src dst -- )
: COPY FLUSH SWAP BLK@ BLK> ! BLK! ;
: COPY SWAP BLK@ BLK> ! BLK! ;

View File

@ -12,5 +12,3 @@
PREV CURRENT !
;
: EMPTY LIT< _sys FIND IF DUP HERE ! CURRENT ! THEN ;

View File

@ -4,13 +4,13 @@
;
: FLUSH BLKDTY @ IF BLK! THEN ;
: BLK@ ( n -- )
FLUSH
DUP BLK> @ = IF DROP EXIT THEN
FLUSH DUP BLK> ! BLK@* @ EXECUTE ;
DUP BLK> ! BLK@* @ EXECUTE
;
: BLK!! 1 BLKDTY ! ;

View File

@ -1,16 +1,16 @@
( handle backspace: go back one char in IN>, if possible, then
emit BS + SPC + BS )
: _bs
: (inbs)
( already at IN( ? )
IN> @ IN( = IF EXIT THEN
IN> @ 1- IN> !
BS SPC BS
;
( del is same as backspace )
: BS? DUP 0x7f = SWAP 0x8 = OR ;
: KEY
85 RAM+ @ ( (key) override )
?DUP IF EXECUTE ELSE (key) THEN ;
( cont.: read one char into input buffer and returns whether we
should continue, that is, whether CR was not met. )

View File

@ -1,9 +1,10 @@
: (rdlnc) ( -- c )
( buffer overflow? same as if we typed a newline )
IN> @ IN) = IF 0x0a ELSE KEY THEN ( c )
DUP 0x7f = IF DROP 0x8 THEN ( del? same as backspace )
DUP 0x0a = IF DROP 0xd THEN ( lf? same as cr )
( bacspace? handle and exit )
DUP BS? IF _bs EXIT THEN
DUP 0x8 = IF (inbs) EXIT THEN
( echo back )
DUP EMIT ( c )
( write and advance )

Binary file not shown.