Skip to content

Commit 26ef819

Browse files
committed
Fix fmt
1 parent d39eae3 commit 26ef819

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

crates/shell/src/completion.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ fn extract_word(line: &str, pos: usize) -> (usize, &str) {
6363
let ch = bytes[i] as char;
6464

6565
// Check for word boundary characters
66-
if ch == ' ' || ch == '|' || ch == '&' || ch == ';' || ch == '<' || ch == '>' || ch == '\t' {
66+
if ch == ' ' || ch == '|' || ch == '&' || ch == ';' || ch == '<' || ch == '>' || ch == '\t'
67+
{
6768
// Count preceding backslashes to see if this character is escaped
6869
let mut num_backslashes = 0;
6970
let mut j = i;
@@ -195,7 +196,13 @@ fn resolve_dir_path(dir_path: &str) -> PathBuf {
195196
} else if let Some(stripped) = dir_path.strip_prefix('~') {
196197
let unescaped_stripped = unescape_for_completion(stripped);
197198
dirs::home_dir()
198-
.map(|h| h.join(unescaped_stripped.strip_prefix('/').unwrap_or(&unescaped_stripped)))
199+
.map(|h| {
200+
h.join(
201+
unescaped_stripped
202+
.strip_prefix('/')
203+
.unwrap_or(&unescaped_stripped),
204+
)
205+
})
199206
.unwrap_or_else(|| PathBuf::from(unescaped))
200207
} else {
201208
PathBuf::from(".").join(unescaped)

0 commit comments

Comments
 (0)