-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix off by one error in hightlight #650
Conversation
This reverts commit 62f53e4.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #650 +/- ##
==========================================
+ Coverage 17.87% 23.10% +5.22%
==========================================
Files 42 42
Lines 5431 5492 +61
==========================================
+ Hits 971 1269 +298
+ Misses 4460 4223 -237 ☔ View full report in Codecov by Sentry. |
Hmm, what client are you using that inserts newlines in the message? So I can test this myself. Also did you make sure the PR was applied? |
Just twt, there are no newlines. Only line breaks are done by textwrap afaik. And yes the pr is applied |
Ah my bad then I didn't understand the issue right, let me fix this |
2f14c71
to
cd3570c
Compare
This should now be fixed, let me know if it works! |
This looks like the correct fix and works 👍 |
Ok this time I'm pretty sure I tested it properly. I'll update the required dependencies in a new commit. |
It's a quick fix but should work.
I don't know if it would be more efficient to maybe get the highlights indices after wrapping the message, which is the core of the issue here.
edit: I just realized it would break highlight of words spanning multiple lines so I'm not sure what a better solution would look like.
I couldn't manage to find how to send a message with newlines either with the twitch website or with twt so I just added a test case for it, but maybe @vesdev can confirm this fixes it?
Oh and I reverted the PR completely, which downgrades ahash, let me know if you want me to update it back.