When you type something in select mode and then delete it, table.sort changes how selectable items are sorted. Restore the order specified by the mp.input caller in this case.
Unified · Split
| @@ -638,8 +638,14 @@ local function handle_edit() · 637 unmodified lines | |||
| 638 | matches = {} | 638 | matches = {} |
| 639 | selected_match = 1 | 639 | selected_match = 1 |
| 640 | 640 | ||
| 641 | for i, match in ipairs(fuzzy_find(line, selectable_items)) do | 641 | if line == '' then |
| 642 | matches[i] = { index = match, text = selectable_items[match] } | 642 | for i, item in ipairs(selectable_items) do |
| 643 | matches[i] = { index = i, text = item } | ||
| 644 | end | ||
| 645 | else | ||
| 646 | for i, match in ipairs(fuzzy_find(line, selectable_items)) do | ||
| 647 | matches[i] = { index = match, text = selectable_items[match] } | ||
| 648 | end | ||
| 643 | end | 649 | end |
| 644 | end | 650 | end |
| 645 | 651 | ||