From ed20ad78658caec4106a845f9ead9b4f5037e142 Mon Sep 17 00:00:00 2001 From: d6 Date: Fri, 11 Mar 2022 00:06:48 -0500 Subject: [PATCH] fix some bugs --- femto.tal | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/femto.tal b/femto.tal index 1c9420b..0732d9b 100644 --- a/femto.tal +++ b/femto.tal @@ -440,6 +440,7 @@ &noop JMP2r @refresh + ;rel-line-error ;error! JMP2 ( FIXME ) ;draw-all JSR2 BRK @debug @@ -522,6 +523,9 @@ @draw-cursor ( -> ) ;cur-w-col JSR2 .term/lmargin LDZ2 ADD2 + DUP2 .term/cols LDZ2 LTH2 ,&ok JCN + ( TODO: handle long line here ) + &ok ;cur-rel-row JSR2 ;term-move-cursor JMP2 @@ -546,7 +550,7 @@ ;messages/lines ;print JSR2 #20 emit LIT '( emit - ;cur-col JSR2 INC ;emit-dec JSR2 + ;cur-col JSR2 INC2 ;emit-dec2 JSR2 LIT ', emit ;cur-abs-row JSR2 INC2 ;emit-dec2 JSR2 LIT ') emit @@ -586,9 +590,6 @@ &bol ADD2kr STH2r ;draw-linenum JSR2 .term/lmargin LDZ2 INC2 ,&x STR2 -( TODO: use this for cursor-line highlighting and long line support ) -( STH2kr .cursor/row LDZ2 INC2 NEQ2 ,&loop JCN - ;emit-color-reverse JSR2 ) &loop ( offset [k line-offset] ) LDAk #00 EQU ,&eof JCN LDAk #0a EQU ,&eol JCN @@ -597,14 +598,14 @@ GTH2 ,&skip JCN ;emit-red-dollar JSR2 ,&x LDR2 INC2 ,&x STR2 &skip INC2 - ,&loop JMP + ,&loop JMP &ok POP2 POP2 LDAk #09 EQU ,&do-tab JCN LDAk emit INC2 ,&x LDR2 INC2 ,&x STR2 ,&loop JMP &eol INC2r - STH2kr .term/rows LDZ2 GTH2 ,&done JCN - cr nl INC2 ,&bol JMP + STH2kr .term/rows LDZ2 GTH2 ,&done JCN + cr nl INC2 ,&bol JMP &do-tab ;emit-tab JSR2 INC2 .config/tab-width LDZ2 ,&x LDR2 ADD2 ,&x STR2 ,&loop JMP @@ -759,10 +760,10 @@ JMP2r @inc-row ( -> ) - .cursor/row LDZ2k INC2 SWP2 STA2 JMP2r + .cursor/row LDZ2 INC2 .cursor/row STZ2 JMP2r @dec-row ( -> ) - .cursor/row LDZ2k #0001 SUB2 SWP2 STA2 + .cursor/row LDZ2 #0001 SUB2 .cursor/row STZ2 JMP2r @last-pos ( -> addr* ) .buffer/limit LDZ2 #0001 SUB2 JMP2r