From 8c9d01c9ba5454146179a974c47831c3d6ba2e55 Mon Sep 17 00:00:00 2001 From: AlxV07 Date: Fri, 22 May 2026 11:48:16 -0500 Subject: [PATCH 1/3] feat(C,D): add C (i.e. c$), D (d$) --- content.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/content.js b/content.js index 931636b..ebe7792 100644 --- a/content.js +++ b/content.js @@ -476,6 +476,14 @@ function handleKeyEventNormal(key) { goToEndOfLine() switchModeToInsert() break + case "C": + selectToEndOfLine() + runLongStringOp("c") + break + case "D": + selectToEndOfLine() + runLongStringOp("d") + break case "v": switchModeToVisual() break @@ -575,9 +583,11 @@ function handleKeyEventVisualLine(key) { goToDocStart(true) break case "c": + case "C": case "d": + case "D": case "y": - runLongStringOp(key) + runLongStringOp(key.toLowerCase()) break case "i": case "a": From 2011c2869785c44fd376e49624790fbbd7e7b318 Mon Sep 17 00:00:00 2001 From: Alexander Chen Date: Thu, 4 Jun 2026 21:32:26 -0500 Subject: [PATCH 2/3] fix(offline): timeout iframe set for offline loading; upd(linedit): set personal preference non-shift enter --- content.js | 17 ++++++++++------- page_script.js | 15 ++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/content.js b/content.js index ebe7792..af7eda1 100644 --- a/content.js +++ b/content.js @@ -9,10 +9,7 @@ // before sending to layout engine and interpret them into respective vim motion/command. // Then implement those motions by sending relevant keystrokes. Essentially doing a keystroke to keystroke remapping. -const iframe = document.getElementsByTagName('iframe')[0] // https://stackoverflow.com/a/4388829 -iframe.contentDocument.addEventListener('keydown', eventHandler, true) -const cursorTop = document.getElementsByClassName("kix-cursor-top")[0] // element to edit to show normal vs insert mode let mode = 'normal' let tempnormal = false // State variable for indicating temperory normal mode let multipleMotion = { @@ -218,13 +215,13 @@ function goToStartOfPara(shift = false) { function addLineTop() { goToStartOfLine() - sendKeyEvent("enter", { shift: true }) + sendKeyEvent("enter", { shift: false }) sendKeyEvent("up") switchModeToInsert() } function addLineBottom() { goToEndOfLine() - sendKeyEvent("enter", { shift: true }) + sendKeyEvent("enter", { shift: false }) switchModeToInsert() } @@ -709,5 +706,11 @@ function activateTopLevelMenu(menuCaption) { simulateClick(button); } -// Initiate to Normal Mode -switchModeToNormal() +let cursorTop; +setTimeout(() => { + const iframe = document.getElementsByTagName('iframe')[0] // https://stackoverflow.com/a/4388829 + iframe.contentDocument.addEventListener('keydown', eventHandler, true) + cursorTop = document.getElementsByClassName("kix-cursor-top")[0] // element to edit to show normal vs insert mode + // Initiate to Normal Mode + switchModeToNormal() +}, 500) diff --git a/page_script.js b/page_script.js index 00d3c8b..babbfcf 100644 --- a/page_script.js +++ b/page_script.js @@ -51,11 +51,12 @@ const simulateKeyEvent = function(eventType, el, args) { el.dispatchEvent(event); }; -const editorEl = document.querySelector(".docs-texteventtarget-iframe").contentDocument.activeElement; - -window.addEventListener("doc-keys-simulate-keypress", function(event) { - const args = event.detail - simulateKeyEvent("keydown", editorEl, args); - simulateKeyEvent("keyup", editorEl, args); -}); +setTimeout( () => { + const editorEl = document.querySelector(".docs-texteventtarget-iframe").contentDocument.activeElement; + window.addEventListener("doc-keys-simulate-keypress", function(event) { + const args = event.detail + simulateKeyEvent("keydown", editorEl, args); + simulateKeyEvent("keyup", editorEl, args); + }); +}, 500) From e92222a7f22e8d0f90cf243a84ba1c33cd19ff26 Mon Sep 17 00:00:00 2001 From: AlxV07 Date: Thu, 4 Jun 2026 23:33:08 -0500 Subject: [PATCH 3/3] fix(iframe-select): target iframe by class --- content.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content.js b/content.js index af7eda1..1255273 100644 --- a/content.js +++ b/content.js @@ -708,7 +708,7 @@ function activateTopLevelMenu(menuCaption) { let cursorTop; setTimeout(() => { - const iframe = document.getElementsByTagName('iframe')[0] // https://stackoverflow.com/a/4388829 + const iframe = document.querySelector('.docs-texteventtarget-iframe') iframe.contentDocument.addEventListener('keydown', eventHandler, true) cursorTop = document.getElementsByClassName("kix-cursor-top")[0] // element to edit to show normal vs insert mode // Initiate to Normal Mode