Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compatibility] doesn't work well with "Markdown All in One" extension #18

Closed
AleksueiR opened this issue Feb 16, 2021 · 18 comments
Closed
Labels
invalid This doesn't seem right question Further information is requested

Comments

@AleksueiR
Copy link

Tabbing between cells doesn't work when the Markdown All in One extension is installed alongside. Turning its table auto-format option off doesn't seem to help.

VSCode Insiders: v1.54.0
Markdown All in One: v3.4.0
Markdown Table: v0.4.2

@GavinRay97
Copy link

Same issue here 😢

@takumisoft68
Copy link
Owner

@AleksueiR @GavinRay97
It is conflicting of keybindings.
Remove or Change the "Markdown All in One" keybindings.

  • conflicting commands
    • markdown.extension.onTabKey
    • markdown.extension.onShiftTabKey
  1. Open "File -> Preference -> Keyboard Shortcuts".
  2. Search as "markdown.extension tab".
  3. Right click and "Remove Keybinding".

image

@rongcuid
Copy link

Would it not be much better if something can be added in the 'when' expression? This workaround would break other features like list indentation.

@takumisoft68
Copy link
Owner

takumisoft68 commented Jun 15, 2021

@rongcuid
That's a good idea.
But, I could not find any 'when' expression to prioritize this over "Markdown All in One".
Please tell me which expression is effective.

@rongcuid
Copy link

@takumisoft68

I haven't worked with the extension, but what I meant is to enable this shortcut when the cursor is actually inside a table cell.

@takumisoft68
Copy link
Owner

takumisoft68 commented Jun 15, 2021

@rongcuid
Thanks for reply.

when the cursor is actually inside a table cell.

Unfortunately, I can't find such an expression in vscode...

By the way, 'Ctrl + ]' and 'Ctrl + [' can be used for list indentation. FYI.

@GavinRay97
Copy link

Thank you for the reply, I must have missed it in my email earlier!

@mathesonphillip
Copy link

Thanks for the logging issue. I was able to work around using suggestions above.
Cheers

@OldStarchy
Copy link

I have bound ctrl+[ and ctrl+] to other commands since I prefer to use tab for indentation.

I agree with @rongcuid. Although there is no existing when clause for this, it is possible to create one with the setContext api. It should be possible to detect if the cursor is in a table whenever the cursor moves and update the context value.

I'll also raise this on the yzhang.markdown-all-in-one extension in case they have some ideas too.

@OldStarchy
Copy link

Looks like there's not much yzhang.markdown-all-in-one can do, the only way to do this might be creating a custom when clause.

@StephaneG31
Copy link

StephaneG31 commented Jan 18, 2022

There's here : microsoft/vscode#134544 (comment) and explanation of what this extension can change to improve that point.

The solution here is for the yzhang.markdown-all-in-one extension to create a new context key e.g. named selectionInMarkdownList and for the takumii.markdowntable extension to create a new context key e.g. named selectionInMarkdownTableCell. These keys need to be proactively maintained (set to true or false) based on the current active text editor and the current cursor position (things which are available via API). Once custom context keys are maintained, the when conditions for the keybindings need to be updated to make use of them.

@takumisoft68
Copy link
Owner

I resolved this confliction.

v0.8.0 had been released.
And I send a pull request to yzhang-gh/vscode-markdown at 1075.

@takumisoft68
Copy link
Owner

Keep open until pull request yzhang-gh/vscode-markdown 1075 will be closed.

@takumisoft68 takumisoft68 added invalid This doesn't seem right question Further information is requested labels Mar 14, 2022
@chraxo
Copy link

chraxo commented Jun 6, 2022

Thanks for you efforts to find a proper solution. For now I found the following workaround. It's not a super-nice solution, but at least it works. Maybe the solution is obvious to some of you, but for me this was new, so this information might help also other people:

It seems that the context keys of markdowntable are usable within the when condition for other extensions as well. So the desired behavior can be achieved by extending the when conditions of the following commands with && !markdowntable.contextkey.selection.InMarkdownTable:

  • markdown.extension.onTabKey
  • markdown.extension.onShiftTabKey

The full settings then look like this:

{
  "key": "tab",
  "command": "markdown.extension.onTabKey",
  "when": "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !inlineSuggestionVisible && !markdowntable.contextkey.selection.InMarkdownTable && !suggestWidgetVisible && editorLangId == 'markdown'"
}
{
  "key": "shift+tab",
  "command": "markdown.extension.onShiftTabKey",
  "when": "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !markdowntable.contextkey.selection.InMarkdownTable && !suggestWidgetVisible && editorLangId == 'markdown'"
}

@yiufung
Copy link

yiufung commented Jul 7, 2022

@chraxo This is a very good workaround. Thanks.

@hpigot
Copy link

hpigot commented Jul 26, 2022

@chraxo worked for me as well. Thanks. Perhaps this can be added to the extension as a fix for this issue.

@takumisoft68
Copy link
Owner

takumisoft68 commented Sep 5, 2022

@AleksueiR @GavinRay97 @rongcuid @mathesonphillip @OldStarchy @StephaneG31 @chraxo @yiufung @hpigot
I’m glad to say that we got compatibility between "Markdown All in One".
My pull request has been merged. And v3.4.4 is released.

Update your "Markdown All in One" to v3.4.4.
No workaround is needed.
It is important to note, however, that v3.4.4 is still pre-release version.

@oakla
Copy link

oakla commented Oct 7, 2022

[...] extending the when conditions of the following commands with && !markdowntable.contextkey.selection.InMarkdownTable:

  • markdown.extension.onTabKey
  • markdown.extension.onShiftTabKey

The full settings then look like this:

{
  "key": "tab",
  "command": "markdown.extension.onTabKey",
  "when": "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !inlineSuggestionVisible && !markdowntable.contextkey.selection.InMarkdownTable && !suggestWidgetVisible && editorLangId == 'markdown'"
}
{
  "key": "shift+tab",
  "command": "markdown.extension.onShiftTabKey",
  "when": "editorTextFocus && !editorHasMultipleSelections && !editorReadonly && !editorTabMovesFocus && !hasOtherSuggestions && !hasSnippetCompletions && !inSnippetMode && !markdowntable.contextkey.selection.InMarkdownTable && !suggestWidgetVisible && editorLangId == 'markdown'"
}

How does one get to the JSON version of the 'Keyboard Shortcut' settings? When I try from the command palette, I always end up in a file that looks like this:

// Place your key bindings in this file to override the defaults
[
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right question Further information is requested
Projects
None yet
Development

No branches or pull requests