max-niederman / ttyper

Terminal-based typing test.
MIT License
1.1k stars 78 forks source link

[Feature Request] Improved UI feedback on mistyped character #75

Open Sntx626 opened 1 year ago

Sntx626 commented 1 year ago

It would be great to have the option to only highlight mistyped characters, instead of whole words with mistyped characters in them. This would mean only coloring the incorrect character, not the word.

Furthermore adding the option to show the mistyped character, instead of the intended-to-be-typed character, in the Prompt-Text-Area would allow the user to recognize what was typed incorrectly, not only where. With this option enabled it could also be argued that the Input-Text-Field could be disabled since all feedback could exist inside the Prompt-Text-Area.

What do you think:

I'm willing to start implementing these features but would like to check with you what you think about it first.

bolphen commented 1 year ago

Here's one version that I've been using https://github.com/bolphen/ttyper/commit/c4a19803690de1a7fb85c6c4387af207e4b90401

A byproduct of marking individual characters is that it also fixes some issues mentioned in https://github.com/max-niederman/ttyper/issues/77 (for example, accented letters like ä or é being counted as two characters).

Sntx626 commented 1 year ago

I wonder if this could be upstreamed, though I don't see a PR for that.

Is there interest for such a feature?

bolphen commented 1 year ago

@Sntx626 Just made a PR. Though there's already another one #90 doing a similar thing.