From a0d416e94b7796e18fbe04e4230fc0696407c731 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sun, 24 Nov 2024 11:10:08 +0100 Subject: [PATCH] console.lua: highlight the first completion suggestion before cycling 2f271a92de made it so that the first completion suggestion is automatically selected when pressing Enter, if none was manually selected. So automatically highlight the first completion in yellow to show this. --- player/lua/console.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player/lua/console.lua b/player/lua/console.lua index 4d5bfcd83f..8b4bdf0f73 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