commands.lua: add quotes to file completion - #18336
Open
guidocella wants to merge 1 commit into
Open
Conversation
Automatically inserting quotes in file completion problematic, because when completing directories you want the cursor before the final quote rather than after in order to further complete the files within, and there is no system to set a cursor position before the end of the completion. However we can add quotes automatically without this issue when: - completing files in the current directory - we can add only the first quote when completing directories in the current directory - we can add the final quote after files if the user typed a quote at the beginning of the path, since there's nothing remaining to complete after regular files This adds single quotes because they are easier to type. Filenames containing both spaces and single quotes are not supported.
Contributor
|
The quote issue can be avoided entirely by auto escaping special characters instead. There won't be quote character at the end that interferes further completion this way. |
Contributor
Author
|
How? mpv interprets |
Contributor
|
Console can preprocess the input and make that one argument. Similar to what shells do. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatically inserting quotes in file completion problematic, because when completing directories you want the cursor before the final quote rather than after in order to further complete the files within, and there is no system to set a cursor position before the end of the completion.
However we can add quotes automatically without this issue when:
This adds single quotes because they are easier to type. Filenames containing both spaces and single quotes are not supported.