dos_compilers/DX-FORTH v430/SED.SCR

1 line
30 KiB
Plaintext
Raw Normal View History

2024-07-09 18:07:02 +02:00
\ Information A full-screen editor for DX-Forth. Based on the editor from "Forth - A Text and Reference" by Kelly & Spies. Usage: n SED ( edit screen n ) SED ( edit screen where error occured ) Ctl-D Right cursor Ctl-Y Delete line Ctl-C Next block Ctl-S Left cursor Ctl-N Insert line Ctl-R Prev Block Ctl-E Up cursor Ctl-T Erase to EOL Ctl-L Restore blk Ctl-X Down cursor Ctl-A Save line Ctl-J Jump to blk Ctl-I Tab cursor Ctl-P Restore line Ctl-K Update block Ctl-Q Home cursor Ctl-O Open-up line Ctl-V Insert toggleCtl-G Del next char Ctl-W Split line Ctl-B Redraw screenCtl-H Del prev char Ctl-F Join line Ctl-Z Functions Ctl-U Exit editor Esc Graphic toggle \ Load block forth definitions decimal sys @ system cr .( loading Screen Editor ) 2 #screens 1- thru forth definitions decimal sys ! \ Constants, variables vocabulary EDITOR editor definitions \ 1024 constant B/BUF \ bytes per block buffer \ 64 constant C/L \ columns per line : L/S b/buf c/l / ; \ lines per screen 4 constant X \ screen x offset 2 constant Y \ screen y offset 4 constant TBS \ tab size increment variable R# \ cursor row position variable C# \ cursor col position variable INS \ insert flag variable QF \ quit flag variable GF \ graphics flag \ WAIT HI RNG? \ Short pause : WAIT ( -- ) 500 ms ; \ Highest block number : HI ( -- u ) #screens 1- 0 max ; \ Test if block u is within range : RNG? ( u -- u f ) dup 0 #screens within ;