yzhang-gh / vscode-markdown

Markdown All in One

Home Page:https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keybindings not working

DarkCreekWay opened this issue · comments

What is the problem?

keybindings do not work at all.

How can I reproduce it?

Try Ctrl+B on Windows with

VSCode V1.32.1
Extension 2.2.1

I suspected an issue with the When Clause for the KeyBinding of

markdown.editing.toggleBold

changed the when clause

Before:
editorTextFocus && !editorReadonly && editorLangId == 'markdown'

After:
editorTextFocus && !editorReadOnly && editorLangId == 'markdown'

notice Casing change of parameter editorReadonly vs. editorReadOnly

After editing the clause, the key binding worked as expected.

Seems, package.json needs to be fixed.

Thanks for the report. It is a good catch, although editorReadonly should also work. The default key bindings also use it pretty often.

vscode keybindings

Maybe there is another reason causing this problem?

I tested further and found the root cause. The Visual Studio Keymap Extension interfers with the keybindings of this extension. As soon, as the other extension is deactivated, keybindings work as expected.

Editing the when clause changes the key binding from "Standard" to "User". Seems, VS Code evaluates the user defined binding first. This led me on the wrong track.

Having both extensions side by side would be great, but I am not sure, if this is feasible.

That makes sense then.

I am wondering what is the functionality of ctrl+b in that extension. If it is not applicable for Markdown, we can open an issue there to exclude Markdown documents.
Besides that, overriding it with a user-level key binding is always a simple solution.

Is there a way to control priorities of key bindings ?

I think about a prioritized approach like

Prio - Area
0 - VS Code
1 - Keymap Extension
2 - Filetype Extension
3 - User Defined

Even if this is possible, it would be cumbersome to sync with other extension author's in order to avoid conflicts.

As far as I know, we can't. Maybe we should open an issue in the vscode repository. But I don't think there is a good solution...

I browsed the vscode issues. There are a lot of issues regarding keybindings.
This issue Feature Request: Keybinding Overloading made it to the Backlog and looks promising.

So, as we can't do much here, I close the issue.

Keep up the good work!