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

Fix a few VI key handlers to close edit group properly #3845

Merged
merged 2 commits into from
Oct 24, 2023

Conversation

daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Oct 23, 2023

PR Summary

Fix #1281

I copied the code in Repalce.vi.cs from #2012 (thanks @springcomp!) to fix the instances where edit group was not correctly ended when searching fails. I also copied a test from #2012 and added 2 more tests.

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
    • Not Applicable
    • OR
    • Documentation needed at PowerShell-Docs
      • Doc Issue filed:

@daxian-dbw
Copy link
Member Author

@springcomp Can you please take a look at this PR? As called out in #2012 (review), I'd like to see if we can make the VI mode works as expected while requiring balanced edit groups. Thanks!

@springcomp
Copy link
Contributor

springcomp commented Oct 24, 2023

@daxian-dbw Sure please let me a bit of time for feedback and to rework the other PRs more thoroughly.

Copy link
Contributor

@springcomp springcomp left a comment

Choose a reason for hiding this comment

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

This captures the spirit of my initial PR to the perfection.
Looks great to me.

test/BasicEditingTest.VI.cs Show resolved Hide resolved
test/BasicEditingTest.VI.cs Show resolved Hide resolved
@daxian-dbw
Copy link
Member Author

@springcomp Thanks for the feedback! I have updated the comments as you suggested.

@daxian-dbw daxian-dbw merged commit fbdf7fa into PowerShell:master Oct 24, 2023
2 checks passed
@daxian-dbw daxian-dbw deleted the edit-group branch October 24, 2023 16:46
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.

InvalidOperationException thrown when typing cffcc in command mode
2 participants