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

Implement vim.switchToInsertModeSelection command for switching selected text from visual mode to insert mode #6774

Closed
wants to merge 0 commits into from

Conversation

waynewaynetsai
Copy link
Contributor

@waynewaynetsai waynewaynetsai commented Jun 20, 2021

What this PR does / why we need it:

When we use 3rd party extension such as vscode surround, we can not handle there behavior easily.

But if we use 3rd party extension at insert mode, most of extensions will run correctly.

That's why we need vim.switchToInsertModeSelection command.

We can select words at visual mode, then switch visual mode selection to insert mode first.

After that, we can run 3rd party extension correctly and easily!

With New Command

Side Effects:

  • None

Which issue(s) this PR fixes

  1. Feature Request Implement for [Feature request] Provide vim.switchToInsertModeSelection command for switching selected text from visual mode to insert mode #6773
  2. Bug Solution for Can not edit inserted snippet correctly with vscode surround extension #6772
  3. Workaround Solution for "Wrap with widget..." Quick fix doesn't select generated widget anymore Dart-Code/Dart-Code#3383 (comment)

Copy link

@shadoath shadoath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straight forward to me

@waynewaynetsai
Copy link
Contributor Author

Looks pretty straight forward to me

Thanks for your review @shadoath! Since i'm the first time contributor, this PR still need a maintainer to approve running workflows.

@robersonliou
Copy link

Same issue here, hoping it could be merged as early as possible. :)

@waynewaynetsai
Copy link
Contributor Author

waynewaynetsai commented Jul 9, 2021

I've refactor command handler with vscodevim's modeHandler for having similar coding style and implement test cases for single and multiple selection cases.

All vscodevim test cases have passed at my environment.

@ericlo23
Copy link

This command is quite useful.

@waynewaynetsai
Copy link
Contributor Author

@J-Fields Would you mind giving me some advice?
If you could point me in the right direction, I can try to improve this pr or solving relative issues.

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.

4 participants