mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
console.lua: strip multiple lines in selectable items
If an item contains newlines, it hides the top items. This is often the case for sub-ass-extradata and metadata/ytdl_description in the property list. So keep only the first line.
This commit is contained in:
committed by
Kacper Michajłow
parent
33e297bd8f
commit
5ec569d073
@@ -1811,8 +1811,12 @@ mp.register_script_message('get-input', function (script_name, args)
|
||||
history = histories[id]
|
||||
history_pos = #history + 1
|
||||
|
||||
selectable_items = args.items
|
||||
if selectable_items then
|
||||
if args.items then
|
||||
selectable_items = {}
|
||||
for i, item in ipairs(args.items) do
|
||||
selectable_items[i] = item:gsub("[\r\n].*", "⋯")
|
||||
end
|
||||
|
||||
matches = {}
|
||||
selected_match = args.default_item or 1
|
||||
default_item = args.default_item
|
||||
|
||||
Reference in New Issue
Block a user