-
Notifications
You must be signed in to change notification settings - Fork 0
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
Don't highlight the whole text on every key press #3
Comments
Commit dabac78 somewhat improved the situation. |
Is the commit dabac78 already in the 0.6.0 version which can be downloaded from the Firefox's AddOn site? Because it still hilights the word even I haven't finished to write the word? Could there be some kind of solution that checks (by using regex) that there must be space or some special character after the word (other than A-Ö/a-ö, like . , \n 0-9 and so on) and only then it checks the spelling of the word? And maybe if the cursor is moved to somewhere else within the written text it checks the last word even there isn't any special character found after that? |
Yes, it is. I think you misunderstood what this issue is about. It's not really about whether or not to highlight the current word under cursor but efficiency of the code. I would like to send only the current word to libvoikko and highlight only that word, leaving the rest as is. Now the situation is that all the text is sent to libvoikko and all the text is highlighted again when a key is pressed. Highlighting or not the word you are writing is a different issue and I haven't thought about it. This issue does affect it too though.
You could find an algorithm, but see the answer for the previous question. It's not enough to check the last word because you can change a word anywhere else in the text other than in the end. Maybe the last word under the cursor once it's moved or at onblur event. I guess you haven't experienced slowing down the spellchecking? It probably requires 1000s of words depending on the CPU. |
I think this is the one I was looking for. Once the cursor has "left" a word behind (either by moving the cursor with mouse or by hitting space or . or , and so on.) it triggers the spell checking for that word? And yes, you are correct. This issue is not about that. Should I create a separate issue about this? |
Yes. I think it might be possible to fix your issue without fixing this even. |
Highlighting all the text on every key press is slow if the text is long or you write fast. Only the edited word should be highlighted on every key press and all the other highlighting should stay as they are.
The text was updated successfully, but these errors were encountered: