From be66d7b4a256fb54e341437d8e91410bc46231d2 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 7 May 2020 08:44:17 -0400 Subject: [PATCH] editor: implement E --- blk/101 | 4 ++-- blk/102 | 2 +- blk/108 | 10 +++++----- blk/109 | 9 +++++++++ 4 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 blk/109 diff --git a/blk/101 b/blk/101 index 4890ddf..84c152b 100644 --- a/blk/101 +++ b/blk/101 @@ -2,8 +2,8 @@ T ( n -- ): select line n for editing. P xxx: put typed line on selected line. U xxx: insert typed line on selected line. 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. diff --git a/blk/102 b/blk/102 index 3995ae6..a1d4b73 100644 --- a/blk/102 +++ b/blk/102 @@ -1,5 +1,5 @@ 50 LOAD+ ( B152, extras ) -1 6 LOADR+ +1 7 LOADR+ : BROWSE 0 ACC ! L diff --git a/blk/108 b/blk/108 index c230ad8..32c3a85 100644 --- a/blk/108 +++ b/blk/108 @@ -1,9 +1,9 @@ -: _ilen ( length of str in IBUF ) - IBUF BEGIN C@+ EOL? UNTIL IBUF - 1- ; +: _blen ( buf -- length of str in buf ) + DUP BEGIN C@+ EOL? UNTIL -^ 1- ; +: _rbufsz ( size of linebuf to the right of curpos ) + EDPOS @ 64 MOD 63 -^ ; : _I - IBUF _type EDPOS @ 64 MOD ( cno ) - 63 -^ _ilen ( rbuffsize ilen ) - 2DUP > IF + IBUF _type _rbufsz IBUF _blen 2DUP > IF SWAP OVER - ( ilen chars-to-move ) SWAP EDPOS @ _cpos 2DUP + ( ctm ilen a a+ilen ) 3 PICK MOVE- ( ctm ilen ) diff --git a/blk/109 b/blk/109 new file mode 100644 index 0000000..baf5df1 --- /dev/null +++ b/blk/109 @@ -0,0 +1,9 @@ +: E + FBUF _blen EDPOS @ _cpos 2DUP + ( l a1 a1+l ) + SWAP _rbufsz MOVE ( l ) + ( get to next line - l ) + DUP EDPOS @ 0xffc0 AND 0x40 + -^ _cpos ( l a ) + SWAP 0 FILL + EDPOS @ 64 / _pln +; +