Skip to content

Commit debc220

Browse files
committed
Fix Undo after Paste
1 parent 7732e36 commit debc220

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

PSReadLine/ReadLine.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,9 +756,7 @@ public static void Paste(ConsoleKeyInfo? key = null, object arg = null)
756756
{
757757
string textToPaste = System.Windows.Clipboard.GetText();
758758
textToPaste = textToPaste.Replace("\r", "");
759-
_singleton._buffer.Insert(_singleton._current, textToPaste);
760-
_singleton._current += textToPaste.Length;
761-
_singleton.Render();
759+
Insert(textToPaste);
762760
}
763761
}
764762

TestPSReadLine/Program.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ static void Box(List<string> list)
8888
Console.ReadKey();
8989
}
9090

91+
[STAThread]
9192
static void Main()
9293
{
9394
//Box(new List<string> {"abc", " def", "this is something coo"});

0 commit comments

Comments
 (0)