Update web/src/engine/src/core-processor/coreKeyboardProcessor.ts

Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
Eberhard Beilharz 2025-11-17 19:28:06 +01:00 committed by GitHub
parent 51b05c9661
commit b0ea7e58c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,12 +114,11 @@ export class CoreKeyboardProcessor extends EventEmitter<EventMap> implements Key
const contextItems = new KM_Core.instance.km_core_context_items();
const caretPosition = textStore.getCaret();
let textIndex = 0
for (let deadkeyIndex = 0; deadkeyIndex < deadKeys.length; deadkeyIndex++) {
const deadKey = deadKeys[deadkeyIndex];
for (const deadkey of deadkeys) {
for (; textIndex < text.length && textIndex <= caretPosition; textIndex++) {
const contextItem = new KM_Core.instance.km_core_context_item();
if (deadKey.p == textIndex) {
contextItem.marker = deadKey.d;
if (deadkey.p == textIndex) {
contextItem.marker = deadkey.d;
contextItems.push_back(contextItem);
break;
}