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

#1750 - Using 'd0' to delete to start of the current logical line in a multiline buffer #2002

Merged
merged 14 commits into from
Feb 10, 2021

Conversation

springcomp
Copy link
Contributor

@springcomp springcomp commented Dec 1, 2020

PR Summary

Fixed #1750.

This PR changes the behaviour of the BackwardDeleteLine method to delete characters up to the start of the current logical line, instead of up to the start of the buffer. This makes it more consistent with other changes in Vi mode related to multiline buffers.

I’m concerned this may have an impact on Windows mode but could not see regression test failures. So I’m not sure this scenario is covered. In any case, I have created a new method BackwardDeleteInput for this purpose and would be happy to update documentation accordingly.

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
Member

@springcomp Sorry for being sluggish. The changes make perfect sense, but it raises more inconsistency to the function names that are responsible for deleting texts from the input. For examples, after the change, BackwardDeleteLine deletes a logical line, but

  1. ForwardDeleteLine deletes till the end of input;
  2. BackwardKillLine deletes from the start of the input;

I know there are already inconsistency existing, such as DeleteLine deleting the current logical line while KillLine somehow works like ForwardDeleteLine and deletes till the end of buffer ... Fixing those existing inconsistency is out of scope for this PR.

For this PR, can we maybe bring consistency to ForwardDeleteLine and BackwardKillLine? What I mean is that:

  1. Have ForwardDeleteInput for deleting till the end of input, and make ForwardDeleteLine delete to the end of current logical line.
  2. Have BackwardKillInput for kill texts from the start of input, and make BackwardKillLine kill texts from the start of the current logical line.

What do you think?

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

Mostly look good to me. Some briefDescription are not right in KeyBindings.

@daxian-dbw daxian-dbw merged commit 47fb957 into PowerShell:master Feb 10, 2021
@ghost
Copy link

ghost commented Feb 23, 2021

🎉 v2.2.0-beta2 has been released which incorporates this pull request. 🎉

@springcomp springcomp deleted the #1750 branch February 23, 2021 22:41
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.

[vi-mode]: Using 'd0' should only delete up to the beginning of the current logical line in a multiline buffer
2 participants