partially fix tab display during searching

This commit is contained in:
~d6 2022-10-29 19:15:14 -04:00
parent 3636782b9b
commit ae3b2c3051
1 changed files with 13 additions and 1 deletions

View File

@ -69,6 +69,7 @@
( these can be changed at any time without breaking anything else ) ( these can be changed at any time without breaking anything else )
@config [ @config [
&tab-width $2 ( how many spaces to display tab chars ) &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 ) &insert-tabs $1 ( tab key inserts tabs when true )
&color $2 ( digits of highlight color in reverse order ) &color $2 ( digits of highlight color in reverse order )
] ]
@ -140,6 +141,7 @@
#0050 .term/cols STZ2 #0050 .term/cols STZ2
#0018 .term/rows STZ2 #0018 .term/rows STZ2
#0004 .config/tab-width STZ2 #0004 .config/tab-width STZ2
#0003 .config/tab-adjust STZ2
#00 .config/insert-tabs STZ #00 .config/insert-tabs STZ
#3333 .config/color STZ2 #3333 .config/color STZ2
;data .buffer/offset STZ2 ;data .buffer/offset STZ2
@ -1247,6 +1249,7 @@
DUP2 ORA ,&found JCN DUP2 ORA ,&found JCN
POP2 ( offset [-count] ) POP2 ( offset [-count] )
LDAk #0a EQU ,&newline JCN LDAk #0a EQU ,&newline JCN
,&count-tabs JSR
#0001 ,&next JMP ( offset n [-count] ) #0001 ,&next JMP ( offset n [-count] )
&found ( offset mlim [-count] ) &found ( offset mlim [-count] )
STH2k ( offset mlim [mlim -count] ) STH2k ( offset mlim [mlim -count] )
@ -1270,6 +1273,10 @@
&return &return
JMP2r JMP2r
[ &x $2 &y $2 ] [ &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 ( -> ) @emit-tab ( -> )
#0000 .config/tab-width LDZ2 SUB2 #0000 .config/tab-width LDZ2 SUB2
@ -1440,12 +1447,17 @@
&loop ( s pos ) &loop ( s pos )
GTH2k #00 EQU ,&done JCN GTH2k #00 EQU ,&done JCN
LDAk #0a EQU ,&newline 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 INC2 ,&loop JMP
&newline &newline
#0000 ,&col STR2 #0000 ,&col STR2
,&row LDR2 INC2 ,&row STR2 ,&row LDR2 INC2 ,&row STR2
INC2 ,&loop JMP INC2 ,&loop JMP
&tab
.config/tab-width LDZ2 ,&inc JMP
&done &done
POP2 POP2 POP2 POP2
,&row LDR2 ,&col LDR2 JMP2r ,&row LDR2 ,&col LDR2 JMP2r