mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 05:18:06 +11:00
VE: add W and S movements
This commit is contained in:
parent
77aedd7338
commit
11843cc613
2
blk/121
2
blk/121
@ -13,4 +13,4 @@ saved beforehand.
|
||||
';' resets the modifier
|
||||
|
||||
H and L move the cursor by "modifier" characters. J and K, by
|
||||
lines.
|
||||
lines. (cont.)
|
||||
|
2
blk/125
2
blk/125
@ -1,2 +1,2 @@
|
||||
'? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 )
|
||||
1 2 LOADR+
|
||||
1 3 LOADR+
|
||||
|
14
blk/127
14
blk/127
@ -1,4 +1,5 @@
|
||||
: setpos POS @ 64 /MOD 1+ ( status line ) AT-XY ;
|
||||
: setpos POS @ 64 /MOD
|
||||
1+ ( status line ) SWAP 3 + ( gutter ) SWAP AT-XY ;
|
||||
: pos+ POS @ + 1024 MOD POS ! ;
|
||||
: cmv ( n -- , char movement ) acc@ * pos+ ;
|
||||
: $; 0acc ;
|
||||
@ -6,10 +7,7 @@
|
||||
: $[ 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 ;
|
||||
|
||||
: $W POS @ BLK( + BEGIN C@+ WS? UNTIL BEGIN C@+ WS? NOT UNTIL
|
||||
1- BLK( - 1023 MIN POS ! ;
|
||||
: $S POS @ BLK( + BEGIN C@- WS? UNTIL BEGIN C@- WS? NOT UNTIL
|
||||
1+ BLK( - DUP 0< IF DROP 0 THEN POS ! ;
|
||||
|
Loading…
Reference in New Issue
Block a user