~rabbits/left

49bf9f61f12e154a829f5b062e5706fcf2f136ca — Devine Lu Linvega a month ago ac9bd88
Trim double-spaces
1 files changed, 21 insertions(+), 15 deletions(-)

M src/left.tal
M src/left.tal => src/left.tal +21 -15
@@ 81,7 81,7 @@ BRK
		01 "g =file-goto "OpenSelection $1
		01 "s =file-save "Save $1
		01 "q =exit "Exit $1
	07 "Edit $1
	08 "Edit $1
		01 "c =edit-copy "Copy $1
		01 "v =edit-paste "Paste $1
		01 "x =edit-cut "Cut $1


@@ 89,6 89,7 @@ BRK
		00 7f =delete "Delete $1
		01 09 =edit-select-at "SelectWord $1
		00 1b =reset-selection "SelectReset $1
		00 00 =edit-trim "Trim $1
	01 "Find $1
		01 "f =capture-selection "Selection $1
	01 "View $1


@@ 1207,16 1208,7 @@ JMP2r

@file-save ( -- )

	( remove trailing whitespace )
	get-eof ;text
	&l
		LDA2k #0920 NEQ2 ?&no-ts INC2k trim &no-ts
		LDA2k #2009 NEQ2 ?&no-st DUP2 trim &no-st
		LDA2k #200a NEQ2 ?&no-s DUP2 trim &no-s
		LDA2k #090a NEQ2 ?&no-t DUP2 trim &no-t
		INC2 GTH2k ?&l
	POP2 POP2
	reset-selection
	edit-trim

	;filepath .File/name DEO2
	;text slen .File/length DEO2


@@ 1266,15 1258,29 @@ JMP2r
	;snarf-txt .File/name DEO2
	STH2kr .File/length DEO2
	.selection/from LDZ2 .File/read DEO2
	.selection/from LDZ2 STH2r ADD2 !select-start
	.selection/from LDZ2 STH2r ADD2

( .. )
!select-start

@edit-select-at ( -- )

	.selection/from LDZ2 !select-word
	.selection/from LDZ2

( .. )
!select-word

@edit-trim ( -- )

	get-eof ;text
	&l
		LDA2k #0920 NEQ2 ?&no-ts INC2k trim &no-ts
		LDA2k #2009 NEQ2 ?&no-st DUP2 trim &no-st
		LDA2k #2020 NEQ2 ?&no-ss INC2k trim &no-ss
		LDA2k #200a NEQ2 ?&no-s DUP2 trim &no-s
		LDA2k #090a NEQ2 ?&no-t DUP2 trim &no-t
		INC2 GTH2k ?&l
	POP2 POP2

!reset-selection

(
@|stdlib )