Skip to content

[vi-mode] Supports 'diw' text-object command. - #2059

Merged
Dongbo Wang (daxian-dbw) merged 9 commits into
PowerShell:masterfrom
springcomp:#2057
Aug 14, 2023
Merged

[vi-mode] Supports 'diw' text-object command.#2059
Dongbo Wang (daxian-dbw) merged 9 commits into
PowerShell:masterfrom
springcomp:#2057

Conversation

@springcomp

@springcompMaxime Labelle (springcomp) commented Dec 18, 2020

Copy link
Copy Markdown
Contributor

PR Summary

Fixes#2057.

This PR is a first attempt at supporting text-objects in vi-mode. It includes a reasonably complete implementation of the diw command.

Although I have worked hard to make this PR production ready, it must still be considered WIP. I would really appreciate feedback about the implementation.

If this is deemed interesting enough, it could be the first step towards a much complete set of pull requests as alluded to in #584.

PR Checklist

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Make sure you've added one or more new tests
  • Make sure you've tested these changes in terminals that PowerShell is commonly used in (i.e. conhost.exe, Windows Terminal, Visual Studio Code Integrated Terminal, etc.)
  • User-facing changes
Microsoft Reviewers: Open in CodeFlow

@daxian-dbw

Copy link
Copy Markdown
Member

Maxime Labelle (@springcomp) I resolved the conflicts. Will finish the review tonight.

Comment threadPSReadLine/StringBuilderLinewiseExtensions.cs Outdated
Comment threadPSReadLine/StringBuilderTextObjectExtensions.cs Outdated

@daxian-dbwDongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@sharpchen

Copy link
Copy Markdown
Contributor

Can we have it exposed to [Microsoft.PowerShell.PSConsoleReadLine] class? I tried to remap this to another chord but failed to find a work around

@springcomp

Maxime Labelle (springcomp) commented Mar 31, 2025

Copy link
Copy Markdown
ContributorAuthor

Can we have it exposed to [Microsoft.PowerShell.PSConsoleReadLine] class? I tried to remap this to another chord but failed to find a work around

Unfortunately, that PR has been merged a bit too quickly.
The current handler is not a public method that can be remapped, unfortunately.

I addressed feedback from follow up conversations in a future pull request that addresses this shortcomings.

Sign up for freeto 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.

[vi-mode] Support diw command

3 participants

@springcomp@daxian-dbw@sharpchen