Skip to content

Update Text Container Width Correctly - #177

Merged
thecoolwinter merged 3 commits into
CodeEditApp:mainfrom
thecoolwinter:bugfix/container-width
Apr 22, 2023
Merged

thecoolwinter merged 3 commits into
CodeEditApp:mainfrom
thecoolwinter:bugfix/container-width

Conversation

@thecoolwinter

@thecoolwinter thecoolwinter commented Apr 21, 2023 •

Copy link
Copy Markdown
Collaborator

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

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screen.Recording.2023-04-21.at.12.18.29.PM.mov

Comment thread Sources/CodeEditTextView/Controller/STTextViewController+Highlighter.swift Outdated
@thecoolwinter
thecoolwinter merged commit 84505b4 into CodeEditApp:main Apr 22, 2023
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.

2 participants