mirror of
https://github.com/PowerShell/PSReadLine
synced 2026-06-08 12:12:13 +00:00
Fix BackwardKillLine length calculation for multiline input (#5102)
This commit is contained in:
@@ -135,7 +135,7 @@ namespace Microsoft.PowerShell
|
||||
public static void BackwardKillLine(ConsoleKeyInfo? key = null, object arg = null)
|
||||
{
|
||||
var start = GetBeginningOfLinePos(_singleton._current);
|
||||
_singleton.Kill(start, _singleton._current, true);
|
||||
_singleton.Kill(start, _singleton._current - start, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -119,6 +119,8 @@ namespace Test
|
||||
PSConsoleReadLine.SetKeyHandler(new[] { "Shift+Tab" }, PSConsoleReadLine.BackwardKillLine, "", "");
|
||||
|
||||
Test("", Keys("dir", _.Shift_Tab));
|
||||
|
||||
Test("abc\n123", Keys("abc", _.Shift_Enter, "123", _.Shift_Tab, _.Ctrl_y));
|
||||
}
|
||||
|
||||
[SkippableFact]
|
||||
|
||||
Reference in New Issue
Block a user