diff --git a/gui/notepad/notepad.tal b/gui/notepad/notepad.tal index 7e39e82..b83bafe 100644 --- a/gui/notepad/notepad.tal +++ b/gui/notepad/notepad.tal @@ -185,9 +185,9 @@ BRK .selection/from LDZ2 STH2k #0001 SUB2 get-eof #0001 msfr STH2kr STA - STH2r INC2 + STH2r INC2 select-from -!select-from +!file-save @erase ( -- ) @@ -200,14 +200,15 @@ BRK .selection/from LDZ2 #0001 SUB2 DUP2 cut-char + select-from -!select-from +!file-save @erase-selection ( -- ) - .selection/from LDZ2 get-eof .selection/length LDZ2 + .selection/from LDZ2 get-eof .selection/length LDZ2 msfl -!msfl +!file-save @delete ( -- ) @@ -219,8 +220,9 @@ BRK &no-block .selection/from LDZ2 cut-char + redraw -!redraw +!file-save @get-eof ( -- addr* ) @@ -251,21 +253,15 @@ BRK DUP2 .selection/from STZ2 .selection/to STZ2 - .selection/to LDZ2 .selection/from LDZ2 SUB2 .selection/length STZ2 - #00 ;on-frame/f STA - -!redraw +!select @select-to ( addr* -- ) ( min ) .selection/from LDZ2 GTH2k [ JMP SWP2 POP2 ] ( max ) get-eof #0001 SUB2 LTH2k [ JMP SWP2 POP2 ] - .selection/to STZ2 - .selection/to LDZ2 .selection/from LDZ2 SUB2 .selection/length STZ2 - #00 ;on-frame/f STA -!redraw +!select @select-word ( addr* -- ) @@ -273,7 +269,7 @@ BRK &back #0001 SUB2 LDAk #20 GTH ?&back INC2 .selection/from STZ2 &next INC2 LDAk #20 GTH ?&next .selection/to STZ2 -!redraw +!select @select-all ( -- ) @@ -281,7 +277,12 @@ BRK DUP2 .selection/from STZ2 scap .selection/to STZ2 +( >> ) + +@select ( -- ) + .selection/to LDZ2 .selection/from LDZ2 SUB2 .selection/length STZ2 + #00 ;on-frame/f STA !redraw @@ -341,7 +342,6 @@ JMP2r @file-new ( -- ) - ( initialize pages ) #0801 &l #00 OVR #c0 SFT2 ;mem ADD2 STH2 #20 STH2r STA @@ -352,9 +352,11 @@ JMP2r @file-save ( -- ) + ;notepad-txt .File/name DEO2 + #8000 .File/length DEO2 + ;mem .File/write DEO2 + JMP2r - - @notepad-txt ".notepad $1 @file-size ( path* -- size* )