editor: add keys to indent/de-indent lines

FossilOrigin-Name: be18f87df60362d5b4ca5f5ddead4ae24a2be156e49b2079e835579938814239
This commit is contained in:
crc 2017-11-14 01:58:06 +00:00
parent e7870541de
commit c9cda2df56

View file

@ -196,6 +196,13 @@ replaces the original file with the dummy one.
[ current? [ drop gets ] if file:puts n:inc ] process-lines ;
~~~
~~~
:indent-line (-)
[ current? [ ASCII:SPACE @FID file:write ] if file:puts n:inc ] process-lines ;
:dedent-line (-)
[ current? [ n:inc ] if file:puts n:inc ] process-lines ;
~~~
~~~
:trim-trailing (-)
[ current? [ s:trim-right ] if file:puts n:inc ] process-lines ;
@ -240,6 +247,8 @@ And now tie everything together. There's a key handler and a top level loop.
$~ [ @ShowEOL not !ShowEOL ] case
$c [ copy-line ] case
$v [ paste-line ] case
$< [ dedent-line ] case
$> [ indent-line ] case
$j [ &CurrentLine v:inc constrain ] case
$k [ &CurrentLine v:dec constrain ] case
$g [ goto constrain ] case