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

TextEditor.Insert cannot make several insertions in one go #48

Closed
guillermooo opened this issue Nov 29, 2015 · 2 comments
Closed

TextEditor.Insert cannot make several insertions in one go #48

guillermooo opened this issue Nov 29, 2015 · 2 comments

Comments

@guillermooo
Copy link
Member

Add this to extension.ts:

    vscode.commands.registerCommand('extension.vim_Insert', () => {
        TextEditor.Insert("a");
        TextEditor.Insert("b");
        TextEditor.Insert("c");  
    });    

Add this to packages.json:

...
  "contributes": {
    "commands": [
        {
          "title": "Vim Insert",
          "command": "extension.vim_Insert"
        }
    ],
...

If I try to use this command in an empty buffer, only a gets inserted.

This is an issue for mappings, where iabc should insert abc into the buffer, but currently VSCodeVim will only insert a. (Unmerged branch.)

@jpoon
Copy link
Member

jpoon commented Nov 29, 2015

Good catch. I'll return the promise.

@jpoon jpoon closed this as completed in 263a5ef Nov 29, 2015
@jpoon
Copy link
Member

jpoon commented Nov 29, 2015

It's a little bit more verbose but you'll now need to:

    vscode.commands.registerCommand('extension.vim_Insert', () => {
        TextEditor.Insert("a").then(TextEditor.Insert("b")).then(TextEditor.Insert("c"));
    });

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

No branches or pull requests

2 participants