home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!comp.vuw.ac.nz!waikato.ac.nz!bwc
- From: bwc@waikato.ac.nz (Ug!)
- Newsgroups: comp.sys.acorn
- Subject: Re: How *does* one write a good text editor?
- Message-ID: <1992Aug27.160053.10398@waikato.ac.nz>
- Date: 27 Aug 92 16:00:53 +1200
- References: <18053@acorn.co.uk>
- Organization: Vooniersity fo Kaiwato
- Lines: 21
-
- Philip Colmer writes:
- > If you were writing a text editor which allowed text effects (eg font
- > changes, colour changes, etc) to be applied, how would you hold the
- > data? My initial thoughts are:
-
- This is a *text* *editor*? How do you save the effects without having
- some sort of formatting information added to the text?
-
- > * keep the text as one contiguous block of memory
- > * keep a linked list of effects, specifying the effect to be applied
- > and the start and end character offset for the effect
- > * keep a linked list of line start offsets.
-
- Or: embed the effects. I'd imagine this would be slower. Perhaps a
- combination of the two:
-
- <effect><text-length><text...>
-
- Then to render it you would simple render what amounts to a list of
- effect/text combinations.
- Ug!
-