~rabbits/left

ade554f2ba00400a2eccf7bf0b0addf718716467 — Devine Lu Linvega a month ago 8ab19fe
Fixed issue with non-block paste
1 files changed, 21 insertions(+), 7 deletions(-)

M src/left.tal
M src/left.tal => src/left.tal +21 -7
@@ 615,7 615,8 @@ JMP2r

@erase-selection ( -- )

	.selection/to LDZ2 .selection/from LDZ2 SUB2 .selection/from LDZ2 SWP2 STH2k ADD2 ( EOF ) ;text .textarea/length LDZ2 ADD2 STH2r ;shiftl JSR2
	.selection/to LDZ2 .selection/from LDZ2 SUB2 .selection/from LDZ2 SWP2 STH2k ADD2
        ( EOF ) ;text .textarea/length LDZ2 ADD2 STH2r ;shiftl JSR2

JMP2r



@@ 627,7 628,7 @@ JMP2r

	;clear-textarea JSR2

	.selection/to LDZ2 .selection/from LDZ2 SUB2 #0001 EQU2 ,&no-block JCN
	;is-block JSR2 ,&no-block JCN
		;erase-selection JSR2
		.selection/from LDZ2 INC2k ;set-selection JSR2 POP
		&no-block


@@ 646,7 647,7 @@ JMP2r

	;clear-textarea JSR2

	.selection/to LDZ2 .selection/from LDZ2 SUB2 #0001 EQU2 ,&no-block JCN
	;is-block JSR2 ,&no-block JCN
		;erase-selection JSR2
		;reset-selection JSR2
		JMP2r


@@ 665,7 666,7 @@ JMP2r

	;clear-textarea JSR2

	.selection/to LDZ2 .selection/from LDZ2 SUB2 #0001 EQU2 ,&no-block JCN
	;is-block JSR2 ,&no-block JCN
		;erase-selection JSR2
		;reset-selection JSR2
		JMP2r


@@ 896,6 897,12 @@ JMP2r

JMP2r

@is-block ( -- flag )

    .selection/to LDZ2 .selection/from LDZ2 SUB2 #0001 EQU2

JMP2r

@scan-color ( addr* -- addr* )

	.textarea/highlight LDZ ,&default JCN


@@ 1122,12 1129,19 @@ JMP2r
@paste-snarf ( -- )

	;clear-textarea JSR2
	;erase-selection JSR2
	( push right ) .selection/from LDZ2 ( EOF ) ;text .textarea/length LDZ2 ADD2 ( space ) #fff0 .textarea/length LDZ2 ;text ADD2 SUB2 STH2k ;shiftr JSR2
	( erase when selection length )
    ;is-block JSR2 ,&no-selection JCN
        ;erase-selection JSR2
        &no-selection
	( push right ) .selection/from LDZ2
		( EOF ) ;text .textarea/length LDZ2 ADD2
		( space ) #fff0 .textarea/length LDZ2 ;text ADD2 SUB2 STH2k ;shiftr JSR2
	;snarf-txt .File/name DEO2
	STH2kr .File/length DEO2
	.selection/from LDZ2 .File/read DEO2
	( pull left ) .selection/from LDZ2 STH2kr ADD2 ( EOF ) ;text .textarea/length LDZ2 ADD2 STH2r .File/success DEI2 SUB2 ;shiftl JSR2
	( pull left ) .selection/from LDZ2 STH2kr ADD2
		( EOF ) ;text .textarea/length LDZ2 ADD2
		( space ) STH2r .File/success DEI2 SUB2 ;shiftl JSR2
	( cap ) #00 ( EOF ) ;text .textarea/length LDZ2 ADD2 STA
	.selection/from LDZ2 .File/success DEI2 ADD2 ;select-start JSR2