~rabbits/left

7431b039a0421fb955c2fc82bdecab7a0387feaa — Devine Lu Linvega 2 months ago ea3cd85
Improved binary paste
1 files changed, 23 insertions(+), 17 deletions(-)

M src/left.tal
M src/left.tal => src/left.tal +23 -17
@@ 425,7 425,7 @@
	( >> )

@erase-block ( -- )
	erase-selection !select-reset
	erase-selection !<select-reset>

@delete ( -- )
	has-length? ?erase-block


@@ 498,7 498,7 @@
@<select-marker> ( id -- )
	get-marker DUP2 ;search slen ADD2 !<select-range>

@select-reset ( -- )
@<select-reset> ( -- )
	get-from
	( >> )



@@ 1047,7 1047,8 @@
	.File/success DEI2 INC2 .textarea/length STZ2
	file-detect
	( | draw )
	update-scrollbar update-nav select-reset #01 <draw-filepath>
	update-scrollbar update-nav <select-reset>
	#01 <draw-filepath>
	#05 <draw-state> !reqdraw-textarea

@file-open-binary ( path* -- )


@@ 1056,7 1057,8 @@
	;text SUB2 .textarea/length STZ2
	( | continue )
	[ LIT2 01 -textarea/highlight ] STZ
	select-reset #01 <draw-filepath>
	<select-reset>
	#01 <draw-filepath>
	#0a <draw-state> !reqdraw-textarea

@file-save ( -- )


@@ 1087,9 1089,9 @@
	( skip if empty ) DUP2 flen ORAk ?{ POP2 POP2 JMP2r }
	( erase sel ) has-empty? ?{ erase-selection }
	( | name* addr* )
	STH2k .File/length DEO2
	SWP2 .File/name DEO2
	( stash length ) STH2k .File/length DEO2
	( push right ) get-from STH2kr <msfr>
	.File/name DEO2
	STH2kr <mod-length>
	get-from .File/read DEO2
	get-from STH2r ADD2 !<select-a>


@@ 1098,10 1100,12 @@
	( skip if empty ) DUP2 flen ORAk ?{ POP2 POP2 JMP2r }
	( erase sel ) has-empty? ?{ erase-selection }
	( | name* addr* )
	( push right ) get-from STH2k SWP2 DUP2 ADD2 DUP2 #02 SFT2 ADD2 <msfr>
	.File/name DEO2
	STH2r <inject-binary>
	DUP2 get-from SUB2 <mod-length> !<select-a>
	SWP2 .File/name DEO2
	( stash length ) DUP2 ADD2 DUP2 #02 SFT2 ADD2 STH2
	( push right ) get-from STH2kr <msfr>
	STH2kr <mod-length>
	get-from <inject-binary>
	POP2 get-from STH2r ADD2 !<select-a>

@file-detect ( -- )
	file-is-dir? ?&dir


@@ 1146,7 1150,7 @@

@edit-cut ( -- )
	has-length? ?{ JMP2r }
	edit-copy erase-selection select-reset !reqdraw-textarea
	edit-copy erase-selection <select-reset> !reqdraw-textarea

@edit-copy ( -- )
	has-length? ?{ JMP2r }


@@ 1171,7 1175,8 @@
	LDA2k #090a NEQ2 ?{ DUP2 <cut-char> !&>l }
	LDA2k #0a20 NEQ2 ?{ INC2k <cut-char> !&>l }
	INC2 GTH2k ?&>l
	POP2 POP2 select-reset update-nav !reqdraw-textarea
	POP2 POP2 <select-reset>
	update-nav !reqdraw-textarea

@format-trim ( -- )
	[ LIT2r 0000 ] get-to get-from


@@ 1442,7 1447,7 @@
	[ LIT2 00 -Screen/sprite ] DEO
	#000c ADD2 .Screen/x DEO2
	INC2 .Screen/width DEI2 #0080 SUB2 #02 draw-word-until
	( ) walk-blank LDAk [ LIT "& ] EQU ?{ draw-sym-field }
	( ) walk-blank LDAk [ LIT "& ] EQU ?{ <draw-sym-field> }
	<draw-sym-fill>
	walk-blank
	( | fields )


@@ 1454,8 1459,9 @@
		LDAk #20 LTH ?{
			LDAk [ LIT "& ] NEQ ?{
				[ LIT2 &anchor $2 ] .Screen/x DEO2
				INC2 #01 draw-sym-key walk-blank
				( ) LDAk [ LIT "@ ] EQU ?{ draw-sym-field }
				INC2 #01 <draw-sym-key>
				walk-blank
				( ) LDAk [ LIT "@ ] EQU ?{ <draw-sym-field> }
				<draw-sym-fill>
				walk-blank !&>l }
		walk-word/ }


@@ 1478,14 1484,14 @@
	.Screen/y DEI2k #0008 ADD2 ROT DEO2
	JMP2r

@draw-sym-key ( addr* color -- addr* )
@<draw-sym-key> ( addr* color -- addr* )
	;blinker-icn .Screen/addr DEO2
	[ LIT2 01 -Screen/sprite ] DEO
	;tab-icn .Screen/addr DEO2
	[ LIT2 01 -Screen/sprite ] DEO
	.Screen/width DEI2 #0028 SUB2 ROT !draw-word-until

@draw-sym-field ( addr* -- addr* )
@<draw-sym-field> ( addr* -- addr* )
	.Screen/x DEI2k #0004 ADD2 ROT DEO2
	LDAk [ LIT "( ] EQU ?{
		.Screen/width DEI2 #0018 SUB2 #03 !draw-word-until }