commit
8c0a573b9e
|
@ -94,8 +94,8 @@ function doWrapping(individualLines: boolean, args: any) {
|
|||
} else {
|
||||
const wholeFirstLine = editor.document.lineAt(rangeToReplace.start).text;
|
||||
const otherMatches = wholeFirstLine.match(/^(\s*)/);
|
||||
const preceedingWhitespace = otherMatches ? otherMatches[1] : '';
|
||||
textToWrapInPreview = rangeToReplace.isSingleLine ? [textToReplace] : ['\n\t' + textToReplace.split('\n' + preceedingWhitespace).join('\n\t') + '\n'];
|
||||
const precedingWhitespace = otherMatches ? otherMatches[1] : '';
|
||||
textToWrapInPreview = rangeToReplace.isSingleLine ? [textToReplace] : ['\n\t' + textToReplace.split('\n' + precedingWhitespace).join('\n\t') + '\n'];
|
||||
}
|
||||
textToWrapInPreview = textToWrapInPreview.map(e => e.replace(/(\$\d)/g, '\\$1'));
|
||||
|
||||
|
|
|
@ -594,7 +594,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider
|
|||
): boolean {
|
||||
if (this.client.apiVersion.lt(API.v320)) {
|
||||
// Workaround for https://github.com/Microsoft/TypeScript/issues/27742
|
||||
// Only enable dot completions when previous character not a dot preceeded by whitespace.
|
||||
// Only enable dot completions when previous character not a dot preceded by whitespace.
|
||||
// Prevents incorrectly completing while typing spread operators.
|
||||
if (position.character > 1) {
|
||||
const preText = document.getText(new vscode.Range(
|
||||
|
|
|
@ -532,7 +532,7 @@ export type IRgBytesOrText = { bytes: string } | { text: string };
|
|||
|
||||
export function fixRegexNewline(pattern: string): string {
|
||||
// Replace an unescaped $ at the end of the pattern with \r?$
|
||||
// Match $ preceeded by none or even number of literal \
|
||||
// Match $ preceded by none or even number of literal \
|
||||
return pattern.replace(/(?<=[^\\]|^)(\\\\)*\\n/g, '$1\\r?\\n');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue