~rabbits/left

9a05a07c32b453a3e3b7d47ab88ae33594b12209 — neauoire 2 months ago ab2cb26
Cleanup of the paste routine
1 files changed, 8 insertions(+), 18 deletions(-)

M src/main.tal
M src/main.tal => src/main.tal +8 -18
@@ 1103,26 1103,16 @@ RTN
@paste-snarf ( -- )
	
	;clear-textarea JSR2

	SELECTION-LENGTH DUP2 #0001 == TOS -- ;shift-left JSR2

	#fff0 ;get-eof JSR2 ;document/body ++ --

	#0200 ;shift-right JSR2

	( move beyond to end of file )
	( erase selection ) SELECTION-LENGTH DUP2 #0001 == TOS -- ;shift-left JSR2
	( max available size ) #0200
	( push right ) STH2k ;shift-right JSR2
	;snarfpath-txt .File/name DEO2 
	( allow for maximum space )
	#0200 .File/length DEO2 
	( insert data )
	STH2kr .File/length DEO2 
	.selection/from LDZ2 .File/load DEO2 

	.selection/from LDZ2 #0200 ++ .selection/to STZ2

	#0200 .File/success DEI2 -- ;shift-left JSR2

	.selection/from LDZ2 .File/success DEI2 ++ DUP2 .selection/from STZ2 #0001 ++ .selection/to STZ2

	( go to shifted text ) .selection/from LDZ2 STH2kr ++ .selection/to STZ2
	( pull left ) STH2r .File/success DEI2 STH2k -- ;shift-left JSR2
	.selection/from LDZ2 STH2r ++ 
		DUP2 .selection/from STZ2 #0001 ++ .selection/to STZ2
	;draw-textarea JSR2

RTN