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: stop expanding ~/ in file completion #15779

Merged
merged 1 commit into from
Feb 1, 2025

Conversation

guidocella
Copy link
Contributor

It is not needed to expand ~ in file completion as you type after 62c3aeb makde commands themselves interpret it. We only need to call expand-path on the directory before passing it to utils.readdir in order to find files in it when it contains ~ placeholders. As a bonus this will now also complete files in directories like ~~/ and ~state/.

This simplifies command completion and was also the blocker for splitting running commands out of console.lua since I didn't know how to replicate it through mp.input.

Copy link

github-actions bot commented Jan 30, 2025

Download the artifacts for this pull request:

Windows
macOS

Copy link
Contributor

@kasper93 kasper93 left a comment

Choose a reason for hiding this comment

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

there is typo in commit message

It is not needed to expand ~ in file completion as you type after
62c3aeb made commands themselves interpret it. We only need to call
expand-path on the directory before passing it to utils.readdir in order
to find files in it when it contains ~ placeholders. As a bonus this
will now also complete files in directories like ~~/ and ~state/.

This simplifies command completion, and was also the blocker for
splitting running commands out of console.lua, since I didn't know how
to replicate it through mp.input.
@Dudemanguy Dudemanguy merged commit b2404e1 into mpv-player:master Feb 1, 2025
27 checks passed
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