mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-28 07:58:06 +11:00
ed: make X and E cut to IBUF
This allows cut&paste similar to VI's
This commit is contained in:
parent
f90e03b0cb
commit
1adfd0c1a6
3
blk/101
3
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.
|
||||
|
12
blk/112
12
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 ;
|
||||
|
Loading…
Reference in New Issue
Block a user