~rabbits/left

cec6a2c72d1ae0df9862412a4927828b164209fb — Devine Lu Linvega 2 months ago f971eac
Reset scroll on Go
1 files changed, 24 insertions(+), 6 deletions(-)

M src/left.tal
M src/left.tal => src/left.tal +24 -6
@@ 52,6 52,7 @@
	( | listen )
	;on-console-arg .Console/vector DEO2
	BRK

	&soft ( -> )
	<draw-menu>
	<draw-spacer>


@@ 62,7 63,7 @@
	( name ) "Left 0a
	( details ) "A 20 "Text 20 "Editor 0a
	( author ) "By 20 "Hundred 20 "Rabbits 0a
	( date ) "9 20 "Jul 20 "2024 $1 01
	( date ) "15 20 "Jul 20 "2024 $1 01
	( > ) 83 =appicon

@manifest 07 "Left $1


@@ 134,6 135,7 @@
	DUP #08 NEQ ?{ POP erase BRK }
	DUP #7f NEQ ?{ POP delete BRK }
	insert BRK

	&move ( byte -- )
	( convert to arrow ) #11 SUB #40 SFT #10 SWP SFT
	( ) .selection/a LDZ2 ROT arrow-to-addr <select-a>


@@ 142,7 144,7 @@
@on-console-arg ( -> )
	.Console/read DEI .filepath skey ?{ BRK }
	;on-console .Console/vector DEO2
	file-open untrap BRK
	file-open-reset untrap BRK

@on-button-trap ( -> )
	<clear-filepath>


@@ 152,8 154,9 @@
	DUP .filepath skey ?&open
	POP #01 <draw-filepath>
	BRK

	&open ( c -> )
	file-open
	file-open-reset
	&escape ( c -> )
	POP untrap BRK



@@ 187,6 190,7 @@
	POP2 SWP DUP #f0 AND ?on-button-arrow
	#02 AND ?on-button-alt
	insert BRK

	&run ( cmd* -> )
	JSR2 POP2 BRK



@@ 207,22 211,29 @@
	( | standard )
	.selection/a LDZ2 ROT arrow-to-addr <select-a>
	BRK

	&on-cal ( button -> )
	POP .scroll/x LDZ2 #0040 ADD2 <scroll-to-x>
	BRK

	&on-car ( button -> )
	POP .scroll/x LDZ2 #0040 SUB2 <scroll-to-x>
	BRK

	&on-shift ( button -> )
	.selection/b LDZ2 ROT arrow-to-addr <select-b>
	BRK

	&on-au ( button -> )
	POP select-prev-marker BRK

	&on-ad ( button -> )
	POP select-next-marker BRK

	&on-ul-block ( button -> )
	POP get-from <select-a>
	BRK

	&on-dr-block ( button -> )
	POP get-to <select-a>
	BRK


@@ 249,6 260,7 @@
	#43 ;cursor-icn <update-cursor>
	[ LIT2 00 -Mouse/state ] DEO
	BRK

	&trap ( -> )
	POP2 !trap-menu



@@ 267,10 279,12 @@
	( ) DUP #04 NEQ ?{ capture-selection }
	POP2 [ LIT2 00 -Mouse/state ] DEO
	BRK

	&on-down1 ( a b -> )
	[ LIT2 04 -Controller/button ] DEI EQU ?&on-drag
	touch-to-addr <select-a>
	POP2 BRK

	&on-drag ( a b -> )
	touch-to-addr <select-b>
	POP2 BRK


@@ 983,10 997,10 @@
		#0001 SUB2 LDAk [ LIT "/ ] NEQ ?{
			NIP2
			( null ) [ LITr 00 ] STH2
			INC2r STAr !file-open }
			INC2r STAr !file-open-reset }
		NEQ2k ?&>w
	&skip ( -- )
	POP2 [ LIT2 ". 00 ] SWP2 STA2 !file-open
	POP2 [ LIT2 ". 00 ] SWP2 STA2 !file-open-reset

@go-selection ( -- )
	get-from LDA2 [ LIT2 ".. ] EQU2 ?go-directory


@@ 1005,7 1019,7 @@

	&e ( cap buffer )
	#00 STHr STZ
	POP2 POP2 !file-open
	POP2 POP2 !file-open-reset

(
@|document )


@@ 1025,6 1039,10 @@
	#01 <draw-filepath>
	update-nav !reqdraw-textarea

@file-open-reset ( -- )
	reset-each/reset-scroll
	( >> )

@file-open ( -- )
	#0000 <set-scroll-y>
	<reset-search>