Ken, VIT is the coolest thing I've seen in a while, but it looks like it was never released. Would you happen to still have the notes you made while delving into EDIT's internal routines?
While not as neat as implementing vi using the guts of EDIT, I wonder if modifying the key strokes might be an easier way to go. Did you ever read that Portable 100 article <https://archive.org/details/P100-Magazine/1989-03/page/8/mode/1up> on catching the EDIT keystrokes in a hook? I saw on the Bitchin100 site that John improved the technique so it actually works <https://bitchin100.com/wiki/index.php?title=TextStar> instead of corrupting your files. If there's good documentation anywhere of how EDIT works internally, I'd like to see it. If the code is not too intertangled, perhaps the INSERT CHAR and DELETE CHAR routines could be surgically replaced with a gap buffer implementation. FIND and MENU would both need to have a hook added to remove the gap, but that should be easy. The WORD WRAPPING could be the trickiest to get right as it would need to deal with a word with a hole in the middle. I'm not sure if this would work, but I think one possible solution would be to only allow the gap at a newline instead of before any character. Another would be to work on a copy of each line in a way similar to how EDIT already does when editing only select lines of a BASIC program: Shift the region to be edited to the end of the file, before the sea of nulls, so it looks like just a very short file. —b9 P.S. I've read various web pages about how vi's data structures worked. I think the original simply used an array of pointers to lines. My foggy recollection is that vim uses a Piece Table, same as Microsoft Word and Visual Studio. Have you ever read "The Art of Crafting a Text Editor"? https://www.finseth.com/craft/ On Thu, Feb 5, 2026 at 5:42 AM Kenneth Pettit <[email protected]> wrote: > On 2/5/26 4:57 AM, B 9 wrote: > > > Ken: That is an amazing write up of how EDIT manages memory. Is all that > documented somewhere or did you figure it out yourself? (Virtual T > continues to astonish me with hidden uses.) > > > Thanks! Back in 2013 I was working on a program for Model 100 (an OptROM > program that also included TS-DOS in the OptROM) to "augment" the editing > capabilities. It was / is called VIT (Vi for model T). I have a lot of it > actually functioning, but to get it to that point, I had to disassemble > large portions of the TEXT routines because VIT operates by making calls > into the TEXT code to perform it's edit operations (largely): > > > > Ken >
