From 7362f72fdf9dab5743452bb64520adee8dedf7e7 Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Sat, 14 Sep 2024 16:47:07 +0200 Subject: [PATCH] console.lua: fix completing empty --dscale and --cscale These options accept an empty value within their choices. If the user didn't add manually input a quote before completing them, add quotes automatically so that the blank value can actually be used. --- player/lua/console.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/player/lua/console.lua b/player/lua/console.lua index ec5b4ded0b..7c71c794d2 100644 --- a/player/lua/console.lua +++ b/player/lua/console.lua @@ -1220,6 +1220,11 @@ local function handle_choice_completion(option, before_cur, path_pos) return handle_file_completion(before_cur, path_pos) end + -- Fix completing the empty value for --dscale and --cscale. + if info.choices and info.choices[1] == '' and completion_append == '' then + info.choices[1] = '""' + end + return info.choices, before_cur end