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

support fish-shell-style C-e for accepting history suggestion #3708

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions PSReadLine/Movement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,19 @@ public partial class PSConsoleReadLine
/// If the input has multiple lines, move to the end of the current line,
/// or if already at the end of the line, move to the end of the input.
/// If the input has a single line, move to the end of the input.
/// If already at the end of input, accept edit suggestion.
/// </summary>
public static void EndOfLine(ConsoleKeyInfo? key = null, object arg = null)
{
if (TryGetArgAsInt(arg, out var numericArg, 1))
{
if (_singleton._current == _singleton._buffer.Length && numericArg > 0)
{
AcceptSuggestion(key, arg);
return;
}
}

int i = _singleton._current;
for (; i < _singleton._buffer.Length; i++)
{
Expand Down