LadyDefile / Wordsmith-DalamudPlugin

Wordsmith is a Dalamud Plugin aiming to make roleplay easier, more convenient, and harder to accidentally "wrong chat" your post.
7 stars 3 forks source link

[BUG] Re-size of window leads to "spelling errors" #35

Closed Nanu308 closed 1 year ago

Nanu308 commented 1 year ago

Here is the text i added in written from Word to make certain it has no spelling errors.

Here is a random text I am going to grab from word and copy paste into wordsmith, and then we’ll see if it breaks apart. Oh well, bugs do need to be squashed, or could it be user error, I do not know, so that is why is m doing this here! bilde

Then when you paste it into Wordsmith, it shows errors on words and sentences that makes no sense. bilde

But these errors change if i change the Wordsmith window size. bilde

LadyDefile commented 1 year ago

Thanks for the report!

Thank you so much for reaching out! I always appreciate feedback and help finding bugs like this.

The bug

So, there is a calculation problem in spelling error detection at the moment that causes it to detect weird spelling issues like that (someone brought it up last night in the Dalamud Discord). I did find the solution to the bug almost immediately and I'll have it fixed in v1.8.1 which I hope to push to the testing branch in the next day or two. If you keep an eye out on the testing branch for v1.8.1, the fix should be tested before I release it. Thanks for pointing it out though!

The technical side of things:

ImGui (the GUI library used by Dalamud) does not support word wrapping in text input so I have to manually do it and recalculate the string wrapping points with hidden characters in the string. In version 1.7.7 I did some refactoring to optimize performance and forgot to remove those characters before checking for spelling errors which leads to it reading the text wrong and comparing broken parts of words to the dictionary.

TLDR;

Fix on the way soon. ♥ Closing the report since I've got a fix coming.