mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Before this commit, CodeMirror's add-on for search occurrences was limited to find at most 1000 first occurrences, because of performance considerations. This commit removes this low limit by having the search occurrences done in a dedicated worker. The limit is now time-based, and highly unlikely to ever be hit under normal condition. With this change, all search occurrences are gathered, and as a result: - All occurrences are reported in the scrollbar instead of just the 1,000 first - The total count of all occurrences is now reported, instead of capping at "1000+". - The current occurrence rank at the cursor or selection position is now reported -- this was not possible to report this before. The number of occurrences is line-based, it's not useful to report finer-grained occurences in uBO.
132 lines
3 KiB
CSS
132 lines
3 KiB
CSS
.codeMirrorContainer {
|
|
font-size: 12px;
|
|
line-height: 1.25;
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
.CodeMirror {
|
|
box-sizing: border-box;
|
|
flex-grow: 1;
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
|
|
/* For when panels are used */
|
|
.codeMirrorContainer > div:not([class^="CodeMirror"]) {
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 100%;
|
|
}
|
|
|
|
.codeMirrorContainer.codeMirrorBreakAll .CodeMirror-wrap pre {
|
|
word-break: break-all;
|
|
}
|
|
|
|
/* CodeMirror theme overrides */
|
|
.cm-s-default .cm-value { color: #930; }
|
|
.cm-s-default .cm-comment { color: #777; }
|
|
.cm-s-default .cm-keyword { color: #90b; }
|
|
.cm-s-default .cm-regex {
|
|
text-underline-position: under;
|
|
text-decoration-color: darkgray;
|
|
text-decoration-style: solid;
|
|
text-decoration-line: underline;
|
|
}
|
|
.cm-s-default .cm-error {
|
|
color: inherit;
|
|
}
|
|
.cm-s-default .cm-error,
|
|
.CodeMirror-linebackground.error {
|
|
background-color: #ff000016;
|
|
text-decoration: underline red;
|
|
text-underline-position: under;
|
|
}
|
|
|
|
.cm-directive { color: #333; font-weight: bold; }
|
|
.cm-staticext { color: #008; }
|
|
.cm-staticnetBlock { color: #800; }
|
|
.cm-staticnetAllow { color: #004f00; }
|
|
.cm-staticOpt { background-color: #ddd; font-weight: bold; }
|
|
|
|
div.CodeMirror span.CodeMirror-matchingbracket {
|
|
color: unset;
|
|
}
|
|
.CodeMirror-matchingbracket {
|
|
background-color: #afa;
|
|
color: inherit !important;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.cm-search-widget {
|
|
align-items: center;
|
|
background-color: var(--bg-code);
|
|
cursor: default;
|
|
direction: ltr;
|
|
display: flex;
|
|
flex-shrink: 0;
|
|
font-size: 110%;
|
|
justify-content: center;
|
|
padding: 0.5em;
|
|
user-select: none;
|
|
-moz-user-select: none;
|
|
-webkit-user-select: none;
|
|
z-index: 1000;
|
|
}
|
|
.cm-search-widget .fa-icon {
|
|
fill: #888;
|
|
font-size: 140%;
|
|
}
|
|
.cm-search-widget .fa-icon:not(.fa-icon-ro):hover {
|
|
fill: #000;
|
|
}
|
|
.cm-search-widget-input {
|
|
border: 1px solid gray;
|
|
border-radius: 3px;
|
|
display: inline-flex;
|
|
min-width: 14em;
|
|
width: 30vw;
|
|
}
|
|
.cm-search-widget-input > input {
|
|
border: 0;
|
|
flex-grow: 1;
|
|
width: 100%;
|
|
}
|
|
.cm-search-widget-input > .cm-search-widget-count {
|
|
align-items: center;
|
|
display: none;
|
|
flex-grow: 0;
|
|
font-size: 80%;
|
|
padding: 0 0.4em;
|
|
}
|
|
.cm-search-widget[data-query] .cm-search-widget-count {
|
|
display: inline-flex;
|
|
}
|
|
.cm-search-widget .cm-search-widget-button:hover {
|
|
color: #000;
|
|
}
|
|
.cm-search-widget .sourceURL {
|
|
padding-left: 0.5em;
|
|
padding-right: 0.5em;
|
|
position: absolute;
|
|
left: 0;
|
|
}
|
|
.cm-search-widget .sourceURL[href=""] {
|
|
display: none;
|
|
}
|
|
|
|
.CodeMirror-merge-l-deleted {
|
|
background-image: none;
|
|
font-weight: bold;
|
|
}
|
|
.CodeMirror-merge-l-inserted {
|
|
background-image: none;
|
|
font-weight: bold;
|
|
}
|
|
/* This probably needs to be added to CodeMirror repo */
|
|
.CodeMirror-merge-gap {
|
|
vertical-align: top;
|
|
}
|
|
|
|
.CodeMirror-hints {
|
|
z-index: 10000;
|
|
}
|