Merge pull request #1516 from danielyxie/dev

Fixed folder adding space during autocomplete.
This commit is contained in:
hydroflame 2021-10-15 18:33:46 -04:00 committed by GitHub
commit 85c33fc0b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -75,6 +75,7 @@ interface IProps {
// https://www.npmjs.com/package/@monaco-editor/react#development-playground // https://www.npmjs.com/package/@monaco-editor/react#development-playground
// https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages // https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages
// https://github.com/threehams/typescript-error-guide/blob/master/stories/components/Editor.tsx#L11-L39 // https://github.com/threehams/typescript-error-guide/blob/master/stories/components/Editor.tsx#L11-L39
// https://blog.checklyhq.com/customizing-monaco/
// These variables are used to reload a script when it's clicked on. Because we // These variables are used to reload a script when it's clicked on. Because we
// won't have references to the old script. // won't have references to the old script.

@ -215,7 +215,7 @@ export function TerminalInput({ terminal, router, player }: IProps): React.React
let newValue = tabCompletion(command, arg, allPos, value); let newValue = tabCompletion(command, arg, allPos, value);
if (typeof newValue === "string" && newValue !== "") { if (typeof newValue === "string" && newValue !== "") {
if (!newValue.endsWith(" ") && allPos.length === 1) newValue += " "; if (!newValue.endsWith(" ") && !newValue.endsWith("/") && allPos.length === 1) newValue += " ";
saveValue(newValue); saveValue(newValue);
} }
if (Array.isArray(newValue)) { if (Array.isArray(newValue)) {