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

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
1220 return handle_file_completion(before_cur, path_pos)1220 return handle_file_completion(before_cur, path_pos)
1221 end1221 end
1222 1222
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
1223 return info.choices, before_cur1228 return info.choices, before_cur
1224end1229end
1225 1230

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