home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!cs.utexas.edu!torn!watserv2.uwaterloo.ca!watserv1!mks.com!ant
- From: ant@mks.com (Anthony Howe)
- Newsgroups: comp.editors
- Subject: Q: Line # addressing using buffer gap.
- Keywords: Finseth, Craft, Of, Text, Editing, buffer, gap
- Message-ID: <1992Aug18.132755.25619@mks.com>
- Date: 18 Aug 92 13:27:55 GMT
- Organization: Mortice Kern Systems Inc., Waterloo, Ontario, CANADA
- Lines: 26
-
-
- Is there a reasonably fast technique, given a Buffer Gap structure,
- for finding line number X. Currently, AE, just performs linear scans
- for <newline> marks when performing cursor motion, since the
- assumption is that the majority of movement is localized.
-
- Being able to find the start of a line quickly would help in
- implementing a Goto-Line command and possibly a better screen update
- manager.
-
- I think I read somewhere about the idea of keeping a table of buffer
- indexes that correspond to each line. Then as you insert or delete
- characters in a given line, all the indexes above line X would need to
- be updated. This idea strikes me as being very ugly since the time to
- update the indexes is dependant on which line you are currently at.
- If you were at the end of the file, this would be very quick, but if
- you were at the beginning of the file, this time maybe unacceptable
- for large files.
-
- Ideas anyone?
-
- -ant
- --
- ant@mks.com Anthony C Howe
- Mortice Kern Systems Inc. 35 King St. N., Waterloo, Ontario, Canada, N2J 6W9
- "Nice legs. For a human that is." - Worf (Q-pid)
-