mirror of https://github.com/gorhill/uBlock.git
Fix hint helper in element picker's text editor
Regression from:
- 262a1a044f
This commit is contained in:
parent
210ec6b1aa
commit
1de8349045
|
@ -61,12 +61,11 @@ let cachedUserFilters = '';
|
|||
const responseHandler = function(response) {
|
||||
if ( response instanceof Object === false ) { return; }
|
||||
if ( response.hintUpdateToken !== undefined ) {
|
||||
const firstVisit = hintUpdateToken === 0;
|
||||
const mode = cmEditor.getMode();
|
||||
if ( mode.setHints instanceof Function ) {
|
||||
mode.setHints(response, firstVisit);
|
||||
mode.setHints(response);
|
||||
}
|
||||
if ( firstVisit ) {
|
||||
if ( hintUpdateToken === 0 ) {
|
||||
mode.parser.expertMode = response.expertMode !== false;
|
||||
}
|
||||
hintUpdateToken = response.hintUpdateToken;
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
if ( hints instanceof Object ) {
|
||||
const mode = cmEditor.getMode();
|
||||
if ( mode.setHints instanceof Function ) {
|
||||
mode.setHints(hints, true);
|
||||
mode.setHints(hints);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,7 @@ const scriptletNames = new Map();
|
|||
const preparseDirectiveTokens = new Map();
|
||||
const preparseDirectiveHints = [];
|
||||
const originHints = [];
|
||||
let hintHelperRegistered = false;
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
|
@ -361,7 +362,7 @@ CodeMirror.defineMode('ubo-static-filtering', function() {
|
|||
style = style.trim();
|
||||
return style !== '' ? style : null;
|
||||
},
|
||||
setHints: function(details, firstVisit = false) {
|
||||
setHints: function(details) {
|
||||
if ( Array.isArray(details.redirectResources) ) {
|
||||
for ( const [ name, desc ] of details.redirectResources ) {
|
||||
const displayText = desc.aliasOf !== ''
|
||||
|
@ -389,7 +390,8 @@ CodeMirror.defineMode('ubo-static-filtering', function() {
|
|||
originHints.push(hint);
|
||||
}
|
||||
}
|
||||
if ( firstVisit ) {
|
||||
if ( hintHelperRegistered === false ) {
|
||||
hintHelperRegistered = true;
|
||||
initHints();
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue