From 11843cc613b9ab74c3325e3e7a4386da980ae3a9 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 4 Jun 2020 17:22:07 -0400 Subject: [PATCH] VE: add W and S movements --- blk/121 | 2 +- blk/122 | 1 + blk/125 | 2 +- blk/127 | 14 ++++++-------- blk/128 | 7 +++++++ 5 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 blk/122 create mode 100644 blk/128 diff --git a/blk/121 b/blk/121 index 2bda492..3c7da94 100644 --- a/blk/121 +++ b/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.) diff --git a/blk/122 b/blk/122 new file mode 100644 index 0000000..3d642da --- /dev/null +++ b/blk/122 @@ -0,0 +1 @@ +W moves forward by a word. S moves backward by a word. diff --git a/blk/125 b/blk/125 index 8ede59e..97be838 100644 --- a/blk/125 +++ b/blk/125 @@ -1,2 +1,2 @@ '? UPPER NOT [IF] 33 LOAD+ [THEN] DROP ( B158 ) -1 2 LOADR+ +1 3 LOADR+ diff --git a/blk/127 b/blk/127 index a33c64d..f41d99a 100644 --- a/blk/127 +++ b/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 ! ; diff --git a/blk/128 b/blk/128 new file mode 100644 index 0000000..a8bf90e --- /dev/null +++ b/blk/128 @@ -0,0 +1,7 @@ +: 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 ; +