CodeEditApp / CodeEditSourceEditor

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

Update Text Container Width Correctly #177

Closed thecoolwinter closed 1 year ago

thecoolwinter commented 1 year ago

Description

This PR updates the wrapLines setting to affect the text view's text container size. This fixes the horizontal scrolling bugs seen recently. In effect, it locks the width of the text view to the width of the visible container when wrapLines is set to true, and lets the text view determine it's own width when false.

This is done by accounting for the ruler view size when wrapLines is set to true. It also makes sure to update the text container and text view frame size as needed when the ruler or window size change and when the wrapLines setting is updated.

Related Issues

Checklist

Screenshots

https://user-images.githubusercontent.com/35942988/233697019-7b13d78d-b50c-4c61-b58c-28a8695d8a54.mov