[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua and text-representation
- From: Gavin Wraith <gavin@...>
- Date: Tue, 02 Mar 2010 09:01:23 GMT
In message <19FA66B9-0BD0-448B-A85F-12E1B81A192E@grubmah.com> you wrote:
> I think that approach is basically known as a gap buffer.
> Text markers can be stored as a mapping from marker ID to offset.
A good feature of representing a gap buffer by a pair of lists (
before-cursor, after-cursor) is that if the after-list is indexed
from the end of the text, markers are invariant under cursor movement,
until they get spilled from one list to the other. That particular
update can then be done lazily, until an action that uses the marker
Gavin Wraith (email@example.com)
Home page: http://www.wra1th.plus.com/