editor: add keys to indent/de-indent lines
FossilOrigin-Name: be18f87df60362d5b4ca5f5ddead4ae24a2be156e49b2079e835579938814239
This commit is contained in:
parent
e7870541de
commit
c9cda2df56
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue