From a39b542b44af5157e973b73e6a563707f4da37d2 Mon Sep 17 00:00:00 2001 From: Doman Date: Fri, 11 Feb 2022 17:47:59 +0100 Subject: [PATCH] better handling of input white characters --- fasttyper/components.py | 2 ++ setup.cfg | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fasttyper/components.py b/fasttyper/components.py index d608d5e..6eb3f12 100644 --- a/fasttyper/components.py +++ b/fasttyper/components.py @@ -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) diff --git a/setup.cfg b/setup.cfg index 055fca7..a2a147d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.5.0 +current_version = 1.5.1 [wheel] universal = 1 diff --git a/setup.py b/setup.py index f48351f..f9ec6f6 100644 --- a/setup.py +++ b/setup.py @@ -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",