Moves the responsibility for deletion of markers when the users presses
the backspace key, from `kmx_processor::process_event` to
`KMX_ProcessEvent::ProcessGroup`. This has no effect on usage of Keyman
Core, but:
1. Simplifies the association between context and action further
2. Ensures that `m_actions` and `state->actions` will always be the
same length, making future refactoring of these simpler
3. Allows us to use the index into the m_actions array for Debug events,
which simplifies the interleaving of these for the upcoming Debugger.
When the user presses backspace at start of context (where there may be
markers in the cached context, but no characters), the kmx processor
will delete any markers prior to insertion point before requesting that
the consumer emit the backspace virtual key back to the application, to
allow the application to handle backspace at start of text.
Fixes#5488.
This updates Keyman Core, corresponding tests, and Keyman Engine for
Linux to support deletion of markers through an action, ensuring that
the action queue does not desynchronize with the context.
Adds some tests for Keyman Core for debugging, verifying contents of
the action list after every keystroke in the test.
Also refactors some of the test helper files to make it easier to
diagnose failing tests and share helper functions.
Adds an action_index to each debug event (not all debug events
need it). This allows the debugger to partially execute a rule
including the possibility of multiple updates to context.
Adds debug events to the kmx processor and corresponding unit tests.
This corresponds largely to the way that keyman32 emits debug events,
but with one key change: debug events in keyman32 are processed
synchronously, whereas in Keyman Core, the full set of debug events will
be returned alongside the final action list for the key event.
Given this difference, there will likely need to be some more data
returned in individual debug events, specifically around intermediate
context manipulation, as required for step-by-step debugging. However,
that will come in a subsequent PR.
Part of #5013.
Adds all the debug infrastructure:
* public API headers
* public API implementation classes and functions
* basic unit tests
* helper classes for recording debug events
* minimal implementation of kmx-specific debug event signalling --
just BEGIN and END events.
* tangential: unit test assertion macros and coloured output