Refactor so isWrapped isn't public writeable#5788
Conversation
Instead to change isWrapped state use a Buffer.setWrapped method. This allows for potential flexibility in how BufferLine and line-wrapping are implemented.
|
It would be great if someone could merge this. It allows (but does not require) alternative implementation stategies for BufferLine, such as PR #5797. I believe this should be trivially reviewable and hopefully non-controversial. |
Can you expand on why this would be needed? Is this an attempt to hide the row logic behind If we go that route with hiding abstraction behind |
|
The motivation of this PR was to split off part of PR #5797 that can be reviewed separately. Like ad hoc "stacked PRs". For #5797 (and probably other alternative Buffer implementation strategies) changing a line from wrapped to non-wrapped or vice versa isn't a matter of just flipping a bit - there are more extensive changes that need to be done. For PR #5797 you would need to split or merge the related LogicalLine objects. So changing the isWrapped state becomes a more expensive operation. (Though note that setting isWrapped is usually when a new line is scrolled in, when a new BufferLine is created. Clearing isWrapped is usually when a line or buffer is erased, so those operations can be combined.)
Most of the other changes involving LogicalLine are hidden inside BufferLine.js (except for buffer reflow in Buffer.ts, which becomes vastly simpler and more efficient), but changing isWrapped to read-only is the main API change. It would probably be straightforward to make isWrapped is a
PR #5797 makes it trivial to see if the current line wraps to the next one: Just check Perhaps it would be more useful to come back this PR after looking at PR #5797. If you prefer, I can merge this into the latter, making the latter slightly larger, but perhaps better justified. I am also interested in exploring this Marker proposal, which I think will have significant performance and extensibility advantages, but I think PR #5797 needs to be merged first. |
Bumps [axios](https://github.com/axios/axios) from 1.13.2 to 1.15.0. - [Release notes](https://github.com/axios/axios/releases) - [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md) - [Commits](axios/axios@v1.13.2...v1.15.0) --- updated-dependencies: - dependency-name: axios dependency-version: 1.15.0 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
Disable desynchronized 2D canvas mode for image layers so resize paint stays synchronized and avoids blank-frame jitter on some platforms. Signed-off-by: sergiochan <yuheng9211@qq.com>
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.11 to 1.16.0. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.15.11...v1.16.0) --- updated-dependencies: - dependency-name: follow-redirects dependency-version: 1.16.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
- change interface to IFunctionIdentifier (API change) - extend parser states APC_ENTRY, APC_INTERMEDIATE, APC_PASSTHROUGH - remove APC_STRING - change ApcParser.start to retrieve ident - change actions APC_START and APC_PUT
Broke due to 2 recent conflicting PRs
This allows O(1) clearing of the cache, a single TTL timer and we can avoid making BufferLine's Disposable
Bit hacky, but this is due to the way we're serializing the line in the test
Having a publicly-writable
isWrappedproperty inBufferLinerestricts our implementation options for how wrapped lines are represented in aBuffer. For example, it conflicts with the proposal in #5673.To hide this implementation choice, this PR makes
isWrappedread-only, and adds aBuffer.setWrappedmethod (taking an absolute row number) for modifying theisWrappedstate. There is also an internal-onlyBufferLine.setWrappedmethod used to implementBuffer.setWrappedand in one other place.This gives greater flexibility in how BufferLine and line-wrapping are implemented.
This is likely to trivially conflict with PR #5785. If one of these is merged, I'll update the other one to fix any conflicts.