Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit b51b743

Browse files
committed
Prevent very niche recursion situation
1 parent 805aff0 commit b51b743

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/UI/CSConsole/ConsoleController.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ private static void OnInputChanged(string value)
248248
UpdateCaret(out _);
249249
}
250250

251+
private static float timeOfLastCtrlR;
252+
251253
public static void Update()
252254
{
253255
if (SRENotSupported)
@@ -269,8 +271,10 @@ public static void Update()
269271

270272
if (EnableCtrlRShortcut
271273
&& (InputManager.GetKey(KeyCode.LeftControl) || InputManager.GetKey(KeyCode.RightControl))
272-
&& InputManager.GetKeyDown(KeyCode.R))
274+
&& InputManager.GetKeyDown(KeyCode.R)
275+
&& timeOfLastCtrlR.OccuredEarlierThanDefault())
273276
{
277+
timeOfLastCtrlR = Time.realtimeSinceStartup;
274278
Evaluate(Panel.Input.Text);
275279
}
276280
}

0 commit comments

Comments
 (0)