Skip to content

Commit 14ef91a

Browse files
Adding back the search scrollbar highlights after moving through search results (#2910)
Fixes #2903 After a previous fix with the search highlighting, I broke the search scrollbar highlights showing where in the note search matches were when traversing through search results. This fixes that issue by ensuring it appears even when going through search results.
1 parent 104e2a4 commit 14ef91a

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lib/note-content-editor.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ class NoteContentEditor extends Component<Props> {
125125
contentDiv = createRef<HTMLDivElement>();
126126
decorations: string[] = [];
127127
matchesInNote: [] = [];
128+
overviewRuler = {
129+
color: '#3361cc',
130+
position: Editor.OverviewRulerLane.Full,
131+
};
128132

129133
state: OwnState = {
130134
content: '',
@@ -443,10 +447,7 @@ class NoteContentEditor extends Component<Props> {
443447
matches.push({
444448
options: {
445449
inlineClassName: 'search-decoration',
446-
overviewRuler: {
447-
color: '#3361cc',
448-
position: Editor.OverviewRulerLane.Full,
449-
},
450+
overviewRuler: this.overviewRuler,
450451
},
451452
range: {
452453
startLineNumber: start.lineNumber,
@@ -1137,12 +1138,18 @@ class NoteContentEditor extends Component<Props> {
11371138
if (match.range === range) {
11381139
decoration = {
11391140
range: match.range,
1140-
options: { inlineClassName: 'selected-search' },
1141+
options: {
1142+
inlineClassName: 'selected-search',
1143+
overviewRuler: this.overviewRuler,
1144+
},
11411145
};
11421146
} else {
11431147
decoration = {
11441148
range: match.range,
1145-
options: { inlineClassName: 'search-decoration' },
1149+
options: {
1150+
inlineClassName: 'search-decoration',
1151+
overviewRuler: this.overviewRuler,
1152+
},
11461153
};
11471154
}
11481155
newDecorations.push(decoration);

0 commit comments

Comments
 (0)