better handling of input white characters

This commit is contained in:
Doman 2022-02-11 17:47:59 +01:00
parent 50a824f8ad
commit a39b542b44
3 changed files with 4 additions and 2 deletions

View file

@ -109,6 +109,7 @@ class TextBox(TextComponent):
line = ""
if not c.isalnum():
word = str(word)[:-1] + " "
line += word
word = ""
@ -153,6 +154,7 @@ class TextBox(TextComponent):
invalid_text = line[invalid_start : user_pointer[1]]
reference_text = line[len(invalid_text) + len(valid_text) :]
invalid_text = invalid_text.replace(" ", "_")
self.paint_text(screen, valid_text, self.valid_color)
self.paint_text(screen, invalid_text, self.invalid_color)

View file

@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.5.0
current_version = 1.5.1
[wheel]
universal = 1

View file

@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setup(
name="fasttyper",
version="1.5.0",
version="1.5.1",
author="Piotr Domanski",
author_email="pi.domanski@gmail.com",
description="Minimalistic typing exercise",