~rabbits/left

0d22ffac0708c532fec0cf64824f70bb8acc417a — Devine Lu Linvega a month ago bc7ea9b
Added leap-to-line
1 files changed, 31 insertions(+), 30 deletions(-)

M src/main.tal
M src/main.tal => src/main.tal +31 -30
@@ 9,30 9,14 @@

|0000

@state
	&timer $2
@filepath $40
@selection
	&from $2 &to $2 &length $2
@cursor
	&x $2 &y $2
@textarea
	&x $2 &y $2
	&x2 $2 &y2 $2
	&color $1 &font $2
	&fixed $1 &highlight $1
	&lines $2 &length $2
	&commented $1
@scrollbar
	&x $2 &y $2
	&x2 $2 &y2 $2
	&height $2
@scroll
	&x $2 &y $2
	&addr $2 &drag $2 &ratio $2
@leap
	&direction $1
	&buf $20
	@state &timer $2
	@filepath $40
	@selection &from $2 &to $2 &length $2
	@cursor &x $2 &y $2
	@textarea &x $2 &y $2 &x2 $2 &y2 $2 &color $1 &font $2 &fixed $1 &highlight $1 &lines $2 &length $2 &commented $1
	@scrollbar &x $2 &y $2 &x2 $2 &y2 $2 &height $2
	@scroll &x $2 &y $2 &addr $2 &drag $2 &ratio $2
	@leap &direction $1 &buf $20

( program )



@@ 454,6 438,12 @@ JMP2r

	( skip empty )
	;leap/buf LDA #00 EQU ,&draw JCN

	( goto line )
	;leap/buf LDA LIT ': NEQ ,&no-line
	;leap/buf INC2 ;sihx JSR2 #00 EQU ,&no-line JCN
		;leap/buf INC2 ;shex JSR2 ;line-to-addr JSR2 ;select-start JSR2
		&no-line
	( direction )
	.leap/direction LDZ ,&look-up JCN
		.selection/from LDZ2 ;leap/buf ;find-next-str JSR2


@@ 1245,13 1235,24 @@ JMP2
@shex ( str* -- val* ) LIT2r 0000 &w LITr 40 SFT2r LITr 00 LDAk ,chex JSR STH ADD2r INC2 LDAk ,&w JCN POP2 STH2r JMP2r
@mcpy ( src* dst* len* -- ) SWP2 STH2 OVR2 ADD2 SWP2 &loop LDAk STH2kr STA INC2r INC2 GTH2k ,&loop JCN POP2 POP2 POP2r JMP2r

@chex ( char -- value/ff )
@sihx ( str* -- flag )

	&w
		LDAk ,chex JSR #ff NEQ ,&valid JCN
			POP2 #00 JMP2r &valid
		INC2 LDAk ,&w JCN
	POP2
	#01

JMP2r

@chex ( char -- <hex> )

	DUP #2f GTH OVR #3a LTH AND ,&number JCN
	DUP #60 GTH OVR #67 LTH AND ,&lc JCN
	POP #ff
	DUP #2f GTH OVR #3a LTH AND ,&n JCN
	DUP #60 GTH OVR #67 LTH AND ,&l JCN
		POP #ff

JMP2r
	&number #30 SUB JMP2r
	&lc #57 SUB JMP2r
	&n #30 SUB JMP2r
	&l #57 SUB JMP2r