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

Add support Y in visual mode #597

Merged
merged 4 commits into from
Aug 13, 2016
Merged

Add support Y in visual mode #597

merged 4 commits into from
Aug 13, 2016

Conversation

shotaAkasaka
Copy link
Contributor

Fixes #573

@jpoon
Copy link
Member

jpoon commented Aug 12, 2016

Noice! 🎉 .

edit: I should use reactions more

@johnfn
Copy link
Member

johnfn commented Aug 12, 2016

If you directly extend the YankOperator, then this will act as an operator as well, meaning it will be able to be combined with motions to do actions (d is an operator because you can do dw, and c is an operator because you can do c$, etc.)

That's not what you want here. You want to create and execute a new YankOperator, running it across the entire current line.

Make sense? :)

@shotaAkasaka
Copy link
Contributor Author

@johnfn Thanks for yout comment.
I have to create anad execute new YankOperator,like that?

@RegisterAction
export class ShiftYankVisualModeOperator extends BaseOperator {
    public keys = ["Y"];
    public modes = [ModeName.Visual];

    public async run(vimState: VimState, start: Position, end: Position): Promise<VimState> {
      // execute 
    }
}

@johnfn
Copy link
Member

johnfn commented Aug 12, 2016

I mean something more along the lines of

new YankOperator().run(vimState, position.getLineStart(), position.getLineEnd())

(That is untested code...)

@johnfn
Copy link
Member

johnfn commented Aug 13, 2016

There we go. :)

Thanks for the PR, @shotaAkasaka!

@johnfn johnfn merged commit 60fb2f5 into VSCodeVim:master Aug 13, 2016
This pull request was closed.
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 this pull request may close these issues.

3 participants