Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console.lua: select fixes #15356

Merged
merged 2 commits into from
Nov 22, 2024
Merged

console.lua: select fixes #15356

merged 2 commits into from
Nov 22, 2024

Conversation

guidocella
Copy link
Contributor

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.

console.lua: limit the length of selectable items

Giving very long lines to libass freezes mpv and makes the CPU spin (though it's fine with terminal output). This is often the case user-data/mpv/ytdl/json-subprocess-result in the property list. So limit the length of selectable items to 300 characters (not Unicode aware). This is enough to fill a 1920x1080 window with font_size=16 and Japanese text.

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.
Giving very long lines to libass freezes mpv and makes the CPU spin
(though it's fine with terminal output). This is often the case
user-data/mpv/ytdl/json-subprocess-result in the property list. So limit
the length of selectable items to 300 characters (not Unicode aware).
This is enough to fill a 1920x1080 window with font_size=16 and Japanese
text.
@kasper93 kasper93 merged commit cf3bc0a into mpv-player:master Nov 22, 2024
21 of 25 checks passed
@mrfragger
Copy link

sidenote: Only thing I really want occasionally is to see entire keybindings since some profiles and fonts are extremely lengthy text wise. Searching in select.lua works but you might not get to see the result even though it's in there. So this is alternative way to see if your search is matching that or not. So just bookmark the html in your browser and search your keybindings.

mpv --script-opts=stats-bindlist=yes,stats-term_width_limit=666 | aha -t 'mpv keybindings' --black -w -y 'font-size:1.9em' > keybindings.html

these other ones aren't that important
mpv --list-properties | aha -t 'mpv list properties' -y 'font-size:1.9em' --black -w > list-properties.html; mpv --list-options | aha -t 'mpv list options' -y 'font-size:1.9em' --black -w > list-options.html; mpv --list-protocols | aha -t 'mpv list protocols' -y 'font-size:1.9em' --black -w > list-protocols.html; mpv --ovc=help | aha -t 'ovc video' -y 'font-size:1.9em' --black -w > ovc=help.html; mpv --oac=help | aha -t 'oac audio' -y 'font-size:1.9em' --black -w > oac=help.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants