fix a few bugs
This commit is contained in:
parent
7d73b8ea0b
commit
ef80d8844b
35
femto.tal
35
femto.tal
|
@ -319,8 +319,7 @@
|
||||||
quit!
|
quit!
|
||||||
&is-modified
|
&is-modified
|
||||||
;messages/quit-prompt ;messages/null ;do-quit ;start-prompt JSR2
|
;messages/quit-prompt ;messages/null ;do-quit ;start-prompt JSR2
|
||||||
;draw-prompt JSR2
|
;draw-prompt-and-cursor JSR2
|
||||||
;draw-cursor JSR2
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@do-quit
|
@do-quit
|
||||||
|
@ -349,8 +348,7 @@
|
||||||
.tmp/pos LDZ2 STH2k STA ( data[pos] <- c )
|
.tmp/pos LDZ2 STH2k STA ( data[pos] <- c )
|
||||||
INC2r #00 STH2kr STA ( data[pos+1] <- 0 )
|
INC2r #00 STH2kr STA ( data[pos+1] <- 0 )
|
||||||
STH2r .tmp/pos STZ2 ( pos <- pos+1 )
|
STH2r .tmp/pos STZ2 ( pos <- pos+1 )
|
||||||
;draw-prompt JSR2
|
;draw-prompt-and-cursor JSR2
|
||||||
;draw-cursor JSR2
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@insert-tab ( -> )
|
@insert-tab ( -> )
|
||||||
|
@ -405,8 +403,9 @@
|
||||||
.buffer/line-count LDZ2k #0001 SUB2 ROT STZ2
|
.buffer/line-count LDZ2k #0001 SUB2 ROT STZ2
|
||||||
&finish
|
&finish
|
||||||
;cur-pos JSR2 ;shift-left JSR2
|
;cur-pos JSR2 ;shift-left JSR2
|
||||||
;draw-all JSR2
|
;draw-all JSR2 BRK
|
||||||
&skip BRK
|
&skip
|
||||||
|
;draw-cursor JSR2 BRK
|
||||||
|
|
||||||
@backspace-prompt ( -> )
|
@backspace-prompt ( -> )
|
||||||
#00 .tmp/pos LDZ2 #0001 SUB2 ( 0 pos-1 )
|
#00 .tmp/pos LDZ2 #0001 SUB2 ( 0 pos-1 )
|
||||||
|
@ -418,14 +417,13 @@
|
||||||
|
|
||||||
@delete ( -> )
|
@delete ( -> )
|
||||||
#01 .state/modified STZ
|
#01 .state/modified STZ
|
||||||
;last-pos JSR2 #0001 SUB2 ( lst-1 )
|
;last-pos JSR2 ;cur-pos JSR2 LTH2 ,&skip JCN
|
||||||
;cur-pos JSR2 LTH2 ,&skip JCN
|
|
||||||
;cur-pos JSR2 LDAk STH ( cur [c] )
|
;cur-pos JSR2 LDAk STH ( cur [c] )
|
||||||
;shift-left JSR2 ( [c] )
|
;shift-left JSR2 ( [c] )
|
||||||
STHr #0a NEQ ,¬-newline JCN
|
STHr #0a NEQ ,¬-newline JCN
|
||||||
.buffer/line-count LDZ2k #0001 SUB2 ROT STZ2
|
.buffer/line-count LDZ2k #0001 SUB2 ROT STZ2
|
||||||
¬-newline ;draw-all JSR2
|
¬-newline ;draw-all JSR2 BRK
|
||||||
&skip BRK
|
&skip ;draw-cursor JSR2 BRK
|
||||||
|
|
||||||
@escape ( -> )
|
@escape ( -> )
|
||||||
#01 .state/saw-esc STZ BRK
|
#01 .state/saw-esc STZ BRK
|
||||||
|
@ -451,8 +449,7 @@
|
||||||
|
|
||||||
@goto-line ( -> )
|
@goto-line ( -> )
|
||||||
;messages/goto-line ;messages/null ;do-goto-line ;start-prompt JSR2
|
;messages/goto-line ;messages/null ;do-goto-line ;start-prompt JSR2
|
||||||
;draw-prompt JSR2
|
;draw-prompt-and-cursor JSR2
|
||||||
;draw-cursor JSR2
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@parse-decimal-number ( addr* -> n* ok^ )
|
@parse-decimal-number ( addr* -> n* ok^ )
|
||||||
|
@ -546,8 +543,8 @@
|
||||||
#0000 DIV
|
#0000 DIV
|
||||||
&is-active
|
&is-active
|
||||||
#00 .prompt/active STZ
|
#00 .prompt/active STZ
|
||||||
;draw-prompt JSR2
|
#00 .state/quitting STZ
|
||||||
;draw-cursor JSR2
|
;draw-prompt-and-cursor JSR2
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
( when called vector should end in BRK )
|
( when called vector should end in BRK )
|
||||||
|
@ -562,8 +559,7 @@
|
||||||
|
|
||||||
@save
|
@save
|
||||||
;messages/save-prompt ;filename ;do-save ;start-prompt JSR2
|
;messages/save-prompt ;filename ;do-save ;start-prompt JSR2
|
||||||
;draw-prompt JSR2
|
;draw-prompt-and-cursor JSR2
|
||||||
;draw-cursor JSR2
|
|
||||||
BRK
|
BRK
|
||||||
|
|
||||||
@do-save ( -> )
|
@do-save ( -> )
|
||||||
|
@ -779,6 +775,10 @@
|
||||||
;tmp/data ;print JSR2
|
;tmp/data ;print JSR2
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
|
@draw-prompt-and-cursor ( -> )
|
||||||
|
;draw-prompt JSR2
|
||||||
|
;draw-cursor JMP2
|
||||||
|
|
||||||
@draw-linenum ( n* -> )
|
@draw-linenum ( n* -> )
|
||||||
;emit-reset JSR2
|
;emit-reset JSR2
|
||||||
ansi .config/color LDZ2 emit emit LIT 'm emit
|
ansi .config/color LDZ2 emit emit LIT 'm emit
|
||||||
|
@ -845,8 +845,7 @@
|
||||||
&done POP2 POP2r POP2r
|
&done POP2 POP2r POP2r
|
||||||
;emit-reset JSR2
|
;emit-reset JSR2
|
||||||
;draw-statusbar JSR2
|
;draw-statusbar JSR2
|
||||||
;draw-prompt JSR2
|
;draw-prompt-and-cursor JSR2
|
||||||
;draw-cursor JSR2
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
|
||||||
@str-copy ( src* dst* -> )
|
@str-copy ( src* dst* -> )
|
||||||
|
|
Loading…
Reference in New Issue