From ae3b2c30515a453cac1091670503265860bd88a6 Mon Sep 17 00:00:00 2001 From: d6 Date: Sat, 29 Oct 2022 19:15:14 -0400 Subject: [PATCH] partially fix tab display during searching --- femto.tal | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/femto.tal b/femto.tal index 8fa1dbe..19db5b6 100644 --- a/femto.tal +++ b/femto.tal @@ -69,6 +69,7 @@ ( these can be changed at any time without breaking anything else ) @config [ &tab-width $2 ( how many spaces to display tab chars ) + &tab-adjust $2 ( how many "extra" spaces; tab-width - 1 ) &insert-tabs $1 ( tab key inserts tabs when true ) &color $2 ( digits of highlight color in reverse order ) ] @@ -140,6 +141,7 @@ #0050 .term/cols STZ2 #0018 .term/rows STZ2 #0004 .config/tab-width STZ2 + #0003 .config/tab-adjust STZ2 #00 .config/insert-tabs STZ #3333 .config/color STZ2 ;data .buffer/offset STZ2 @@ -1247,6 +1249,7 @@ DUP2 ORA ,&found JCN POP2 ( offset [-count] ) LDAk #0a EQU ,&newline JCN + ,&count-tabs JSR #0001 ,&next JMP ( offset n [-count] ) &found ( offset mlim [-count] ) STH2k ( offset mlim [mlim -count] ) @@ -1270,6 +1273,10 @@ &return JMP2r [ &x $2 &y $2 ] + &count-tabs ( offset -> offset ) + LDAk #09 NEQ ,&count-tabs/done JCN + ,&x LDR2 .config/tab-adjust LDZ2 ADD2 ,&x STR2 + &count-tabs/done JMP2r @emit-tab ( -> ) #0000 .config/tab-width LDZ2 SUB2 @@ -1440,12 +1447,17 @@ &loop ( s pos ) GTH2k #00 EQU ,&done JCN LDAk #0a EQU ,&newline JCN - ,&col LDR2 INC2 ,&col STR2 + LDAk #09 EQU ,&tab JCN + #0001 + &inc + ,&col LDR2 ADD2 ,&col STR2 INC2 ,&loop JMP &newline #0000 ,&col STR2 ,&row LDR2 INC2 ,&row STR2 INC2 ,&loop JMP + &tab + .config/tab-width LDZ2 ,&inc JMP &done POP2 POP2 ,&row LDR2 ,&col LDR2 JMP2r