When emitting the `did-change` event, `updateFoldableStatus` used to extend the
change region up and down to include all the lines that changed their
foldability status because of a buffer change. I assume this was supposed to
invalidate folds that *contained* the change whenever a line was edited in a way
that affected also the previous or subsequent ones.
That information, however, is not being used by `DisplayBuffer`, which does not
alter existing folded regions when they become invalid.
I believe the correct behavior should be to unfold the invalid region and
recompute those screen lines. Nonetheless, it seems reasonable to me to keep the
original (wrong) behavior and not address it in this branch, because it strays
from the original intent of this refactoring.
We should probably fix it once for all in another PR or when
integrating/implementing `DisplayLayer`.
I switched to first-mate Selector because I didn’t want to replicate
the poorly-defined Token::matchesScopeSelector method now that tokens
are not stored on lines. However, the first-mate semantics are stricter
and that broke the API. Perhaps using selector-kit here would be better,
but I just wanted to put back exactly to how it was for now.
/cc @ypresto
Previously, instantiating a TextEditor would always compute compute
screen lines twice: once when the DisplayBuffer was instantiated,
and once when the 'invisibles' property was set on the DisplayBuffer.
This moves observation of the config keys to Editor, which assigns the
invisibles hash or null on the TokenizedBuffer via the DisplayBuffer to
control whether we render invisibles or not.
Fixes#2367
* The indent level of empty lines is the *max* of the nearest non empty
line, rather than favoring the level of the line below.
* An extra wrap guide is no longer rendered for empty lines
I didn't port the specs over because we already had good coverage at the
model level. It just needed to be updated for the preferred behavior.