From 2a3fcd46e7eda134b12c1b2a41459eeca9419541 Mon Sep 17 00:00:00 2001 From: crc Date: Thu, 4 Feb 2021 17:32:42 +0000 Subject: [PATCH] retro-edit: add A command to insert multiple lines FossilOrigin-Name: 4657972ef546e0cd85e761872acac186109c4c46b8022a9f7b379fa6361f81e8 --- example/retro-edit.retro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/retro-edit.retro b/example/retro-edit.retro index 2c8412e..b458bca 100755 --- a/example/retro-edit.retro +++ b/example/retro-edit.retro @@ -148,6 +148,7 @@ afterwards. I also reset the stack. In general, each command is intended to do a single task. | a | line | add a line at line number, shifting lines down | + | A | line,count | add lines at line number, shifting lines down | | d | line | erase contents of a line | | i | line,text | replace contents of line with text | | n | line | indent line | @@ -170,6 +171,7 @@ In general, each command is intended to do a single task. ---reveal--- :cmd:p @Input s:to-number ed:display-line ; :cmd:r valid? [ get-limits display-range ] if ; + :cmd:A valid? [ get-limits [ dup ed:insert-line ] times drop ] if ; }} {{ @@ -218,6 +220,7 @@ In general, each command is intended to do a single task. &cmd:i $i ed:register-command &cmd:q $q ed:register-command &cmd:a $a ed:register-command +&cmd:A $A ed:register-command &cmd:x $x ed:register-command &cmd:X $X ed:register-command &cmd:, $, ed:register-command