move from drawing to redrawing

This commit is contained in:
~d6 2022-03-30 01:26:33 -04:00
parent 19ea70c328
commit 33a23ed0c8
1 changed files with 97 additions and 84 deletions

181
femto.tal
View File

@ -117,6 +117,12 @@
&saw-esc $1 ( did we just see ESC? ) &saw-esc $1 ( did we just see ESC? )
&saw-xterm $1 ( did we just see an ESC [ xterm sequence? ) &saw-xterm $1 ( did we just see an ESC [ xterm sequence? )
&saw-vt $1 ( did we just see an ESC [ $N vt sequence? ) &saw-vt $1 ( did we just see an ESC [ $N vt sequence? )
&redraw $1 ( redrawing: bits determine which parts )
( 0x01 cursor )
( 0x02 statusbar )
( 0x04 prompt )
( 0x08 matches )
( 0x10 body and everything else )
&modified $1 ( has the buffer been modified? ) &modified $1 ( has the buffer been modified? )
&quitting $1 ( are we in the process of quitting? ) &quitting $1 ( are we in the process of quitting? )
] ]
@ -253,12 +259,14 @@
@bol ( -> ) @bol ( -> )
#0000 .cursor/col STZ2 #0000 .cursor/col STZ2
;draw-statusbar-and-cursor JSR2 BRK ;redraw-statusbar-and-cursor JSR2
;return JMP2
( FIXME: handle long lines ) ( FIXME: handle long lines )
@eol ( -> ) @eol ( -> )
;cur-line JSR2 ;line-len JSR2 .cursor/col STZ2 ;cur-line JSR2 ;line-len JSR2 .cursor/col STZ2
;draw-statusbar-and-cursor JSR2 BRK ;redraw-statusbar-and-cursor JSR2
;return JMP2
( FIXME: handle long lines ) ( FIXME: handle long lines )
@forward ( -> ) @forward ( -> )
@ -266,38 +274,42 @@
;cur-col JSR2 ;cur-len JSR2 LTH2 ,&normal JCN ,&next-line JMP ;cur-col JSR2 ;cur-len JSR2 LTH2 ,&normal JCN ,&next-line JMP
&normal &normal
;cur-col JSR2 INC2 .cursor/col STZ2 ;cur-col JSR2 INC2 .cursor/col STZ2
;draw-statusbar-and-cursor JSR2 ;redraw-statusbar-and-cursor JSR2
,&skip JMP ,&skip JMP
&next-line #0000 .cursor/col STZ2 &next-line #0000 .cursor/col STZ2
;inc-row JSR2 ;inc-row JSR2
;ensure-visible-cursor JSR2 ;ensure-visible-cursor JSR2
;draw-cursor JSR2 ;redraw-cursor JSR2
&skip BRK &skip ;return JMP2
( FIXME: handle long lines ) ( FIXME: handle long lines )
@back ( -> ) @go-back ( -> )
;cur-col JSR2 #0001 LTH2 ,&next-line JCN ;cur-col JSR2 #0001 LTH2 ,&next-line JCN
;cur-col JSR2 #0001 SUB2 .cursor/col STZ2 ;cur-col JSR2 #0001 SUB2 .cursor/col STZ2
;draw-statusbar-and-cursor JSR2 BRK ;redraw-statusbar-and-cursor JSR2 JMP2r
&next-line &next-line
;dec-row JSR2 ;dec-row JSR2
;cur-len JSR2 .cursor/col STZ2 ;cur-len JSR2 .cursor/col STZ2
;ensure-visible-cursor JSR2 ( FIXME ) ;ensure-visible-cursor JSR2 ( FIXME )
;draw-cursor JSR2 BRK ;redraw-cursor JSR2
JMP2r
@back ( -> )
;go-back JSR2 ;return JMP2
@up ( -> ) @up ( -> )
;cur-abs-row JSR2 #0000 EQU2 ,&done JCN ;cur-abs-row JSR2 #0000 EQU2 ,&done JCN
;dec-row JSR2 ;dec-row JSR2
;ensure-visible-cursor JSR2 ;ensure-visible-cursor JSR2
;draw-statusbar JSR2 ;redraw-statusbar JSR2
&done ;draw-cursor JSR2 BRK &done ;redraw-cursor JSR2 ;return JMP2
@down ( -> ) @down ( -> )
;cur-abs-row JSR2 ;last-abs-row JSR2 EQU2 ,&done JCN ;cur-abs-row JSR2 ;last-abs-row JSR2 EQU2 ,&done JCN
;inc-row JSR2 ;inc-row JSR2
;ensure-visible-cursor JSR2 ;ensure-visible-cursor JSR2
;draw-statusbar JSR2 ;redraw-statusbar JSR2
&done ;draw-cursor JSR2 BRK &done ;redraw-cursor JSR2 ;return JMP2
@center-view @center-view
;term/rows LDZ2 INC2 #0002 DIV2 STH2k ;term/rows LDZ2 INC2 #0002 DIV2 STH2k
@ -311,7 +323,7 @@
DUP2 .buffer/line-offset STZ2 DUP2 .buffer/line-offset STZ2
;abs-line JSR2 .buffer/offset STZ2 ;abs-line JSR2 .buffer/offset STZ2
&done &done
;draw-all JSR2 BRK ;redraw-all JSR2 ;return JMP2
@page-up ( -> ) @page-up ( -> )
.term/rows LDZ2 #0002 SUB2 STH2k .term/rows LDZ2 #0002 SUB2 STH2k
@ -326,7 +338,8 @@
DUP2 .buffer/line-offset STZ2 DUP2 .buffer/line-offset STZ2
;abs-line JSR2 .buffer/offset STZ2 ;abs-line JSR2 .buffer/offset STZ2
&done &done
;draw-all JSR2 BRK ;redraw-all JSR2 ;return JMP2
@page-down @page-down
;eof-is-visible JSR2 ,&near-eof JCN ;eof-is-visible JSR2 ,&near-eof JCN
@ -335,11 +348,11 @@
DUP2 .buffer/line-offset STZ2 DUP2 .buffer/line-offset STZ2
;abs-line JSR2 .buffer/offset STZ2 ;abs-line JSR2 .buffer/offset STZ2
.cursor/row LDZ2 STH2r ADD2 .cursor/row STZ2 .cursor/row LDZ2 STH2r ADD2 .cursor/row STZ2
;draw-all JSR2 BRK ;redraw-all JSR2 ;return JMP2
&near-eof &near-eof
.buffer/line-count LDZ2 #0001 SUB2 ;set-abs-row JSR2 .buffer/line-count LDZ2 #0001 SUB2 ;set-abs-row JSR2
;cur-len JSR2 .cursor/col STZ2 ;cur-len JSR2 .cursor/col STZ2
;draw-cursor JSR2 BRK ;redraw-cursor JSR2 ;return JMP2
@quit @quit
#01 .state/quitting STZ #01 .state/quitting STZ
@ -347,8 +360,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-and-cursor JSR2 ;redraw-prompt-and-cursor JSR2 ;return JMP2
BRK
@do-quit @do-quit
.tmp/data LDZ LIT 'n EQU ;quit-now JCN2 .tmp/data LDZ LIT 'n EQU ;quit-now JCN2
@ -362,22 +374,19 @@
@quit-now quit! @quit-now quit!
@ignore @ignore
;draw-cursor JSR2 ;draw-cursor JSR2 BRK
BRK
@insert ( c^ -> ) @insert ( c^ -> )
#01 .state/modified STZ #01 .state/modified STZ
;cur-pos JSR2 ;shift-right JSR2 ;cur-pos JSR2 ;shift-right JSR2
;cur-col JSR2 INC2 .cursor/col STZ2 ;cur-col JSR2 INC2 .cursor/col STZ2
;draw-all JSR2 ;redraw-all JSR2 ;return JMP2
BRK
@insert-prompt ( c^ -> ) @insert-prompt ( c^ -> )
.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-and-cursor JSR2 ;redraw-prompt-and-cursor JSR2 ;return JMP2
BRK
@insert-tab ( -> ) @insert-tab ( -> )
#01 .state/modified STZ #01 .state/modified STZ
@ -389,7 +398,7 @@
INC2 ,&loop JMP INC2 ,&loop JMP
&done &done
;cur-col JSR2 .config/tab-width LDZ2 ADD2 .cursor/col STZ2 ;cur-col JSR2 .config/tab-width LDZ2 ADD2 .cursor/col STZ2
;draw-all JSR2 BRK ;redraw-all JSR2 ;return JMP2
&use-tabs &use-tabs
#09 ;insert JMP2 #09 ;insert JMP2
@ -401,8 +410,7 @@
;inc-row JSR2 ;inc-row JSR2
.buffer/line-count LDZ2k INC2 ROT STZ2 .buffer/line-count LDZ2k INC2 ROT STZ2
;ensure-visible-cursor JSR2 ;ensure-visible-cursor JSR2
;draw-all JSR2 ;redraw-all JSR2 ;return JMP2
BRK
@at-buffer-start ( -> bool^ ) @at-buffer-start ( -> bool^ )
;cur-pos JSR2 ;data EQU2 JMP2r ;cur-pos JSR2 ;data EQU2 JMP2r
@ -419,18 +427,17 @@
GTH2 JMP2r GTH2 JMP2r
@backspace ( -> ) @backspace ( -> )
;cur-col JSR2 #01 LTH ,&skip JCN .buffer/offset LDZ2 ;data EQU2 ,&skip JCN
;cur-col JSR2 #0001 SUB2 .cursor/col STZ2 ;go-back JSR2
;delete JMP2 ;delete JMP2
&skip BRK &skip
;redraw-cursor JSR2 ;return JMP2
@backspace-prompt ( -> ) @backspace-prompt ( -> )
#00 .tmp/pos LDZ2 #0001 SUB2 ( 0 pos-1 ) #00 .tmp/pos LDZ2 #0001 SUB2 ( 0 pos-1 )
STH2k STA ( data[pos-1] <- 0 ) STH2k STA ( data[pos-1] <- 0 )
STH2r .tmp/pos STZ2 ( pos <- pos-1 ) STH2r .tmp/pos STZ2 ( pos <- pos-1 )
;draw-prompt JSR2 ;redraw-prompt-and-cursor JSR2 ;return JMP2
;draw-cursor JSR2
BRK
@delete ( -> ) @delete ( -> )
#01 .state/modified STZ #01 .state/modified STZ
@ -439,8 +446,8 @@
;shift-left JSR2 ( [c] ) ;shift-left JSR2 ( [c] )
STHr #0a NEQ ,&not-newline JCN STHr #0a NEQ ,&not-newline JCN
.buffer/line-count LDZ2k #0001 SUB2 ROT STZ2 .buffer/line-count LDZ2k #0001 SUB2 ROT STZ2
&not-newline ;draw-all JSR2 BRK &not-newline ;redraw-all JSR2 ;return JMP2
&skip ;draw-cursor JSR2 BRK &skip ;redraw-cursor JSR2 ;return JMP2
@escape ( -> ) @escape ( -> )
#01 .state/saw-esc STZ BRK #01 .state/saw-esc STZ BRK
@ -455,18 +462,17 @@
DUP2 .buffer/line-offset STZ2 DUP2 .buffer/line-offset STZ2
;abs-line JSR2 .buffer/offset STZ2 ;abs-line JSR2 .buffer/offset STZ2
;cur-len JSR2 .cursor/col STZ2 ;cur-len JSR2 .cursor/col STZ2
;draw-all JSR2 BRK ;redraw-all JSR2 ;return JMP2
@goto-start ( -> ) @goto-start ( -> )
;zero-row JSR2 ;zero-row JSR2
#0000 .cursor/col STZ2 #0000 .cursor/col STZ2
;draw-all JSR2 ;redraw-all JSR2 ;return JMP2
BRK
@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-and-cursor JSR2 ;redraw-prompt-and-cursor JSR2 ;return JMP2
BRK
@parse-decimal-number ( addr* -> n* ok^ ) @parse-decimal-number ( addr* -> n* ok^ )
LDAk ,&non-empty JCN LDAk ,&non-empty JCN
@ -492,15 +498,14 @@
;move-to-message-line JSR2 ;move-to-message-line JSR2
;messages/unknown-input ;print JSR2 ;messages/unknown-input ;print JSR2
;tmp/data ;print JSR2 ;tmp/data ;print JSR2
BRK ;return JMP2
&ok &ok
#0001 SUB2 ( convert 1-indexing to 0-indexing ) #0001 SUB2 ( convert 1-indexing to 0-indexing )
DUP2 .buffer/line-count LDZ2 LTH2 ,&within JCN DUP2 .buffer/line-count LDZ2 LTH2 ,&within JCN
POP2 ;goto-end JMP2 POP2 ;goto-end JMP2
&within &within
;jump-to-line JSR2 ;jump-to-line JSR2
;draw-all JSR2 ;redraw-all JSR2 ;return JMP2
BRK
@jump-to-line ( n* -> ) @jump-to-line ( n* -> )
.term/rows LDZ2 INC2 #0002 DIV2 LTH2k ( n rows/2 n<rows/2? ) ,&early JCN .term/rows LDZ2 INC2 #0002 DIV2 LTH2k ( n rows/2 n<rows/2? ) ,&early JCN
@ -519,14 +524,13 @@
.buffer/line-offset STZ2 ( n o [n-o] ) .buffer/line-offset STZ2 ( n o [n-o] )
;abs-line JSR2 .buffer/offset STZ2 ( n [n-o] ) ;abs-line JSR2 .buffer/offset STZ2 ( n [n-o] )
#0000 .cursor/col STZ2 ( n [n-o] ) #0000 .cursor/col STZ2 ( n [n-o] )
( POP2 STH2r .cursor/row STZ2 )
POP2r .cursor/row STZ2 POP2r .cursor/row STZ2
JMP2r JMP2r
@ensure-visible-cursor @ensure-visible-cursor
;cur-rel-row JSR2 .term/rows LDZ2 LTH2 ,&noop JCN ;cur-rel-row JSR2 .term/rows LDZ2 LTH2 ,&noop JCN
;cur-abs-row JSR2 ;jump-to-line JSR2 ;cur-abs-row JSR2 ;jump-to-line JSR2
;draw-all JSR2 ;redraw-all JSR2
&noop JMP2r &noop JMP2r
@debug @debug
@ -557,8 +561,7 @@
&is-active &is-active
#00 .prompt/active STZ #00 .prompt/active STZ
#00 .state/quitting STZ #00 .state/quitting STZ
;draw-prompt-and-cursor JSR2 ;redraw-prompt-and-cursor JSR2 ;return JMP2
BRK
( when called vector should end in BRK ) ( when called vector should end in BRK )
@finish-prompt ( -> ) @finish-prompt ( -> )
@ -566,14 +569,12 @@
#0000 DIV #0000 DIV
&is-active &is-active
#00 .prompt/active STZ #00 .prompt/active STZ
;draw-prompt JSR2 ;redraw-prompt-and-cursor JSR2
;draw-cursor JSR2
.prompt/vector LDZ2 JMP2 .prompt/vector LDZ2 JMP2
@save @save
;messages/save-prompt ;filename ;do-save ;start-prompt JSR2 ;messages/save-prompt ;filename ;do-save ;start-prompt JSR2
;draw-prompt-and-cursor JSR2 ;redraw-prompt-and-cursor JSR2 ;return JMP2
BRK
@do-save ( -> ) @do-save ( -> )
.buffer/limit LDZ2 ;data SUB2 STH2 ( [size] ) .buffer/limit LDZ2 ;data SUB2 STH2 ( [size] )
@ -590,30 +591,28 @@
;messages/save-ok ;messages/save-ok
&finish &finish
;print JSR2 ;tmp/data ;print JSR2 ;print JSR2 ;tmp/data ;print JSR2
;draw-all JSR2 ;redraw-all JSR2
.state/quitting LDZ ;quit-now JCN2 .state/quitting LDZ ;quit-now JCN2
BRK ;return JMP2
@search ( -> ) @search ( -> )
;messages/search-prompt ;messages/null ;do-search ;start-prompt JSR2 ;messages/search-prompt ;messages/null ;do-search ;start-prompt JSR2
;draw-prompt-and-cursor JSR2 ;redraw-prompt-and-cursor JSR2 ;return JMP2
BRK
@do-search ( -> ) @do-search ( -> )
#01 .searching/active STZ #01 .searching/active STZ
;draw-all JSR2 ;redraw-all JSR2 ;return JMP2
( ;move-to-next-match JMP2 )
BRK
@toggle-color ( -> ) @toggle-color ( -> )
.config/color LDZ2 #3733 EQU2 ,&wrap-around JCN .config/color LDZ2 #3733 EQU2 ,&wrap-around JCN
.config/color LDZ2 #0100 ADD2 .config/color STZ2 ,&done JMP .config/color LDZ2 #0100 ADD2 .config/color STZ2 ,&done JMP
&wrap-around #3033 .config/color STZ2 &wrap-around #3033 .config/color STZ2
&done ;draw-all JSR2 BRK &done ;redraw-all JSR2 ;return JMP2
@toggle-tabs ( -> ) @toggle-tabs ( -> )
.config/insert-tabs LDZk #01 EOR SWP STZ .config/insert-tabs LDZk #01 EOR SWP STZ
;draw-statusbar-and-cursor JSR2 BRK ;redraw-statusbar-and-cursor JSR2 ;return JMP2
( TODO: M-f and M-b for next/previous word ) ( TODO: M-f and M-b for next/previous word )
( M-n and M-p for next/previous paragraph ) ( M-n and M-p for next/previous paragraph )
@ -679,13 +678,11 @@
@cancel-search @cancel-search
#00 .searching/active STZ #00 .searching/active STZ
;draw-all JSR2 ;redraw-all JSR2 ;return JMP2
BRK
@finish-search @finish-search
#00 .searching/active STZ #00 .searching/active STZ
;draw-all JSR2 ;redraw-all JSR2 ;return JMP2
BRK
@move-to-next-match BRK @move-to-next-match BRK
@move-to-prev-match BRK @move-to-prev-match BRK
@ -758,6 +755,24 @@
@term-erase-all ( -> ) @term-erase-all ( -> )
ansi emit-2 emit-J JMP2r ansi emit-2 emit-J JMP2r
@redraw-is-set ( n^ -> ok^ )
.state/redraw LDZ AND JMP2r
@redraw-is-unset ( n^ -> ok^ )
;redraw-is-set JSR2 #00 EQU JMP2r
@redraw-add ( n^ -> )
.state/redraw LDZk ROT ORA SWP STZ JMP2r
@redraw-clear ( -> ) #00 .state/redraw STZ JMP2r
@redraw-cursor ( -> ) #01 ;redraw-add JMP2
@redraw-statusbar ( -> ) #02 ;redraw-add JMP2
@redraw-statusbar-and-cursor ( -> ) #03 ;redraw-add JMP2
@redraw-prompt ( -> ) #04 ;redraw-add JMP2
@redraw-prompt-and-cursor ( -> ) #05 ;redraw-add JMP2
@redraw-matches ( -> ) #08 ;redraw-add JMP2
@redraw-all ( -> ) #1f ;redraw-add JMP2
( @offset-for-cur-row ( @offset-for-cur-row
.buffer/offset LDZ2 ( offset ) .buffer/offset LDZ2 ( offset )
#0000 ;cur-rel-row JSR2 SUB2 STH2 ( offset [-k] ) #0000 ;cur-rel-row JSR2 SUB2 STH2 ( offset [-k] )
@ -819,10 +834,6 @@
;emit-reset JSR2 ;emit-reset JSR2
JMP2r JMP2r
@draw-statusbar-and-cursor ( -> )
;draw-statusbar JSR2
;draw-cursor JMP2
@draw-prompt ( -> ) @draw-prompt ( -> )
;clear-message-line JSR2 ;clear-message-line JSR2
.prompt/active LDZ ,&is-active JCN .prompt/active LDZ ,&is-active JCN
@ -840,9 +851,9 @@
@draw-linenum ( n* -> ) @draw-linenum ( n* -> )
;emit-reset JSR2 ;emit-reset JSR2
ansi .config/color LDZ2 emit emit ( LIT 'm emit ) emit-m ansi .config/color LDZ2 emit emit emit-m
;emit-dec2-pad JSR2 ;emit-dec2-pad JSR2
ansi ( LIT2 'm '0 emit emit ) emit-0 emit-m JMP2r ansi emit-0 emit-m JMP2r
@matches-at ( s* -> limit* ) @matches-at ( s* -> limit* )
LIT2r :tmp/data LIT2r :tmp/data
@ -882,7 +893,7 @@
.searching/active LDZ #00 EQU ,&return JCN ( ) .searching/active LDZ #00 EQU ,&return JCN ( )
;emit-color-reverse JSR2 ;emit-color-reverse JSR2
.term/lmargin LDZ2 ( #0000 ) ,&x STR2 #0000 ,&y STR2 ( x <- 0, y <- 0 ) .term/lmargin LDZ2 ,&x STR2 #0000 ,&y STR2 ( x <- 0, y <- 0 )
.buffer/offset LDZ2 DUP2 .buffer/offset LDZ2 DUP2
;screen-limit JSR2 SUB2 STH2 ( offset [-count] ) ;screen-limit JSR2 SUB2 STH2 ( offset [-count] )
@ -906,7 +917,7 @@
ADD2 ADD2r ( offset+n [n-count] ) ADD2 ADD2r ( offset+n [n-count] )
,&loop JMP ,&loop JMP
&newline ( offset [-count] ) &newline ( offset [-count] )
.term/lmargin LDZ2 ( #0000 ) ,&x STR2 .term/lmargin LDZ2 ,&x STR2
,&y LDR2 INC2 ,&y STR2 ,&y LDR2 INC2 ,&y STR2
INC2 INC2r INC2 INC2r
,&loop JMP ,&loop JMP
@ -924,22 +935,18 @@
&next DEOkr INC2 ,&loop JMP &next DEOkr INC2 ,&loop JMP
@emit-red ( -> ) @emit-red ( -> )
( ansi LIT '3 emit LIT '1 emit LIT 'm emit JMP2r )
ansi emit-3 emit-1 emit-m JMP2r ansi emit-3 emit-1 emit-m JMP2r
@emit-reset ( -> ) @emit-reset ( -> )
( ansi LIT '0 emit LIT 'm emit JMP2r )
ansi emit-0 emit-m JMP2r ansi emit-0 emit-m JMP2r
@emit-red-dollar ( -> ) @emit-red-dollar ( -> )
;emit-red JSR2 ( LIT '$ emit ) emit-$ ;emit-reset JMP2 ;emit-red JSR2 emit-$ ;emit-reset JMP2
@emit-color-reverse ( -> ) @emit-color-reverse ( -> )
( ansi .config/color LDZ2 emit emit LIT2 '7 '; emit emit LIT 'm emit JMP2r )
ansi .config/color LDZ2 emit emit emit-; emit-7 emit-m JMP2r ansi .config/color LDZ2 emit emit emit-; emit-7 emit-m JMP2r
@emit-color-bold ( -> ) @emit-color-bold ( -> )
( ansi .config/color LDZ2 emit emit LIT2 '1 '; emit emit LIT 'm emit JMP2r )
ansi .config/color LDZ2 emit emit emit-; emit-1 emit-m JMP2r ansi .config/color LDZ2 emit emit emit-; emit-1 emit-m JMP2r
@draw-all ( -> ) @draw-all ( -> )
@ -976,15 +983,26 @@
STH2kr .term/rows LDZ2 GTH2 ,&done JCN STH2kr .term/rows LDZ2 GTH2 ,&done JCN
cr nl cr nl
.term/lmargin LDZ2 ;term-move-right JSR2 .term/lmargin LDZ2 ;term-move-right JSR2
( LIT '~ emit ) emit-~ INC2r emit-~ INC2r
,&eof-loop JMP ,&eof-loop JMP
&done POP2 POP2r POP2r &done POP2 POP2r POP2r
;emit-reset JSR2 ;emit-reset JSR2
;draw-matches JSR2 ;draw-matches JSR2
;draw-statusbar JSR2 ;draw-statusbar JSR2
;draw-prompt-and-cursor JSR2 ;draw-prompt JSR2
;draw-cursor JSR2
JMP2r JMP2r
( handler completion code to do necessary drawing and BRK )
@return ( -> )
#10 ;redraw-is-set JSR2 ,&everything JCN
#08 ;redraw-is-unset JSR2 ,&skip-8 JCN ;draw-matches JSR2
&skip-8 #04 ;redraw-is-unset JSR2 ,&skip-4 JCN ;draw-prompt JSR2
&skip-4 #02 ;redraw-is-unset JSR2 ,&skip-2 JCN ;draw-statusbar JSR2
&skip-2 #01 ;redraw-is-unset JSR2 ,&skip-1 JCN ;draw-cursor JSR2
&skip-1 BRK
&everything ;draw-all JSR2 BRK
@str-copy ( src* dst* -> ) @str-copy ( src* dst* -> )
STH2 ( src [dst] ) STH2 ( src [dst] )
&loop LDAk #00 EQU ,&done JCN &loop LDAk #00 EQU ,&done JCN
@ -1115,16 +1133,11 @@
&tabs INC2 .config/tab-width LDZ2 STH2 ADD2r ,&loop JMP &tabs INC2 .config/tab-width LDZ2 STH2 ADD2r ,&loop JMP
@cur-rel-row ( -> row* ) @cur-rel-row ( -> row* )
( .cursor/row LDZ2 JMP2r )
.cursor/row LDZ2 .buffer/line-offset LDZ2 SUB2 JMP2r .cursor/row LDZ2 .buffer/line-offset LDZ2 SUB2 JMP2r
@set-abs-row ( n* -> ) @set-abs-row ( n* -> )
( .buffer/line-offset LDZ2 SUB2 .cursor/row STZ2 JMP2r )
.cursor/row STZ2 JMP2r .cursor/row STZ2 JMP2r
( @set-rel-row ( n* -> )
.cursor/row STZ2 JMP2r )
@zero-row ( -> ) @zero-row ( -> )
;data .buffer/offset STZ2 ;data .buffer/offset STZ2
#0000 .buffer/line-offset STZ2 #0000 .buffer/line-offset STZ2