Skip to content
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

Error when re-typing the wrong last character #123

Closed
abhikjain360 opened this issue Oct 26, 2021 · 2 comments
Closed

Error when re-typing the wrong last character #123

abhikjain360 opened this issue Oct 26, 2021 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@abhikjain360
Copy link

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

  • 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 :)

@abhikjain360 abhikjain360 added the bug Something isn't working label Oct 26, 2021
@welcome
Copy link

welcome bot commented Oct 26, 2021

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.

@Mithil467
Copy link
Owner

Mithil467 commented Oct 26, 2021

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!

@Mithil467 Mithil467 added the duplicate This issue or pull request already exists label Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants