Skip to content

Commit 638fac8

Browse files
committed
Fixed tests and reformatted some code to fix a reported exception.
1 parent e43d620 commit 638fac8

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

PSReadLine/PublicAPI.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,11 @@ public static void Replace(int start, int length, string replacement, Action<Con
104104

105105
bool useEditGroup = (_singleton._editGroupStart == -1);
106106

107-
if(useEditGroup)
107+
if (useEditGroup)
108+
{
108109
_singleton.StartEditGroup();
110+
}
111+
109112
var str = _singleton._buffer.ToString(start, length);
110113
_singleton.SaveEditItem(EditItemDelete.Create(str, start));
111114
_singleton._buffer.Remove(start, length);
@@ -119,9 +122,12 @@ public static void Replace(int start, int length, string replacement, Action<Con
119122
{
120123
_singleton._current = start;
121124
}
122-
if(useEditGroup)
125+
126+
if (useEditGroup)
127+
{
123128
_singleton.EndEditGroup(instigator, instigatorArg); // Instigator is needed for VI undo
124-
_singleton.Render();
129+
_singleton.Render();
130+
}
125131
}
126132

127133
/// <summary>

UnitTestPSReadLine/BasicEditingTest.VI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,8 @@ public void ViTestComplete()
806806

807807
Test("ambiguousness", Keys(
808808
"ambag", CheckThat(() => AssertLineIs("ambag")),
809-
_.Escape, "hCig", _.Tab, CheckThat(() => AssertLineIs("ambiguous1")),
810-
_.Escape, "Cness"
809+
_.Escape, "hCig", _.Tab, CheckThat(() => AssertLineIs("ambiguous")),
810+
_.Escape, "Csness"
811811
));
812812
}
813813
}

0 commit comments

Comments
 (0)