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

alt+<digit> no longer switches between the currently open editor tabs #1208

Closed
langley opened this issue Jan 31, 2022 · 8 comments · Fixed by #1256
Closed

alt+<digit> no longer switches between the currently open editor tabs #1208

langley opened this issue Jan 31, 2022 · 8 comments · Fixed by #1256

Comments

@langley
Copy link

langley commented Jan 31, 2022

I got an update with this change this morning and now using alt+ doesn't change tabs to the tab anymore. This is a significant issue for me as I always work with multiple tabs open and navigate between them with this functionality constantly.

@whitphx
Copy link
Owner

whitphx commented Jan 31, 2022

As a quick solution, what if you add the keybindings below to your keybindings.json as instructed in https://code.visualstudio.com/docs/getstarted/keybindings#_advanced-customization?
You can also disable the emacs-mcx.digitArgument command assigned to each alt+<number> key on the keybindings settings view.

[
{
  "key": "alt+0",
  "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+1",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+2",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+3",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+4",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+5",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+6",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+7",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+8",
    "command": "-emacs-mcx.digitArgument"
},
{
    "key": "alt+9",
    "command": "-emacs-mcx.digitArgument"
},

Please let me ask some other questions:

  • What OS are you using?
    • On mac OS, which I'm using, alt+<number> does not conflict with any default keybindings. Tab switching commands (workbench.action.openEditorAtIndex1 and so on) are assigned to ctrl+<number>.
  • IMO, alt+<number> (in general, meta+<number>) is used for the digit-argument command in the original Emacs and this extension should emulate it. If the keys conflict with the default keybindings, it should be resolved by assigning the default commands to other keys like https://github.com/whitphx/vscode-emacs-mcx#conflicts-with-default-key-bindings. Do you have any opinion about it?

@jhirn
Copy link

jhirn commented Feb 3, 2022

This is happening for me too. I'm on the latest BigSur 12.2, latest VSCode (updated seconds ago). I only have these customizations to this extension:

  "emacs-mcx.strictEmacsMove": true,
  "emacs-mcx.useMetaPrefixMacCmd": true,

Adding the suggestion does not seem to have any effect. Here's my keybindings for Cmd+1 in VSCode. This was flawless until today.
image

@jhirn
Copy link

jhirn commented Feb 3, 2022

Curiously it does work when foucs was on keyboard shortcuts. I can jump to two or three. Perhaps something with the when clause? I see something has been merged but so I'll sit tight for now.

While I'm here I want to say thank you so much for this amazing extension!

@jhirn
Copy link

jhirn commented Feb 16, 2022

Is this a won't fix issue because of the new support for prefix commands? I had tried the suggested configuration @whitphx, but it didn't seem to work for me. Should these be cmd+ prefixes of alt-?

I will try it again, but would love to have an option in the preferences to just enable cmd+ for window switching as I do not plan to use the prefix commands for anything. If welcome, I could take a stab at a PR for that as an option.

Thank you so much for this plugin. It is by far the best emacs-plugin and has made VSCode my daily driver to the point I feel guilty retaining an emacs stamp on my neckbeard membership card. =)

@jhirn
Copy link

jhirn commented Feb 16, 2022

I had to add the following keybindings for this to work as it did it 0.38.0, basically as above but also disable subsequentArgumentDigit. I used an emacs package (winmove) i believe that made this my habit.

{
    "key": "cmd+0",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+1",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+2",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+3",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+4",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+5",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+6",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+7",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+8",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+9",
    "command": "-emacs-mcx.digitArgument"
  },
  {
    "key": "cmd+0",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+1",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+2",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+3",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+4",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+5",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+6",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+7",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+8",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  },
  {
    "key": "cmd+9",
    "command": "-emacs-mcx.subsequentArgumentDigit"
  }

I'm not sure if why it was working for you by default @whitphx but probably due to the useMetaPrefixMacCmd being set to true which I will investigate if I actually need to be set that way.

Cheers.

@whitphx
Copy link
Owner

whitphx commented Feb 16, 2022

Ah, sorry I didn't care about useMetaPrefixMacCmd option.
Please try the keybindings below as a workaround.

{
  "key": "cmd+1",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+2",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+3",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+4",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+5",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+6",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+7",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+8",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
},
{
  "key": "cmd+9",
  "command": "-emacs-mcx.digitArgument",
  "when": "config.emacs-mcx.useMetaPrefixMacCmd && editorTextFocus && !emacs-mcx.acceptingArgument"
}

So I plan to add an option to disable the digit-argument command assigned to M-<digit> in the future release.

@jhirn
Copy link

jhirn commented Feb 16, 2022

@whitphx, You are the man! Ty!!!

@whitphx
Copy link
Owner

whitphx commented May 11, 2022

You can avoid this problem by setting emacs-mcx.enableDigitArgument as false.
See https://github.com/whitphx/vscode-emacs-mcx#emacs-mcxenabledigitargument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants