Skip to content

Commit

Permalink
feat(autocomplete): add quotes around an argument if it has spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sasial-dev committed Feb 11, 2024
1 parent 6880f3b commit 023944b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,13 @@ export function TerminalTextField({
newText = newText.sub(0, newText.size() - parts[parts.size() - 1].size());
}

newText += currentSuggestion.others[0];
let suggestion = currentSuggestion.others[0];

if (string.match(suggestion, "%s")[0] !== undefined) {
suggestion = `"${suggestion}"`;
}

newText += suggestion;
if (argIndex < commandArgs.size() - 1) {
newText += " ";
}
Expand Down

0 comments on commit 023944b

Please sign in to comment.