diff --git a/player/lua/console.lua b/player/lua/console.lua index 4db8df20a1e8e..8b4bdf0f73e06 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -367,7 +367,8 @@ local function format_table(list, width_max, rows_max) or '%-' .. math.min(column_widths[column], 99) .. 's' columns[column] = ass_escape(string.format(format_string, list[i])) - if i == selected_suggestion_index then + if i == selected_suggestion_index or + (i == 1 and selected_suggestion_index == 0) then columns[column] = styles.selected_suggestion .. columns[column] .. '{\\b0}'.. styles.suggestion end @@ -808,9 +809,6 @@ local function handle_enter() if line == '' and input_caller == nil then return end - if history[#history] ~= line and line ~= '' then - history_add(line) - end if selectable_items then if #matches > 0 then @@ -836,6 +834,10 @@ local function handle_enter() end end + if history[#history] ~= line and line ~= '' then + history_add(line) + end + clear() end