diff --git a/femto.tal b/femto.tal index 0732d9b..898cc17 100644 --- a/femto.tal +++ b/femto.tal @@ -521,13 +521,23 @@ @term-erase-all ( -> ) ansi LIT '2 emit LIT 'J emit JMP2r +@offset-for-cur-row + .buffer/offset LDZ2 ( offset ) + #0000 ;cur-rel-row JSR2 SUB2 STH2 ( offset [-k] ) + &loop STH2r ORA ,&next JCN + POP2r JMP2r + &next LDAk #0a NEQ JMP INC2r + INC2 ,&loop JMP + @draw-cursor ( -> ) ;cur-w-col JSR2 .term/lmargin LDZ2 ADD2 - DUP2 .term/cols LDZ2 LTH2 ,&ok JCN - ( TODO: handle long line here ) + .term/cols LDZ2 LTH2 ,&ok JCN + ( we have a long line ) + ( ;offset-for-cur-row JSR2 ) &ok - ;cur-rel-row JSR2 - ;term-move-cursor JMP2 + ;cur-w-col JSR2 .term/lmargin LDZ2 ADD2 + ;cur-rel-row JSR2 + ;term-move-cursor JMP2 @draw-statusbar ( -> ) #0000 .term/rows LDZ2 ;term-move-cursor JSR2