mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-09 20:32:39 +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=""] {
|
.cm-search-widget .sourceURL[href=""] {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.cm-searching {
|
||||||
|
border: 1px dotted black;
|
||||||
|
}
|
||||||
|
|
||||||
.CodeMirror-merge-l-deleted {
|
.CodeMirror-merge-l-deleted {
|
||||||
background-image: none;
|
background-image: none;
|
||||||
|
@ -345,7 +345,11 @@
|
|||||||
if (!cursor.find(previous)) return;
|
if (!cursor.find(previous)) return;
|
||||||
}
|
}
|
||||||
cm.setSelection(cursor.from(), cursor.to());
|
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());
|
if (callback) callback(cursor.from(), cursor.to());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user