Skip to content

Refactor so isWrapped isn't public writeable#5788

Open
PerBothner wants to merge 3 commits intoxtermjs:masterfrom
PerBothner:setWrapped
Open

Refactor so isWrapped isn't public writeable#5788
PerBothner wants to merge 3 commits intoxtermjs:masterfrom
PerBothner:setWrapped

Conversation

@PerBothner
Copy link
Copy Markdown
Contributor

Having a publicly-writable isWrapped property in BufferLine restricts our implementation options for how wrapped lines are represented in a Buffer. For example, it conflicts with the proposal in #5673.

To hide this implementation choice, this PR makes isWrapped read-only, and adds a Buffer.setWrapped method (taking an absolute row number) for modifying the isWrapped state. There is also an internal-only BufferLine.setWrapped method used to implement Buffer.setWrapped and 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.

Instead to change isWrapped state use a Buffer.setWrapped method.
This allows for potential flexibility in how BufferLine
and line-wrapping are implemented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant