When we mistype the very last character, and then retype it for correction application exits with out of index error.
Your environment
Linux
0.2.3
3.9.7
kitty 0.23.1
Steps to reproduce
When near the end of the text sample, if you mistype more characters than the length of the sentence, and then backspace and retype the right thing, it errors out.
Example:
text is something like:
Some text.
What I type:
Some text,,
and then retype the right thing, it errors out.
Note that it is necessary that mistype thing's length should strictly exceed the length of valid text.
Expected behaviour
Should not error out, same as when not doing this.
Actual behaviour
Errors out with out of index error.
Your proposed fix (if any)
I think mitype stores all the mistyped indices, and when we complete the text, it attempts to show red highlighting at mistyped places. But if we mistype beyond the length, there is no valid indices for the last things to be highlighted as they are beyond the text, and we get an out of index error.
One fix can be to not let us type beyond the valid length, or maybe check if index which is being highlighted is valid or not.
Note: I don't know if this is actually the cause. Let me know if I am wrong and I'll fix the report :)
Thank you for opening your first issue in this project!
A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines.
Thanks for the issue! @abhikjain360
And the proposed fix is correct too. :)
This issue has been fixed in #107 but has not been released yet. I'll make a new release soon.
Edit: Released v0.2.4!
Subject of the issue
When we mistype the very last character, and then retype it for correction application exits with out of index error.
Your environment
Steps to reproduce
When near the end of the text sample, if you mistype more characters than the length of the sentence, and then backspace and retype the right thing, it errors out.
Example:
text is something like:
What I type:
and then retype the right thing, it errors out.
Note that it is necessary that mistype thing's length should strictly exceed the length of valid text.
Expected behaviour
Should not error out, same as when not doing this.
Actual behaviour
Errors out with out of index error.
Your proposed fix (if any)
I think mitype stores all the mistyped indices, and when we complete the text, it attempts to show red highlighting at mistyped places. But if we mistype beyond the length, there is no valid indices for the last things to be highlighted as they are beyond the text, and we get an out of index error.
One fix can be to not let us type beyond the valid length, or maybe check if index which is being highlighted is valid or not.
Note: I don't know if this is actually the cause. Let me know if I am wrong and I'll fix the report :)