If you run a command without manually selecting a completion, select the first one. e.g. set vo gn runs set vo gpu-next.
Unified · Split
| @@ -15,7 +15,8 @@ ESC and Ctrl+[ · 14 unmodified lines | ||
| 15 | 15 | Hide the console. |
| 16 | 16 | |
| 17 | 17 | ENTER, Ctrl+j and Ctrl+m |
| 18 | − Run the typed command. | |
| 18 | + Expand the first completion suggestion if present and if none was selected, | |
| 19 | + and run the typed command. | |
| 19 | 20 | |
| 20 | 21 | Shift+ENTER |
| 21 | 22 | Type a literal newline character. |
| @@ -106,6 +106,7 @@ local first_match_to_print = 1 · 105 unmodified lines | ||
| 106 | 106 | local default_item |
| 107 | 107 | |
| 108 | 108 | local complete |
| 109 | +local cycle_through_suggestions | |
| 109 | 110 | local set_active |
| 110 | 111 | |
| 111 | 112 | |
| @@ -821,6 +822,10 @@ local function handle_enter() · 709 unmodified lines | ||
| 821 | 822 | mp.commandv('script-message-to', input_caller, 'input-event', 'submit', |
| 822 | 823 | utils.format_json({line})) |
| 823 | 824 | else |
| 825 | + if selected_suggestion_index == 0 then | |
| 826 | + cycle_through_suggestions() | |
| 827 | + end | |
| 828 | + | |
| 824 | 829 | -- match "help [<text>]", return <text> or "", strip all whitespace |
| 825 | 830 | local help = line:match('^%s*help%s+(.-)%s*$') or |
| 826 | 831 | (line:match('^%s*help$') and '') |
| @@ -1346,7 +1351,7 @@ local function strip_common_characters(str, prefix) · 519 unmodified lines | ||
| 1346 | 1351 | max_overlap_length(prefix, str))) |
| 1347 | 1352 | end |
| 1348 | 1353 | |
| 1349 | −local function cycle_through_suggestions(backwards) | |
| 1354 | +cycle_through_suggestions = function (backwards) | |
| 1350 | 1355 | if #suggestion_buffer == 0 then |
| 1351 | 1356 | -- Allow Tab completion of commands before typing anything. |
| 1352 | 1357 | if line == '' then |