diff --git a/PSReadLine/BasicEditing.cs b/PSReadLine/BasicEditing.cs index bbfbd39ec..6bd212e68 100644 --- a/PSReadLine/BasicEditing.cs +++ b/PSReadLine/BasicEditing.cs @@ -31,26 +31,20 @@ public static void SelfInsert(ConsoleKeyInfo? key = null, object arg = null) { if (count <= 0) return; - if (count > 1) - { - var toInsert = new string(keyChar, count); - if (_singleton._visualSelectionCommandCount > 0) - { - _singleton.GetRegion(out var start, out var length); - Replace(start, length, toInsert); - } - else - { - Insert(toInsert); - } - return; - } + } + else + { + count = 1; } if (_singleton._visualSelectionCommandCount > 0) { _singleton.GetRegion(out var start, out var length); - Replace(start, length, new string(keyChar, 1)); + Replace(start, length, new string(keyChar, count)); + } + else if (count > 1) + { + Insert(new string(keyChar, count)); } else {