sgryjp / japanese-word-handler

Better Japanese word handling on Visual Studio Code.
zlib License
46 stars 7 forks source link

`Ctrl + Backspace or Delete` fails in preference settings input box #5

Closed lingsamuel closed 4 years ago

lingsamuel commented 4 years ago

Ctrl + Backspace and Ctrl + Delete produce similar error: japaneseWordHandler.deleteWordStartLeft and japaneseWordHandler.deleteWordEndRight.

In File/Preferences/Settings input box: image

lingsamuel commented 4 years ago

Ext host log:

[2020-04-24 17:59:39.735] [exthost] [error] TypeError: Cannot read property 'document' of undefined
    at /home/lingsamuel/.vscode/extensions/sgryjp.japanese-word-handler-1.2.0/out/extension.js:11:52
...

The code:

let editor = vscode.window.activeTextEditor;
// ...
.getConfiguration("editor", editor.document.uri)
// ...

Seems that this GUI (or a rendered page?) doesn't have variable vscode.window.activeTextEditor.

lingsamuel commented 4 years ago

Found solution in fork CJK-word-handler, commit here

"when": "textInputFocus && !editorReadonly"

To:

"when": "editorTextFocus && !editorReadonly"
sgryjp commented 4 years ago

Thank you for reporting! I reproduced the issue, and also confirmed the solution you mentioned. I'll make some time to fix this so please wait some days.