Commit graph

10 commits

Author SHA1 Message Date
Eberhard Beilharz
044e53198a
fix(linux): Fix switching to keyboard in middle of line (#4678)
Don't re-set context if it changed because the cursor location was
wrong. When the user switches to the EuroLatin keyboard in the
middle of the line, we're getting a wrong cursor location. This will
be fixed with the next keypress, but it leads to the context string
suddenly having more characters added to the front. If we re-set the
context because it's different now we will loose the information we
previously added to the context.

We now compare the end of the string. If the new context string ends
with the old context string we assume that the cursor position got
updated and don't re-set the context.

This fixes #4678.
2021-03-18 17:29:21 +01:00
Eberhard Beilharz
2421af506e
chore(common): write debug output to console
We have a `g_debug_ToConsole` variable. However, so far this was
always set to true and output to `syslog`. This change modifies
the default to `false`, and in that case logs to `syslog`. If
`g_debug_ToConsole` is true we no output to the console.

When running the KMX unit tests we set `g_debug_ToConsole` to true.
2021-03-02 16:55:22 +01:00
Eberhard Beilharz
2593c7873f
docs(common): Add readme for unit tests 2021-03-02 16:55:22 +01:00
Marc Durdin
1ec9577613 chore(windows): fix typo 2021-01-29 16:14:24 +11:00
Marc Durdin
081471218e fix(common): add test case and fix smp bugs
Turns out that @darcywong00's suggestion for a test case was a Very Good
Idea. The SMP handling in Keyman Core had an egregious bug where only
half of a surrogate pair was being deleted in the UTF-16 context; see
kmx_processor.cpp 425-428. This was then masked by the test runner
masking the damage in the original test case; see kmx.cpp 193-203.

The new test case exercises a number of additional ways of manipulating
the context where surrogate pairs exist, to show we handle the deletion
properly within Keyman Core and in the test runner.
2021-01-29 16:05:07 +11:00
Marc Durdin
367fe409a9 fix(common/core): context mismatch with if and deadkey automatic test 2021-01-18 10:22:59 +11:00
Marc Durdin
080f03860e
Merge pull request #3083 from keymanapp/fix/windows/2759-force-output-keystroke-fails
fix(windows): force output keystroke failure
2020-05-11 06:09:09 +10:00
Marc Durdin
5956674a43 chore(common): add tests for Keyman Core 2020-05-08 16:53:53 +10:00
Marc Durdin
3f98c6027b fix(windows): decxstr was not checking start of string properly 2020-05-04 16:18:31 +10:00
Darcy
660a1459ff refactor(common): Rename keyboardprocessor to desktop 2020-02-26 16:34:29 +07:00