From 8650e62e1015574efa47b04b509baa927cfe2c60 Mon Sep 17 00:00:00 2001 From: crc Date: Mon, 18 Feb 2019 17:10:48 +0000 Subject: [PATCH] block editor: add keys to copy/paste, delete line contents FossilOrigin-Name: 757d8165a1606e3d6f7291d39296a5949aabefe6eec24228c1dc27cfa965f9d3 --- example/Block-Editor.forth | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/example/Block-Editor.forth b/example/Block-Editor.forth index 1fb8040..f9927f7 100755 --- a/example/Block-Editor.forth +++ b/example/Block-Editor.forth @@ -322,12 +322,33 @@ These are helpful to quickly navigate through a block. }} ~~~ +## Erase + +~~~ +:editor:key &Block #1024 [ #32 over store n:inc ] times drop ; +:editor:key &Block @CurrentLine #64 * + #64 + [ #32 over store n:inc ] times drop ; +~~~ + +## Copy/Paste + +~~~ +{{ + 'Copy d:create #65 allot + 'CopyBlock d:create #1025 allot +---reveal--- + :editor:key &Block @CurrentLine #64 * + &Copy #64 copy ; + :editor:key &Copy &Block @CurrentLine #64 * + #64 copy ; + :editor:key &Block &CopyBlock #1024 copy ; + :editor:key &CopyBlock &Block #1024 copy ; +}} +~~~ + ## Misc. ~~~ :editor:key block:update block:write ; :editor:key @CurrentBlock block:select ; -:editor:key &Block #1024 [ #32 over store n:inc ] times drop ; :editor:key block:write 'stty_-cbreak unix:system #0 unix:exit ; :editor:key<`> tob:initialize ; ~~~