Fix output log console to remove executed command from history no matter the placement

This commit is contained in:
Wojtek Figat
2025-07-31 17:32:41 +02:00
parent 846a0b5685
commit 9c5060584d

View File

@@ -344,8 +344,8 @@ namespace FlaxEditor.Windows
// Update history buffer
if (_window._commandHistory == null)
_window._commandHistory = new List<string>();
else if (_window._commandHistory.Count != 0 && _window._commandHistory.Last() == command)
_window._commandHistory.RemoveAt(_window._commandHistory.Count - 1);
else if (_window._commandHistory.Count != 0 && _window._commandHistory.Contains(command))
_window._commandHistory.Remove(command);
_window._commandHistory.Add(command);
if (_window._commandHistory.Count > CommandHistoryLimit)
_window._commandHistory.RemoveAt(0);