Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!brutus.cs.uiuc.edu!psuvax1!gatech!prism!fsu!loligo!pepke From: pepke@loligo (Eric Pepke) Newsgroups: comp.sys.mac.programmer Subject: Re: Serious programming question Message-ID: <299@fsu.scri.fsu.edu> Date: 23 Oct 89 15:21:20 GMT References: <89295.142753CXT105@PSUVM.BITNET> <4002@helios.ee.lbl.gov> <8785@hoptoad.uucp> Sender: news@fsu.scri.fsu.edu Reply-To: pepke@loligo.UUCP (Eric Pepke) Organization: Supercomputer Computations Research Institute Lines: 26 It just so happens that I am curently working on a text editor for programming right now. I am using a single buffer with a single gap using long integers to remember the offsets to the gap, which I think is similar to the way Capps used to do it. (If Capps were still a supported product, I would probably be using it.) A reasonably large gap is kept at the current insertion point. Normal character insertions just go into the gap and make the gap one character smaller. Deletions of single characters just increase the size of the gap by one. The only times that text has to be moved are when a new gap is allocated or the old gap is removed. The idle routine tries to do this at unobtrusive times. Scroll bar handling is done as an integral part of the text editor. I strongly recommend that you do this rather than follow TextEdit's method. Scroll bar handling for long integers is very easy to do cleanly if you have enough information available. If you try to tack it on outside of the editor a la TextEdit, it is very difficult to do cleanly. Eric Pepke INTERNET: pepke@gw.scri.fsu.edu Supercomputer Computations Research Institute MFENET: pepke@fsu Florida State University SPAN: scri::pepke Tallahassee, FL 32306-4052 BITNET: pepke@fsu Disclaimer: My employers seldom even LISTEN to my opinions. Meta-disclaimer: Any society that needs disclaimers has too many lawyers.