Skip to content

Commit

Permalink
fixing shellwords
Browse files Browse the repository at this point in the history
  • Loading branch information
tdaron committed Jul 15, 2024
1 parent 0d97406 commit c3eff3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions helix-core/src/shellwords.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ impl<'a> From<&'a str> for Shellwords<'a> {
}
}
}
} else {
if c == '}' {
inside_variable_expansion = false;
}
} else if c == '}' {
inside_variable_expansion = false;
}

state = if !inside_variable_expansion {
Expand All @@ -95,7 +93,7 @@ impl<'a> From<&'a str> for Shellwords<'a> {
}
c if c.is_ascii_whitespace() => {
end = i;
Unquoted
OnWhitespace
}
_ => Unquoted,
},
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3241,7 +3241,7 @@ pub(super) fn command_mode(cx: &mut Context) {

// Handle typable commands
if let Some(cmd) = typed::TYPABLE_COMMAND_MAP.get(parts[0]) {
let shellwords = Shellwords::from(input.as_ref());
let shellwords = Shellwords::from(input);
let words = shellwords.words().to_vec();
let args = if event == PromptEvent::Validate {
match cx.editor.expand_variables(&words) {
Expand Down

0 comments on commit c3eff3e

Please sign in to comment.