Removed style chacnges

This commit is contained in:
pi1024e
2019-07-23 11:27:22 -04:00
parent 3bbef23764
commit 77df637ab4
3 changed files with 30 additions and 27 deletions

View File

@@ -109,14 +109,15 @@ function pathToSuggestion(p: string, valueBeforeCursor: string, fullValue: strin
const valueAfterLastSlash = fullValue.slice(lastIndexOfSlash + 1);
const startPos = shiftPosition(range.end, -1 - valueAfterLastSlash.length);
// If whitespace exists, replace until there is no more remaining.
// If whitespace exists, replace until there is no more
const whitespaceIndex = valueAfterLastSlash.indexOf(' ');
if (whitespaceIndex === -1) {
replaceRange = Range.create(startPos, shiftPosition(range.end, -1));
let endPos;
if (whitespaceIndex !== -1) {
endPos = shiftPosition(startPos, whitespaceIndex);
} else {
replaceRange = Range.create(startPos, shiftPosition(startPos, whitespaceIndex));
endPos = shiftPosition(range.end, -1);
}
replaceRange = Range.create(startPos, endPos);
}
if (isDir) {