With the previous commit, this sorts completions with the same score alphabetically.
Unified · Split
| @@ -1644,6 +1644,7 @@ complete = function () · 1643 unmodified lines | |||
| 1644 | completion_buffer = {} | 1644 | completion_buffer = {} |
| 1645 | selected_completion_index = 0 | 1645 | selected_completion_index = 0 |
| 1646 | completions = completions or {} | 1646 | completions = completions or {} |
| 1647 | table.sort(completions) | ||
| 1647 | completion_pos = completion_pos or 1 | 1648 | completion_pos = completion_pos or 1 |
| 1648 | for i, match in ipairs(fuzzy_find(before_cur:sub(completion_pos), | 1649 | for i, match in ipairs(fuzzy_find(before_cur:sub(completion_pos), |
| 1649 | completions, opts.case_sensitive)) do | 1650 | completions, opts.case_sensitive)) do |
| @@ -1932,6 +1933,7 @@ mp.register_script_message('complete', function(list, start_pos) · 282 unmodified lines | |||
| 1932 | completion_buffer = {} | 1933 | completion_buffer = {} |
| 1933 | selected_completion_index = 0 | 1934 | selected_completion_index = 0 |
| 1934 | local completions = utils.parse_json(list) | 1935 | local completions = utils.parse_json(list) |
| 1936 | table.sort(completions) | ||
| 1935 | completion_pos = start_pos | 1937 | completion_pos = start_pos |
| 1936 | completion_append = '' | 1938 | completion_append = '' |
| 1937 | for i, match in ipairs(fuzzy_find(line:sub(completion_pos, cursor), | 1939 | for i, match in ipairs(fuzzy_find(line:sub(completion_pos, cursor), |