New Implementation Concept for the Elide Feature

With the implementation of the new tag handling the determination whether a segment is elided, is very fast now. For a fast skip to the start or end of elided regions new segment types have been introduced: Branch and Link. When an elided regions starts, a Branch segment will be inserted, and at the end of the elided region a Link segment will be inserted. The Branch points to the Link, and vice versa. As soon as a Branch/Link will be encountered, the elided region can be skipped in constant time.

Furthermore any physical line, which starts a logical line (in case of elided newlines succeeding lines will be merged into this logical line when displaying), will be flagged as logical line, and this flag will be propagated in the B-Tree; in this way a fast search of logical lines is possible, and this also provides a fast search of starting/ending points of an elided region.

Moreover in revised implementation the elide feature does not influence the performance of the text widget anymore, if this elide feature is completely unused. In old implementation the handling of the elide feature is slow, even if this feature is not used at all.

Another fact is that the prior implementation of this feature is more or less a hack, and has still severe problems; for examples see Bugs in Display Logic.

I like to state that the introduction of the elision feature in quite unsuccessful, it's simple the wrong place, such a feature has to be provided in a layer above the text widget. If implemented in a higher level a clean and quite easy implementation is possible, but the implementation inside the text widget is expensive and error-prone. The latter cannot be avoided, because it is required to handle this feature as a special case at several places, and it has some side-effects which has also to be handled at several places. IMO the elision has to be removed in a future version, this would simplify the text widget implementation significantly. As an alternative a layer above the text widget should be provided, such a layer is easy to implement; this is the way how I solved this in application Scidb – in Scidb a layer which controls the text widget is used.


This seems to be the right place for an important correction in the documentation about the -elide option, also an restriction has been added:

-elide boolean

Elide specifies whether the data should be elided. Elided data (characters, soft hyphens, images, embedded windows, etc) is not displayed and takes no space on screen, but further on behaves just as normal data. An empty string (instead of a boolean value) is clearing the elide option of this tag. It is not allowed to set this option with the special selection tag sel.

It's not implemented to support the elision option in case of the special selection tag sel, so it's forbidden. This is not really incompatible to wish8.6, because the old implemented did also not implement this, although it did not catch this case as an error (and nobody want's to set the elide option with this tag).