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

"," cannot be remapped when {"vim.leader": ","} #2932

Closed
haberdashPI opened this issue Aug 3, 2018 · 4 comments
Closed

"," cannot be remapped when {"vim.leader": ","} #2932

haberdashPI opened this issue Aug 3, 2018 · 4 comments
Labels

Comments

@haberdashPI
Copy link

Describe the bug
If you remap the leader to "," there's no way to reference the old functionality of ",".

To Reproduce
Replace settings.json with the following text:

{
  "vim.leader": ",",
  "vim.normalModeKeyBindingsNonRecursive": [
        {
            "before": ["^"],
            "after": [","]
        }
    ],
}

Place the following text in a new file

testing testing testing

Place the cursor on the start of the line. In insert mode, "fe;" will jump to the first "e" and then the second "e". Now press "^". Nothing will happen.

(Note: "^" also does not act as a leader. Commands I've mapped to leader do not work when using "^" in the above scenario).

Expected behavior

I would expect that pressing "^" would move the cursor back to the first "e" in the above example.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 0.15.7
  • VSCode version: 1.25.1
  • OS: Mac OS X 10.11.6
@jpoon
Copy link
Member

jpoon commented Aug 14, 2018

Related: #2735

@jpoon
Copy link
Member

jpoon commented Aug 14, 2018

I think you meant to swap the before and after in your configuration.

The PR fixes the above issue but exposes a larger issue. As we don't do any look-ahead, if there is an immediate matching action for the key, the extension will immediately execute it. For instance, if you bind your leader key to an existing VIM key (e.g. ,), when you have remappings such as:

before: , f, e, s
after: v

When you press , (which is the leader key), we will immediately execute:

class MoveRepeatReversed extends BaseMovement {
and not wait for further keys.

@haberdashPI
Copy link
Author

Interesting, I misunderstood the meaning of "before" and "after" here.

Thanks for your work and energy looking into this. I'm eagerly awaiting a fix of the larger issue.

@jpoon
Copy link
Member

jpoon commented Jan 29, 2019

I'm going to close this as a dupe of #1821 as it's the same root cause.

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

No branches or pull requests

2 participants