forked from extern/nushell
Auto-Completion: put ` tildes around filenames with parentheses (#7712)
# Description Fixes: #7706 # User-Facing Changes ![img](https://user-images.githubusercontent.com/22256154/211286663-3d07a650-5e2d-406e-99f6-cff90dba352b.png) # Tests + Formatting Don't forget to add tests that cover your changes. Make sure you've run and fixed any issues with these commands: - `cargo fmt --all -- --check` to check standard code formatting (`cargo fmt --all` applies these changes) - `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect` to check that you're using the standard code style - `cargo test --workspace` to check that all tests pass # After Submitting If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
parent
80463d12fb
commit
f609a4f26a
@ -146,6 +146,8 @@ pub fn file_path_completion(
|
||||
|| path.contains('"')
|
||||
|| path.contains(' ')
|
||||
|| path.contains('#')
|
||||
|| path.contains('(')
|
||||
|| path.contains(')')
|
||||
{
|
||||
path = format!("`{}`", path);
|
||||
}
|
||||
|
@ -444,6 +444,7 @@ fn file_completion_quoted() {
|
||||
"`te st.txt`".to_string(),
|
||||
"`te#st.txt`".to_string(),
|
||||
"`te'st.txt`".to_string(),
|
||||
"`te(st).txt`".to_string(),
|
||||
];
|
||||
|
||||
match_suggestions(expected_paths, suggestions)
|
||||
|
0
tests/fixtures/quoted_completions/te(st).txt
vendored
Normal file
0
tests/fixtures/quoted_completions/te(st).txt
vendored
Normal file
Loading…
Reference in New Issue
Block a user