mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-07 03:12:33 +01:00
Fine tune visuals of CodeMirror's search feature
Added a dotted box around found text occurrences, as just pale yellow to highlight the text is not enough to visually distinguish from surrounding text. Iterating through found text occurrences will now ensure they are vertically positioned in the middle of the editor.
This commit is contained in:
parent
59496cfa45
commit
e44af458c0
@ -105,6 +105,9 @@ div.CodeMirror span.CodeMirror-matchingbracket {
|
||||
.cm-search-widget .sourceURL[href=""] {
|
||||
display: none;
|
||||
}
|
||||
.cm-searching {
|
||||
border: 1px dotted black;
|
||||
}
|
||||
|
||||
.CodeMirror-merge-l-deleted {
|
||||
background-image: none;
|
||||
|
@ -345,7 +345,11 @@
|
||||
if (!cursor.find(previous)) return;
|
||||
}
|
||||
cm.setSelection(cursor.from(), cursor.to());
|
||||
cm.scrollIntoView({from: cursor.from(), to: cursor.to()}, 20);
|
||||
const { clientHeight } = cm.getScrollInfo();
|
||||
cm.scrollIntoView(
|
||||
{ from: cursor.from(), to: cursor.to() },
|
||||
clientHeight >>> 1
|
||||
);
|
||||
if (callback) callback(cursor.from(), cursor.to());
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user