diff --git a/blk/101 b/blk/101 index 98592bf..dd5aa0d 100644 --- a/blk/101 +++ b/blk/101 @@ -12,4 +12,5 @@ F xxx: find typed FBUF in block, starting from current position+1. If not found, don't move. I xxx: insert typed IBUF at cursor. "I" shadows core word. Use "i" to access it. -E: From cursor, delete X characters, X = length of FBUF. +X ( n -- ): Delete X chars after cursor and place in IBUF. +E: Run X with n = length of FBUF. diff --git a/blk/112 b/blk/112 index c3380ac..bd04da6 100644 --- a/blk/112 +++ b/blk/112 @@ -1,8 +1,10 @@ -: X ( len -- , delete len chars after curpos ) - EDPOS @ _cpos 2DUP + ( l a1 a1+l ) - SWAP _rbufsz MOVE ( l ) - ( get to next line - l ) - DUP EDPOS @ 0xffc0 AND 0x40 + -^ _cpos ( l a ) +: icpy ( n -- copy n chars from cursor to IBUF ) + IBUF _zbuf EDPOS @ _cpos IBUF ( n a buf ) ROT MOVE ; +: X ( n -- ) + DUP icpy EDPOS @ _cpos 2DUP + ( n a1 a1+n ) + SWAP _rbufsz MOVE ( n ) + ( get to next line - n ) + DUP EDPOS @ 0xffc0 AND 0x40 + -^ _cpos ( n a ) SWAP 0 FILL EDPOS @ 64 / _pln ; : E FBUF _blen X ;