diff --git a/Makefile b/Makefile index a602a6e..0928b68 100644 --- a/Makefile +++ b/Makefile @@ -3,3 +3,6 @@ build: fasttyper push: twine upload dist/* + +clean: + rm dist/* diff --git a/fasttyper/buffer.py b/fasttyper/buffer.py index 73d3e98..2896572 100644 --- a/fasttyper/buffer.py +++ b/fasttyper/buffer.py @@ -75,10 +75,18 @@ class Buffer: def _del_word(self): try: + if self.user_words[self.current_word] == "": + self.current_word = max(0, self.current_word - 1) + self.user_words[self.current_word] = "" self.current_char = 0 except IndexError: self.current_word = max(0, self.current_word - 1) + try: + self.user_words[self.current_word] = "" + except IndexError: + pass + self.current_char = 0 def handle_action(self, action, char): if action == Action.add_char: diff --git a/fasttyper/components.py b/fasttyper/components.py index 3142d2d..44daebf 100644 --- a/fasttyper/components.py +++ b/fasttyper/components.py @@ -247,6 +247,10 @@ class BufferDependentComponent(BorderedBox): self.current_word_idx += 1 + self.lines[self.current_line][self.word_index] = self.buffer.get_word( + self.current_word_idx + ) + while word_index < self.current_word_idx: self.word_index -= 1 @@ -256,6 +260,10 @@ class BufferDependentComponent(BorderedBox): self.current_word_idx -= 1 + self.lines[self.current_line][self.word_index] = self.buffer.get_word( + self.current_word_idx + ) + while ( self.current_line > self.prefered_line or self.current_line == self.height ): diff --git a/setup.cfg b/setup.cfg index ca4d2cf..2269264 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.0.0 +current_version = 2.0.1 [wheel] universal = 1 diff --git a/setup.py b/setup.py index 12eb6c2..af3c845 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ with open("requirements.txt", "r", encoding="utf-8") as fh: setup( name="fasttyper", - version="2.0.0", + version="2.0.1", author="Piotr Domanski", author_email="pi.domanski@gmail.com", description="Minimalistic typing exercise",