bug-gtypist
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gtypist] Request: backspace improvement


From: Yves Martin
Subject: [bug-gtypist] Request: backspace improvement
Date: Sun, 14 Aug 2016 11:30:47 +0200

 Hello,

When practicing "speed test", I face troubles with backspace handling
and ahead typing behavior.

For insance when typing "quick", suppose "i" is missed and "c" is
already typed and detected as ahead typing, position is on "c", "i" is
marked as error.

It is expected a single "backspace" stroke is enough to get back to "i"
position, to undo only "c" type.

Current gtypist behavior requires two backspace strokes to be allowed
to type "i" as correction and go on with "ck" without increasing error
count.


I have tried to improve backspace behavior with the follow first/draft
patch:

diff --git a/src/gtypist.c b/src/gtypist.c
index 78a1146..c481799 100644
--- a/src/gtypist.c
+++ b/src/gtypist.c
@@ -887,6 +887,13 @@ do_speedtest( FILE *script, char *line ) {
               if ( widep > wideData && *(widep-1) != ASCII_NL &&
*(widep-1) != ASCII_TAB ) {
                 /* back up one character */
                 ADDCH( ASCII_BS ); widep--;
+                if ( error_sync >= 0 )
+                  {
+                    /* one more if (potential multiple) ahead typists
*/
+                    ADDCH( ASCII_BS ); widep--;
+                    chars_typed--;
+                    error_sync++;
+                  }
                 /* Clear the error associated with the faulty
character */
                 errors_buf[--errors_pos] = 0;
               }

BUT it works only for a single typed ahead character.
Still with my example, if "quck" has been typed, it still requires
three backspaces before "i" can be typed, whereas 2 strokes are
expected.

I have no idea if it makes sens to support more than two typed ahead
corrections with backspace but I am convinced handling a single char is
not enough, so probably a dedicated counter should be used instead of
reusing error_sync for that.

Thank you in advance.

Kind regards
Yves Martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]