This PR implements #4800. It also sort-of implements #4232 - it does reflow lazily, though it doesn't specifically use the "idle callbacks". Motivation is described in #4800; however, the implementation is different (though the same basic idea).
The NewBufferLine implementation is enabled if the newBufferLine option is true; otherwise the old implementation (renamed to OldBufferLine) is used. The goal is to merge the PR with newBufferLine defaulting to false to avoid breaking things, but allowing adventurous users and developers to try newBufferLine set to true. (Some more testing will be needed even for the newBufferLine false case; I believe there are regressions.)
Note that NewBufferLine is abstract and has two implementation classes:
LogicalBufferLine represents an unwrapped line, but it also contains the data for following wrapped lines.
WrappedBufferLine represents a wrapped line (duh) and basically just indirects to the previous LogicalBufferLine.
Operations that are O(1) in OldBufferLine may require linear scanning in NewBufferLine. However, LogicalBufferLine has a cache (mapping column index to _data array index) to avoid linear scanning for common operations. There is some needless overhead in the interest of minimizing API changes.
Later, the newBufferLine default will change to true. Later still, we will remove the support for OldBufferLine and NewBufferLine will be renamed to plain BufferLine.
The AbstractBufferLine class is intended as a parent for both [New]BufferLine and future classes for "other" content. Specifically, general HTML "paragraphs" (<div> elements) are planned.
Tasks that must be done before merger:
[ ] Fix any oldBufferLine regressions. (Minor barely-measurable performance regressions may be OK.)
[ ] Update or replace any commented-out testcases.
[ ] Fix remaining lint regressions. Note this issue.
[ ] ...
Tasks that must be done before defaulting to newBufferLine true:
[ ] Fix all testsuite regressions (at least all that may be in real usage).
[ ] IExtendedAttrs handling is incomplete (though basic data structure support is there).
[ ] The image addon doesn't work. It uses custom classes that textually copy the old classes.
[ ] Fix at least noticeable performance regressions, if any.
This PR implements #4800. It also sort-of implements #4232 - it does reflow lazily, though it doesn't specifically use the "idle callbacks". Motivation is described in #4800; however, the implementation is different (though the same basic idea).
The
NewBufferLine
implementation is enabled if thenewBufferLine
option is true; otherwise the old implementation (renamed toOldBufferLine
) is used. The goal is to merge the PR withnewBufferLine
defaulting to false to avoid breaking things, but allowing adventurous users and developers to trynewBufferLine
set to true. (Some more testing will be needed even for thenewBufferLine
false case; I believe there are regressions.)Note that
NewBufferLine
is abstract and has two implementation classes:LogicalBufferLine
represents an unwrapped line, but it also contains the data for following wrapped lines.WrappedBufferLine
represents a wrapped line (duh) and basically just indirects to the previousLogicalBufferLine
.Operations that are O(1) in
OldBufferLine
may require linear scanning inNewBufferLine
. However,LogicalBufferLine
has a cache (mapping column index to_data
array index) to avoid linear scanning for common operations. There is some needless overhead in the interest of minimizing API changes.Later, the
newBufferLine
default will change to true. Later still, we will remove the support forOldBufferLine
andNewBufferLine
will be renamed to plainBufferLine
.The
AbstractBufferLine
class is intended as a parent for both[New]BufferLine
and future classes for "other" content. Specifically, general HTML "paragraphs" (<div>
elements) are planned.Tasks that must be done before merger:
oldBufferLine
regressions. (Minor barely-measurable performance regressions may be OK.)Tasks that must be done before defaulting to
newBufferLine
true:IExtendedAttrs
handling is incomplete (though basic data structure support is there).image
addon doesn't work. It uses custom classes that textually copy the old classes.