fix on counting incorrect words and white chars
This commit is contained in:
parent
4d0c4129d8
commit
772c66e132
3 changed files with 9 additions and 4 deletions
|
@ -53,8 +53,13 @@ class Buffer:
|
|||
|
||||
def _next_word(self):
|
||||
self.current_word += 1
|
||||
|
||||
if self.current_char > 0:
|
||||
self.stats.signal_valid() # space is a char after all
|
||||
else:
|
||||
self.stats.signal_invalid() # space after empty word
|
||||
|
||||
self.current_char = 0
|
||||
self.stats.signal_valid() # space is a char after all
|
||||
|
||||
if self.current_word >= self.total_words:
|
||||
self.stats.signal_stop(True)
|
||||
|
@ -143,4 +148,4 @@ class Buffer:
|
|||
if w != self.reference_words[i]:
|
||||
count += 1
|
||||
|
||||
return count
|
||||
return count + len(self.reference_words) - len(self.user_words)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[bumpversion]
|
||||
current_version = 2.3.1
|
||||
current_version = 2.3.2
|
||||
|
||||
[wheel]
|
||||
universal = 1
|
||||
|
|
2
setup.py
2
setup.py
|
@ -9,7 +9,7 @@ with open("requirements.txt", "r", encoding="utf-8") as fh:
|
|||
|
||||
setup(
|
||||
name="fasttyper",
|
||||
version="2.3.1",
|
||||
version="2.3.2",
|
||||
author="Piotr Domanski",
|
||||
author_email="pi.domanski@gmail.com",
|
||||
description="Minimalistic typing exercise",
|
||||
|
|
Loading…
Reference in a new issue