[colorforth] Editing
- Subject: [colorforth] Editing
- From: Charles Shattuck <cshattuck@xxxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 11:38:14 -0800
I have modified the colorforth editor to allow something like the def
and find functions mentioned earlier. I've posted the new code, blocks
132 and 134, on http://home.surewest.net/cshattuck/ and I hope some of
you will try it and let me know what you think. Be warned that I had to
go searching for the addresses of some variables and jump tables to be
patched, and if your version of colorForth has different addresses then
it will probably crash. To the best of my recollection the version I am
using is the one from Chuck's website. If you get it working then you
might want to add 132 load to block 18 so it becomes part of your
default editor. Of course you don't need to put it at block 132 either,
that's just a free block in my system. I have no idea what it would
take to make this work in windows or linux.
I am a little embarrassed to say that I haven't figured out @+ using the
a register (EDX), so I used a variable called addr instead. I'd be
happy if someone could show me how to code @+ properly.
The new editor functions are in the home row of the left hand while
editing, cnfj. C changes the color of the word the cursor is pointing
back at, cycling through white, yellow, and green. It won't affect
numbers or variables. I've often wanted to be able to comment out a
word while testing, then restore it easily later, and now I can.
F will strip the color tag from the word under the cursor, put it in the
variable wrd, then search starting at block 18 until it either finds the
word or reaches block 150 (arbitrary, you can change it). If the word
is found the cursor is placed after the word in the new block and the
editor shows that screen. N will repeat the last search (the word in
wrd) starting just after the current cursor location. J will go back to
the screen last called up by the word 'edit', so you can quickly return
to the screen you were working on. This is the only command that is
just like what Chuck showed us, as far as I can tell.
Since the color tag is stripped, the search will find every instance of
the word no matter what the color. This usually results in finding the
red definition of the word first, then the yellow or green uses of the
word, and possibly white comments in shadow blocks referring to the
word.
Charley Shattuck.
---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com