Skip to content

Commit

Permalink
fix: always save command history when Nautilus is enabled (#362)
Browse files Browse the repository at this point in the history
always save history
  • Loading branch information
LeeTwentyThree committed May 21, 2023
1 parent 182f6a5 commit f7b189c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Nautilus/Patchers/ConsoleCommandsPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ private static bool DevConsole_Submit_Prefix(string value, out bool __result)
return true; // Let the original method try to handle the command
}

/// <summary>
/// Forces history to always be saved in the command line, regardless of whether it was successful or not.
/// </summary>
/// <param name="__result"></param>
[HarmonyPatch(typeof(DevConsole), nameof(DevConsole.OnSubmit))]
[HarmonyPostfix]
private static void DevConsole_OnSubmit_Postfix(out bool __result)
{
__result = true;
}

/// <summary>
/// Attempts to handle a user command.
/// </summary>
Expand Down

0 comments on commit f7b189c

Please sign in to comment.