Avoid unexpected value changes

This commit is contained in:
okmttdhr
2019-11-09 21:12:44 +09:00
parent 6378c89efd
commit 92b36ffc78
2 changed files with 21 additions and 3 deletions

View File

@@ -740,9 +740,15 @@ export class SnippetString {
return this;
}
appendChoice(values: string[], number?: number): SnippetString {
this.appendPlaceholder(values.toString(), number);
this.value = this.value.replace(/:/g, '|').replace(/}/g, '|}');
appendChoice(values: string[], number: number = this._tabstop++): SnippetString {
const value = SnippetString._escape(values.toString());
this.value += '${';
this.value += number;
this.value += '|';
this.value += value;
this.value += '|}';
return this;
}