NIM invalid entry does not prevent functions being run
As reported in the forums if you have NIM open with input such that it can't be closed on an operation, it will still run whatever function is specified.
-
1 ENTER 2 ENTER 3 ENTER
(givingX=3 Y=3 Z=2 T=1
) -
INTS A
(givingX=0 Y=3 Z=2 T=1
as going into NIM seems to clear theX
register) -
+
(givingX=3 Y=2 Z=1 T=1
sinceX=0+3
and the stack is dropped) -
#16
(givingX=A#16 Y=2 Z=1 T=1
)
Note that backspacing will actually restore the stack since it will undo and use the saved registers. But if you complete the NIM input it won't do this.
The reason for this is that if you enter an operation that isn't related to NIM input when you are in NIM mode, addItemToNimBuffer
will try and close NIM and mark the key as not being processed. The closeNim
operation doesn't succeed but it still processes the key press in btnReleased
.
I believe the correct solution here is to mark the key as being processed if closeNim
doesn't succeed.