WIP incorrect_line_wrapping_endash #37
No reviewers
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#37
Loading…
Reference in New Issue
No description provided.
Delete Branch "asdf/bombadillo:incorrect_line_wrapping_endash"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR is being submitted for a possible fix to line wrapping with unicode characters.
The version currently submitted has 3 versions of
wrapLines()
for performance review. The final version would have this removed.The performance benchmark tests should run from
bombadillo/cui
directory asgo test -bench=.
Looking at the benchmarks this seems to get the best combination of speed and function (len on its own being faster). I like the count rune in string method for its clarity, if we go with this maybe add a code comment for why we are casting to rune. I could see myself forgetting, or someone looking at it not knowing in the first place.
If you agree with the assessment, please remove the other two and update the branch and I'll complete the pull request into master :)
Otherwise, let me know and we can talk out the other options.
I've finalised this PR and suggest it be merged for v1 or canned in anticipation of v2.
When wrapping lines, this measures characters in a more correct way, so wrapping is more accurate.
There are other issues with line wrapping that are not addressed by this PR, but are addressed in v2. Also, no new tests have been added as they do not reliably test this behaviour.
Looks good to me! I think continuing to make fixes like this, particularly for things where we've talked through options and found a workable solution, is still a good thing to do for v1. It is possible that someone may have a preference for v1 over v2 once it comes out and I'd like them to have the best experience possible. :)
This code looks good. Merging in now 👍