|
|
@ -83,6 +83,13 @@ namespace ConsoleImprovements.Client {
|
|
|
|
|
|
|
|
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
|
|
// ReSharper disable once InconsistentNaming
|
|
|
|
public static bool HookCommandSubmit(Console __instance, ref string line) {
|
|
|
|
public static bool HookCommandSubmit(Console __instance, ref string line) {
|
|
|
|
|
|
|
|
_command = null; // Clear the command pointer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Skip adding the line to the history if it matches the last item
|
|
|
|
|
|
|
|
if (_history.Count > 0 && line == _history.First!.Value) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Keep the set max number of entries in the history
|
|
|
|
// Keep the set max number of entries in the history
|
|
|
|
if (_history.Count >= HistLength) {
|
|
|
|
if (_history.Count >= HistLength) {
|
|
|
|
_history.RemoveLast();
|
|
|
|
_history.RemoveLast();
|
|
|
@ -90,8 +97,6 @@ namespace ConsoleImprovements.Client {
|
|
|
|
|
|
|
|
|
|
|
|
_history.AddFirst(line);
|
|
|
|
_history.AddFirst(line);
|
|
|
|
|
|
|
|
|
|
|
|
_command = null; // Clear the command pointer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; // Resume original functionality
|
|
|
|
return true; // Resume original functionality
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|