Skip to content

Commit a715d04

Browse files
committed
fix: test
1 parent 5189e94 commit a715d04

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/nu-cli/src/completions/cell_path_completions.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ fn get_suggestions_by_value(
113113
) -> Vec<SemanticSuggestion> {
114114
let to_suggestion = |s: String, v: Option<&Value>| {
115115
// Check if the string needs quoting (has spaces or punctuation)
116-
let value = if s.contains(|c: char| c.is_whitespace() || c.is_ascii_punctuation()) {
116+
let value = if s.contains(|c: char| {
117+
c.is_whitespace() || (c.is_ascii_punctuation() && !(['_', '-'].contains(&c)))
118+
}) {
117119
format!("{:?}", s)
118120
} else {
119121
s

0 commit comments

Comments
 (0)