Differences From Artifact [bcd1048eff80bf83]:
File editor.rx part of check-in [dcb8eea6b4] - editor: add section on saving/loading external files by crc on 2011-06-16 12:09:12. [annotate] [view]
To Artifact [1641b30386c53c16]:
File editor.rx part of check-in [f0ed5090c8] - editor: remove dependencies on console' vocabulary by crc on 2011-10-25 19:07:10. [annotate] [view]
@@ -1,5 +1,5 @@
-( retro editor v11-2011.06.15 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
+( retro editor v11-2011.10.25 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
( Key Action )
( --- ------------------------------------------------- )
( i Move cursor up )
( j Move cursor left )
@@ -21,11 +21,8 @@
( TAB Switch between edit and command mode )
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
chain: editor'
-: textColor ^console'normal ^console'cyan ;
-: statusColor ^console'normal ^console'yellow ;
-: uiColor ^console'normal ^console'red ;
{{
2 elements buffer count
: restore ( - ) &getc :devector ok ;
@@ -54,14 +51,14 @@
@blk -1 = [ 1st ] ifTrue
@blk @#blocks >= [ blk -- ] ifTrue ;
( display a block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
- : rows 20 [ dup 80 textColor [ @ putc ] ^types'BUFFER each@ 80 + cr ] times ;
+ : rows 20 [ dup 80 [ @ putc ] ^types'BUFFER each@ 80 + cr ] times ;
: mode? @mode [ "INS" ] [ "CMD" ] if ;
: .block @column @line @blk mode? "(%s) #%d - %d:%d " puts ;
- : bar uiColor 80 [ '- putc ] times cr ;
- : vb @blk toBlock rows drop bar statusColor .block ^console'normal ;
- : (v) ( - ) ^console'colors @ [ ^console'home ] &clear if vb ;
+ : bar 80 [ '- putc ] times cr ;
+ : vb @blk toBlock rows drop bar .block ;
+ : (v) ( - ) clear vb ;
: pos ( -cl ) @column @line ;
: get ( cl-a ) toLine + ;
: va ( a-va ) dup @ swap ;
: c! ( a- ) '* swap ! ;
@@ -96,10 +93,9 @@
: new ( - ) @offset 32 1600 @#blocks * fill ;
: e ( - ) thisBlock 1600 eval ;
: ea ( - ) @offset @#blocks 1600 * eval ;
: run ( - )
- @fb [ ^console'colors off ] ifTrue active on
- &remap &remapKeys :is clear
+ active on &remap &remapKeys :is clear
[ display getc edit? match @active ] while ;
---reveal---
: setBlocks ( n- ) !#blocks @memory 1600 @#blocks * - !offset new ;
: edit ( - )
@@ -119,11 +115,11 @@
: $$[ blk -- ;
: $$] blk ++ ;
: $${ @offset "blocks" ^files'slurp drop ;
: $$} @offset @#blocks 1600 * "blocks" ^files'spew drop ;
- : $$e active off ^console'normal e ;
- : $$E active off ^console'normal ea ;
- : $$z active off ;
+ : $$e active off e ;
+ : $$E active off ea ;
+ : $$z active off ;
128 setBlocks
}}
;chain
@@ -285,33 +281,8 @@
| { | Load the contents of "blocks" |
+-----+--------------------------------------------+
| } | Store all blocks into "blocks" |
+-----+--------------------------------------------+
-
-
--------------
-Configuration
--------------
-
-The colors used in the user interface can be altered by
-revectoring the following functions:
-
-+-------------+------------------------------------+
-| Function | Used for |
-+=============+====================================+
-| textColor | Code/text in a block |
-+-------------+------------------------------------+
-| statusColor | Status bar |
-+-------------+------------------------------------+
-| uiColor | Horizontal line |
-+-------------+------------------------------------+
-
-As an example, if you want to make the text white with
-a blue background:
-
-::
-
- [ ^console'white ^console'onBlue ] is textColor
-----------
Misc. Notes