Merge from vscode 2b0b9136329c181a9e381463a1f7dc3a2d105a34 (#4880)

This commit is contained in:
Karl Burtram
2019-04-05 10:09:18 -07:00
committed by GitHub
parent 9bd7e30d18
commit cb5bcf2248
433 changed files with 8915 additions and 8361 deletions

View File

@@ -3,7 +3,6 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as dom from 'vs/base/browser/dom';
import * as objects from 'vs/base/common/objects';
import { renderOcticons } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
import { escape } from 'vs/base/common/strings';
@@ -54,10 +53,9 @@ export class HighlightedLabel {
this.render();
}
private render() {
dom.clearNode(this.domNode);
private render(): void {
let htmlContent: string[] = [];
let htmlContent = '';
let pos = 0;
for (const highlight of this.highlights) {
@@ -65,27 +63,27 @@ export class HighlightedLabel {
continue;
}
if (pos < highlight.start) {
htmlContent.push('<span>');
htmlContent += '<span>';
const substring = this.text.substring(pos, highlight.start);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
htmlContent += '</span>';
pos = highlight.end;
}
htmlContent.push('<span class="highlight">');
htmlContent += '<span class="highlight">';
const substring = this.text.substring(highlight.start, highlight.end);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
htmlContent += '</span>';
pos = highlight.end;
}
if (pos < this.text.length) {
htmlContent.push('<span>');
htmlContent += '<span>';
const substring = this.text.substring(pos);
htmlContent.push(this.supportOcticons ? renderOcticons(substring) : escape(substring));
htmlContent.push('</span>');
htmlContent += this.supportOcticons ? renderOcticons(substring) : escape(substring);
htmlContent += '</span>';
}
this.domNode.innerHTML = htmlContent.join('');
this.domNode.innerHTML = htmlContent;
this.domNode.title = this.title;
this.didEverRender = true;
}