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

🐞 Incorrect sentence wrapping algorithm (text clips at the right side) #164

Closed richardtop closed 1 year ago

richardtop commented 1 year ago

Description

If a long line text is inserted into the editor, it should be wrapped eventually. The wrapping occurs correctly, however sometimes the text at the right side is clipped, when that particular word should have been wrapped to the new line instead.

To Reproduce

  1. Insert a long line of text to the editor, e.g.:

CalendarKit is a Swift calendar UI library for iOS and Mac Catalyst. It looks similar to the Apple Calendar app out-of-the-box, while allowing customization when needed. CalendarKit is composed of multiple modules which can be used together or independently.

(that text should be inserted as a single line, without line breaks)

  1. Try resizing the window's width so that the text is wrapped to the new line
  2. Observe, that sometimes some portions of the text at the right side are clipped (refer to the screenshots)

Expected Behavior

The clipping doesn't occur and instead the word is wrapped to the new line. There seem to be some problem with wrapping algorithm, very likely some margin/padding issue. Adding some padding to wrap the word earlier would resolve the error.

Version Information

CodeEdit: [e.g. 0.0.3-alpha.30]

Additional Context

No response

Screenshots

Bildschirm­foto 2023-03-19 um 05 36 33 Bildschirm­foto 2023-03-19 um 05 36 38
austincondiff commented 1 year ago

This is related to #148. The text view is getting pushed by the ruler view.