Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

Commit 6e8ea61

Browse files
committed
using multi-highlight for search results
1 parent f3fc4cb commit 6e8ea61

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

frontend/Store.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ class Store extends EventEmitter {
194194
this.searchText = text;
195195
this.emit('searchText');
196196
this.emit('searchRoots');
197+
this.highlightSearchResults();
197198
if (this.searchRoots && !this.searchRoots.contains(this.selected)) {
198199
this.select(null, true);
199200
} else if (!this.searchRoots) {
@@ -205,6 +206,14 @@ class Store extends EventEmitter {
205206
}
206207
}
207208

209+
highlightSearchResults() {
210+
if (this.searchRoots && this.searchRoots.size) {
211+
this._bridge.send('highlightMany', this.searchRoots.toArray());
212+
} else {
213+
this._bridge.send('hideHighlight');
214+
}
215+
}
216+
208217
hoverClass(name: string): void {
209218
if (name === null) {
210219
this._bridge.send('hideHighlight');

0 commit comments

Comments
 (0)