~rabbits/left

e09515cc0887e279ba881781a84dec341c50c0bb — neauoire 2 months ago def518a
Fixed issue with syntax highlight
1 files changed, 29 insertions(+), 28 deletions(-)

M src/main.tal
M src/main.tal => src/main.tal +29 -28
@@ 94,9 94,9 @@
|0100 

	( theme ) 
	#f075 .System/r DEO2 
	#f0c5 .System/g DEO2 
	#f095 .System/b DEO2
	#f076 .System/r DEO2 
	#f0c6 .System/g DEO2 
	#f096 .System/b DEO2

	( vectors ) 
	;on-frame .Screen/vector DEO2


@@ 137,7 137,7 @@ BRK
		.state/blink TOGGLE
		#23 .state/blink LDZ #09 * + ;draw-filepath JSR2
		#00 .state/timer STZ 
	&no-toggle
		&no-toggle
	
BRK



@@ 352,13 352,14 @@ RTN
	&erase ( key -- )
		POP 
		SELECTION-LENGTH #0001 >> ,&erase-multiple JCN
		.selection/from LDZ2 ;document/body !! ,&no-clamp-from JCN
			BRK
			&no-clamp-from
		.selection/from LDZ2 ;document/body >> ,&erase-single JCN
	BRK

	&erase-single ( -- )
		;clear-textarea JSR2
		.selection/from LDZ2 #0001 -- DUP2 STH2k .selection/from STZ2 
			#0001 ++ .selection/to STZ2
		#0001 ;shift-left JSR2
		SELECTION-LENGTH ;shift-left JSR2
		STH2r ;select-addr/no-clear JSR2
		;draw-widget/memory JSR2
	BRK


@@ 409,7 410,7 @@ BRK
			.selection/from LDZ2 #0001 ++ 
			( alt-click: start from top ) 
			.Controller/button DEI #02 ! ,&no-alt-find JCN 
				POP2 #0000 
				POP2 ;document/body
				&no-alt-find
			;find JSR2
			RELEASE-MOUSE


@@ 499,7 500,7 @@ BRK

@scroll-to ( line* -- )
	
	DUP2 ;get-lines JSR2 >> ,&skip JCN
	DUP2 ,get-lines JSR >> ,&skip JCN
	;clear-textarea JSR2
	DUP2 ,set-scroll JSR
	;draw-textarea JSR2


@@ 509,6 510,20 @@ BRK

RTN

@get-lines ( -- line* )
		
	.scroll/y LDZ2
	.scroll/addr LDZ2
	&loop
		LDAk NOT-LINEBREAK ,&no-linebreak JCN
			INCR2
			&no-linebreak
		#0001 ++
		LDAk ,&loop JCN
	POP2

RTN

@set-scroll ( line* -- )
	
	DUP2 .scroll/y STZ2	


@@ 525,14 540,14 @@ RTN
	STH2
	#0000 STH2
	;document/body
	&loop
	&while
		LDAk NOT-LINEBREAK ,&continue JCN
			STH2r #0001 ++ STH2
			EQU2kr STHr #00 = ,&continue JCN
				POP2r POP2r #0001 ++ RTN
				&continue
		#0001 ++
		LDAk ,&loop JCN
		LDAk ,&while JCN
	POP2r POP2r

RTN


@@ 617,7 632,7 @@ RTN
RTN

@find ( from* -- )
	
		
	SELECTION-LENGTH STH2
	&while
		DUP2 STH2kr ,&compare JSR #00 = ,&no-found JCN


@@ 691,20 706,6 @@ RTN

RTN

@get-lines ( -- line* )
		
	.scroll/y LDZ2
	.scroll/addr LDZ2
	&loop
		LDAk NOT-LINEBREAK ,&no-linebreak JCN
			INCR2
			&no-linebreak
		( incr iterator ) #0001 ++
		LDAk ,&loop JCN
	POP2

RTN

@shift-left ( length* -- )
	
	STH2


@@ 844,7 845,7 @@ RTN
		&no-paren-close
	LDAk IS-SPACER #01 JCN [ RTN ]
	,&commented LDR ,&end JCN
	LDAk IS-LABEL ,&label JCN
	DUP2 #0001 ++ LDA IS-LABEL ,&label JCN
	&default
		#21 ;draw-uf2-multiline/color STA RTN
	&label