Skip to content

console.lua: limit how many completions are printed to the terminal#18273

Open
guidocella wants to merge 1 commit into
mpv-player:masterfrom
guidocella:console-complete
Open

console.lua: limit how many completions are printed to the terminal#18273
guidocella wants to merge 1 commit into
mpv-player:masterfrom
guidocella:console-complete

Conversation

@guidocella

Copy link
Copy Markdown
Contributor

This prevents mpv from freezing e.g. when completing very large directories.

Comment thread player/lua/console.lua Outdated

if not dim_completions then
for i, completion in ipairs(completion_buffer) do
for i = math.max(1, #completion_buffer - 999), #completion_buffer do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just trim it to 2-3 rows of completions, instead of fixed number?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it calculate how many terminal cells are occupied vs how many are available. This also has the consequence of showing the first completions instead of the last ones.

@guidocella
guidocella force-pushed the console-complete branch 2 times, most recently from 0f4dd53 to 86a688b Compare July 17, 2026 13:54
This prevents mpv from freezing e.g. when completing very large
directories.
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.

2 participants