update docs
This commit is contained in:
parent
e3358fd1d3
commit
0050d20370
14
femto.tal
14
femto.tal
|
@ -177,11 +177,7 @@
|
||||||
( using error! will print the given message before causing )
|
( using error! will print the given message before causing )
|
||||||
( the interpreter to halt. )
|
( the interpreter to halt. )
|
||||||
@error! ( msg* -> )
|
@error! ( msg* -> )
|
||||||
emit-! sp
|
emit-! sp ;print JSR2 nl dbg BRK
|
||||||
;print JSR2
|
|
||||||
( &loop LDAk #00 EQU ,&done JCN
|
|
||||||
LDAk emit INC2 ,&loop JMP
|
|
||||||
&done POP2 ) nl dbg BRK
|
|
||||||
|
|
||||||
( open the given file at editor start up )
|
( open the given file at editor start up )
|
||||||
( )
|
( )
|
||||||
|
@ -713,8 +709,6 @@
|
||||||
;redraw-prompt-and-cursor JSR2
|
;redraw-prompt-and-cursor JSR2
|
||||||
;return JMP2
|
;return JMP2
|
||||||
|
|
||||||
( TODO: need to add \r back in for windows )
|
|
||||||
|
|
||||||
( save the file with the filename found in tmp/data )
|
( save the file with the filename found in tmp/data )
|
||||||
@do-save ( -> )
|
@do-save ( -> )
|
||||||
.buffer/limit LDZ2 ;data SUB2 STH2 ( [size] )
|
.buffer/limit LDZ2 ;data SUB2 STH2 ( [size] )
|
||||||
|
@ -1566,6 +1560,7 @@
|
||||||
&term-size-parse-error "Error 20 "parsing 20 "term 20 "size 00
|
&term-size-parse-error "Error 20 "parsing 20 "term 20 "size 00
|
||||||
]
|
]
|
||||||
|
|
||||||
|
( perform the undo action )
|
||||||
@undo ( -> )
|
@undo ( -> )
|
||||||
#01 .state/in-undo STZ
|
#01 .state/in-undo STZ
|
||||||
;undo-stack/pos LDA2 ;undo-stack/data EQU2 ,&noop JCN
|
;undo-stack/pos LDA2 ;undo-stack/data EQU2 ,&noop JCN
|
||||||
|
@ -1583,6 +1578,7 @@
|
||||||
&delete POP ;delete JMP2
|
&delete POP ;delete JMP2
|
||||||
&noop BRK
|
&noop BRK
|
||||||
|
|
||||||
|
( free up space in the undo stack by evicting the oldest entry )
|
||||||
@u-free ( -> )
|
@u-free ( -> )
|
||||||
;undo-stack/data STH2k #0003 ADD2 ( st+3 [st] )
|
;undo-stack/data STH2k #0003 ADD2 ( st+3 [st] )
|
||||||
&loop LDAk STH2kr STA
|
&loop LDAk STH2kr STA
|
||||||
|
@ -1591,6 +1587,7 @@
|
||||||
&done ;undo-stack/pos LDA2k #0003 SUB2 SWP2 STA2
|
&done ;undo-stack/pos LDA2k #0003 SUB2 SWP2 STA2
|
||||||
POP2 POP2r JMP2r
|
POP2 POP2r JMP2r
|
||||||
|
|
||||||
|
( push a new item on the undo stack )
|
||||||
@u-push ( c^ addr* -> )
|
@u-push ( c^ addr* -> )
|
||||||
;undo-stack/pos DUP2 LDA2 ( c^ addr* top* pos* )
|
;undo-stack/pos DUP2 LDA2 ( c^ addr* top* pos* )
|
||||||
GTH2 ( c^ addr* top>pos^ ) ,&has-room JCN ( c^ addr* )
|
GTH2 ( c^ addr* top>pos^ ) ,&has-room JCN ( c^ addr* )
|
||||||
|
@ -1613,8 +1610,7 @@
|
||||||
( - 1 byte: character to insert, or \0 to delete )
|
( - 1 byte: character to insert, or \0 to delete )
|
||||||
( )
|
( )
|
||||||
( pos points to the next open stack frame. )
|
( pos points to the next open stack frame. )
|
||||||
( )
|
( when pos points to data the stack is empty. )
|
||||||
( when pos points to data the stack is empty, and )
|
|
||||||
( when pos points to pos the stack is full. )
|
( when pos points to pos the stack is full. )
|
||||||
@undo-stack [
|
@undo-stack [
|
||||||
&data $180 ( 128 steps )
|
&data $180 ( 128 steps )
|
||||||
|
|
31
femto.txt
31
femto.txt
|
@ -6,7 +6,7 @@ draws graphics using ANSI control sequences.
|
||||||
|
|
||||||
this means the terminal must be in raw mode with echo
|
this means the terminal must be in raw mode with echo
|
||||||
turned off. the `femto` wrapper script achieves this
|
turned off. the `femto` wrapper script achieves this
|
||||||
using `sttry raw -echo` (it also restores the previous
|
using `stty raw -echo` (it also restores the previous
|
||||||
terminal settings on exit).
|
terminal settings on exit).
|
||||||
|
|
||||||
---- WARNING ----
|
---- WARNING ----
|
||||||
|
@ -18,15 +18,14 @@ it has bugs!
|
||||||
please consider making backups (or using version control)
|
please consider making backups (or using version control)
|
||||||
before femto this to modify important files.
|
before femto this to modify important files.
|
||||||
|
|
||||||
(i'm in the midst of adding regex search so the code
|
|
||||||
is particularly untidy right now. sorry!)
|
|
||||||
|
|
||||||
---- getting started ----
|
---- getting started ----
|
||||||
|
|
||||||
you must provide a path to a file when starting femto:
|
you must provide a path to a file when starting femto:
|
||||||
|
|
||||||
./femto femto.tal
|
./femto femto.tal
|
||||||
|
|
||||||
|
(if the file does not exist, femto will create it on save.)
|
||||||
|
|
||||||
the femto launcher script makes many assumptions:
|
the femto launcher script makes many assumptions:
|
||||||
|
|
||||||
- uxnasm and uxncli are both in the PATH
|
- uxnasm and uxncli are both in the PATH
|
||||||
|
@ -39,10 +38,9 @@ packaging process can be explored.
|
||||||
|
|
||||||
---- current status ----
|
---- current status ----
|
||||||
|
|
||||||
- can't create new files that don't already exist
|
|
||||||
- can't create new directories while saving
|
- can't create new directories while saving
|
||||||
- doesn't support horizontal scrolling for long lines
|
- doesn't support horizontal scrolling for long lines
|
||||||
- no search (or search&replace)
|
- no search & replace
|
||||||
- no copy/paste
|
- no copy/paste
|
||||||
- few help messages
|
- few help messages
|
||||||
- doesn't support function keys, mouse, etc.
|
- doesn't support function keys, mouse, etc.
|
||||||
|
@ -56,6 +54,7 @@ the femto status line contains a lot of information:
|
||||||
3. the number of bytes/lines (e.g. "[49 bytes, 8 lines]"
|
3. the number of bytes/lines (e.g. "[49 bytes, 8 lines]"
|
||||||
4. the x/y cursor position (e.g. "(1,8)" for col 1, row 8)
|
4. the x/y cursor position (e.g. "(1,8)" for col 1, row 8)
|
||||||
5. whether tabs ("[t]") or spaces ("[s]") are inserted by tab key
|
5. whether tabs ("[t]") or spaces ("[s]") are inserted by tab key
|
||||||
|
6. how many items are in the undo stack (e.g. "u:13")
|
||||||
|
|
||||||
---- special key bindings ----
|
---- special key bindings ----
|
||||||
|
|
||||||
|
@ -65,6 +64,8 @@ the femto status line contains a lot of information:
|
||||||
|
|
||||||
C-b move back one character (or LEFT ARROW)
|
C-b move back one character (or LEFT ARROW)
|
||||||
C-f move forward one character (or RIGHT ARROW)
|
C-f move forward one character (or RIGHT ARROW)
|
||||||
|
M-b move back by one word
|
||||||
|
M-f move forward by one word
|
||||||
C-n move down one line (or DOWN ARROW)
|
C-n move down one line (or DOWN ARROW)
|
||||||
C-p move up one line (or UP ARROW)
|
C-p move up one line (or UP ARROW)
|
||||||
M-v page up (or PAGE DOWN)
|
M-v page up (or PAGE DOWN)
|
||||||
|
@ -77,10 +78,26 @@ the femto status line contains a lot of information:
|
||||||
M-g go to line
|
M-g go to line
|
||||||
C-l center screen on cursor line
|
C-l center screen on cursor line
|
||||||
|
|
||||||
|
C-s search for a substring [1]
|
||||||
|
M-s search for matches using a regular expression [1]
|
||||||
|
|
||||||
C-d delete
|
C-d delete
|
||||||
M-c toggle color scheme
|
M-c toggle color scheme
|
||||||
M-t toggle tabs-vs-spaces indentation
|
M-t toggle tabs-vs-spaces indentation
|
||||||
C-l refresh screen (DEBUG)
|
|
||||||
|
|
||||||
(C stands for Control)
|
(C stands for Control)
|
||||||
(M stands for Meta, often Alt or Option)
|
(M stands for Meta, often Alt or Option)
|
||||||
|
|
||||||
|
---- search [1] ----
|
||||||
|
|
||||||
|
when searching femto will highlight matches and accepts
|
||||||
|
the following commands:
|
||||||
|
|
||||||
|
- C-g: cancel the search and restore the cursor
|
||||||
|
- Enter: end the search, leaving the cursor where it is
|
||||||
|
- n (or C-s): move forward to the next match, if any
|
||||||
|
- p (or C-r): move backwards to the previous match, if any
|
||||||
|
|
||||||
|
basic regular expression syntax is mostly working, although there
|
||||||
|
are notable absences such as character classes (e.g. [] and [^]),
|
||||||
|
references to capture groups (e.g. \1), and repetitions (e.g. {n}).
|
||||||
|
|
Loading…
Reference in New Issue