History

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.

Guido Cella committed 2 years ago

Commit 7362f721 parent dd77d0a1 file · +5 −0Browse files

Showing the changes to player/lua/console.lua (1 of 1 file). Show all

Unified · Split

player/lua/console.lua+5−0
@@ -1220,6 +1220,11 @@ local function handle_choice_completion(option, before_cur, path_pos) · 1219 unmodified lines
12201220 return handle_file_completion(before_cur, path_pos)
12211221 end
12221222
1223+ -- Fix completing the empty value for --dscale and --cscale.
1224+ if info.choices and info.choices[1] == '' and completion_append == '' then
1225+ info.choices[1] = '""'
1226+ end
1227+
12231228 return info.choices, before_cur
12241229 end
12251230

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t