~rabbits/left

b301f5076dadcd73ea85fa166fcdb5eb25cf1986 — Devine Lu Linvega 24 days ago 2d57d15
Adding a Go menu
1 files changed, 33 insertions(+), 19 deletions(-)

M src/left.tal
M src/left.tal => src/left.tal +33 -19
@@ 72,13 72,15 @@ BRK

@manifest

	06 "Left $1
	05 "Left $1
		01 "n =file-new "New $1
		01 "r =trap "Rename $1
		01 "o =file-open "Open $1
		01 "g =file-goto "OpenSelection $1
		01 "s =file-save "Save $1
		01 "q =exit "Exit $1
	02 "Go $1
		01 "/ =go-directory "Directory $1
		01 "g =go-selection "Selection $1
	08 "Edit $1
		01 "c =edit-copy "Copy $1
		01 "v =edit-paste "Paste $1


@@ 1103,7 1105,7 @@ JMP2r

	DUP draw-position
	DUP ;draw-chr/color STA
	#04 get-catx .Screen/x DEO2
	#05 get-catx .Screen/x DEO2
	#0004 .Screen/y DEO2
	;filepath draw-str POP2



@@ 1111,7 1113,7 @@ JMP2r

@draw-position ( color -- )

	#04 get-catx
	#05 get-catx
	;filepath get-strw ADD2 .Screen/x DEO2
	#0004 .Screen/y DEO2
	DUP ;draw-chr/color STA


@@ 1140,6 1142,33 @@ JMP2r
JMP2r

(
@|Go )

@go-selection ( -- )

	#00 draw-filepath
	( copy selection to filepath )
	.selection/to LDZ2 .selection/from LDZ2 [ LITr -filepath ]
	&w
		( end of buffer ) STHkr .filepath/end EQU ?&e
		( end of selection ) EQU2k ?&e
		( whitespace ) LDAk #21 LTH ?&e
		LDAk STHkr STZ INC2 INCr !&w
	&e
	( cap buffer ) #00 STHr STZ
	POP2 POP2
	#0000 set-scroll-y

!file-open

@go-directory ( -- )

	#00 draw-filepath
	LIT2 ". 00 .filepath STZ2

!file-open

(
@|document )

@file-new ( -- )


@@ 1163,21 1192,6 @@ JMP2r
!draw-textarea
	&untitled-txt "untitled.txt $1

@file-goto ( -- )

	#00 draw-filepath
	( copy selection to filepath )
	.selection/to LDZ2 .selection/from LDZ2 [ LITr -filepath ]
	&w
		( end of buffer ) STHkr .filepath/end EQU ?&e
		( end of selection ) EQU2k ?&e
		( whitespace ) LDAk #21 LTH ?&e
		LDAk STHkr STZ INC2 INCr !&w
	&e
	( cap buffer ) #00 STHr STZ
	POP2 POP2
	#0000 set-scroll-y

@file-open ( -- )

	;text #ffff OVR2 SUB2 mclr