[1.3.40] String edit insert mode broken
Commit Message
Udo Richter wrote:
> Hi list,
>
> In 1.3.40 and 1.3.41, the arrow key insert mode of edit fields is
> broken. It inserts a new char after each up/down press.
>
> Steps:
> - Go to some edit field (timer name etc) and start editing
> - Press 'green' for insert mode
> - Press 'up' several times
> Result: aaaaa inserted
>
> The attached patch fixes this for now, though its a bit ugly.
> Simply setting newchar = false like in 1.3.39 now activates the
> auto-advance timer without setting it, so it advances soon. (I guess
> this is not expected, though I could get used to it.)
How about the attached patch?
Klaus
Comments
Klaus Schmidinger wrote:
> Udo Richter wrote:
>> In 1.3.40 and 1.3.41, the arrow key insert mode of edit fields is
>> broken. It inserts a new char after each up/down press.
>
> How about the attached patch?
Works fine for me.
Cheers,
Udo
@@ -345,7 +345,7 @@
bool SameKey = Key == lastKey;
if (Key != kNone)
lastKey = Key;
- else if (!newchar && autoAdvanceTimeout.TimedOut()) {
+ else if (!newchar && k0 <= NORMALKEY(lastKey) && NORMALKEY(lastKey) <= k9 && autoAdvanceTimeout.TimedOut()) {
AdvancePos();
newchar = true;
currentChar = NULL;
@@ -427,7 +427,7 @@
value[pos] = toupper(Inc(tolower(value[pos]), NORMALKEY(Key) == kUp));
else
value[pos] = Inc( value[pos], NORMALKEY(Key) == kUp);
- newchar = true;
+ newchar = false;
}
else
return cMenuEditItem::ProcessKey(Key);