CodeEditApp / CodeEditSourceEditor

A code editor view written in Swift powered by tree-sitter.
https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor
MIT License
511 stars 78 forks source link

🐞 Text doesn't re-wrap on width change #84

Closed thecoolwinter closed 1 year ago

thecoolwinter commented 1 year ago

Description

When changing the width of the view the text won't unwrap or wrap lines as the width changes. However, if you scroll away from the text and scroll back to it, it is laid out correctly.

This might just require forcing a layout when the view's width changes.

To reproduce

Expected Behavior

The lines should update as the view width changes, instead of needing a scroll to re-layout.

Additional Context

https://user-images.githubusercontent.com/35942988/198495074-e7c43f4d-48c3-4e21-8297-cf8ee66de283.mov

Relate Issues

This issue should be worked on with the above issue.

ben-p-commits commented 1 year ago

Looks like this issue is a regression caused by a layout manager replacement happening in STTextViewcontroller.

More details in my comment on the related enhancement

ben-p-commits commented 1 year ago

@thecoolwinter - can you assign this one to me? knocking it out in tandem with https://github.com/CodeEditApp/CodeEditTextView/issues/66, and https://github.com/CodeEditApp/CodeEdit/issues/868.

thecoolwinter commented 1 year ago

@thecoolwinter - can you assign this one to me? knocking it out in tandem with https://github.com/CodeEditApp/CodeEditTextView/issues/66, and https://github.com/CodeEditApp/CodeEdit/issues/868.

For sure! Make sure to mention the issues in any PRs you make too.

thecoolwinter commented 1 year ago

Fixed with #105. Thanks Ben!