Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/firefox/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"uBlock0@raymondhill.net": {
"updates": [
{
"version": "1.33.3.3",
"version": "1.33.3.4",
"browser_specific_settings": { "gecko": { "strict_min_version": "57" } },
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.33.3b3/uBlock0_1.33.3b3.firefox.signed.xpi"
"update_link": "https://github.com/gorhill/uBlock/releases/download/1.33.3b4/uBlock0_1.33.3b4.firefox.signed.xpi"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion dist/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.33.3.3
1.33.3.4
1 change: 1 addition & 0 deletions src/js/popup-fenix.js
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,7 @@ const revertFirewallRules = async function() {
});
cachePopupData(response);
updateAllFirewallCells(true, false);
updateHnSwitches();
hashFromPopupData();
};

Expand Down
10 changes: 7 additions & 3 deletions src/lib/codemirror/addon/display/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,18 @@
};

function initPanels(cm) {
var wrap = cm.getWrapperElement();
var wrap = cm.getWrapperElement()
var style = window.getComputedStyle ? window.getComputedStyle(wrap) : wrap.currentStyle;
var height = parseInt(style.height);
var info = cm.state.panels = {
setHeight: wrap.style.height,
panels: [],
wrapper: document.createElement("div")
};
var hasFocus = cm.hasFocus(), scrollPos = cm.getScrollInfo()
wrap.parentNode.insertBefore(info.wrapper, wrap);
var hasFocus = cm.hasFocus();
info.wrapper.appendChild(wrap);
cm.scrollTo(scrollPos.left, scrollPos.top)
if (hasFocus) cm.focus();

cm._setSize = cm.setSize;
Expand Down Expand Up @@ -114,8 +115,11 @@
var info = cm.state.panels;
cm.state.panels = null;

var wrap = cm.getWrapperElement();
var wrap = cm.getWrapperElement()
var hasFocus = cm.hasFocus(), scrollPos = cm.getScrollInfo()
info.wrapper.parentNode.replaceChild(wrap, info.wrapper);
cm.scrollTo(scrollPos.left, scrollPos.top)
if (hasFocus) cm.focus();
wrap.style.height = info.setHeight;
cm.setSize = cm._setSize;
cm.setSize();
Expand Down
22 changes: 16 additions & 6 deletions src/lib/codemirror/addon/edit/closebrackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
cm.operation(function() {
var linesep = cm.lineSeparator() || "\n";
cm.replaceSelection(linesep + linesep, null);
cm.execCommand("goCharLeft");
moveSel(cm, -1)
ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
var line = ranges[i].head.line;
Expand All @@ -97,6 +97,17 @@
});
}

function moveSel(cm, dir) {
var newRanges = [], ranges = cm.listSelections(), primary = 0
for (var i = 0; i < ranges.length; i++) {
var range = ranges[i]
if (range.head == cm.getCursor()) primary = i
var pos = range.head.ch || dir > 0 ? {line: range.head.line, ch: range.head.ch + dir} : {line: range.head.line - 1}
newRanges.push({anchor: pos, head: pos})
}
cm.setSelections(newRanges, primary)
}

function contractSelection(sel) {
var inverted = CodeMirror.cmpPos(sel.anchor, sel.head) > 0;
return {anchor: new Pos(sel.anchor.line, sel.anchor.ch + (inverted ? -1 : 1)),
Expand Down Expand Up @@ -153,10 +164,9 @@
var right = pos % 2 ? ch : pairs.charAt(pos + 1);
cm.operation(function() {
if (type == "skip") {
cm.execCommand("goCharRight");
moveSel(cm, 1)
} else if (type == "skipThree") {
for (var i = 0; i < 3; i++)
cm.execCommand("goCharRight");
moveSel(cm, 3)
} else if (type == "surround") {
var sels = cm.getSelections();
for (var i = 0; i < sels.length; i++)
Expand All @@ -169,10 +179,10 @@
} else if (type == "both") {
cm.replaceSelection(left + right, null);
cm.triggerElectric(left + right);
cm.execCommand("goCharLeft");
moveSel(cm, -1)
} else if (type == "addFour") {
cm.replaceSelection(left + left + left + left, "before");
cm.execCommand("goCharRight");
moveSel(cm, 1)
}
});
}
Expand Down
12 changes: 7 additions & 5 deletions src/lib/codemirror/addon/edit/matchbrackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));

var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style, config);
if (found == null) return null;
return {from: Pos(where.line, pos), to: found && found.pos,
match: found && found.ch == match.charAt(0), forward: dir > 0};
Expand Down Expand Up @@ -67,7 +67,8 @@
if (lineNo == where.line) pos = where.ch - (dir < 0 ? 1 : 0);
for (; pos != end; pos += dir) {
var ch = line.charAt(pos);
if (re.test(ch) && (style === undefined || cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style)) {
if (re.test(ch) && (style === undefined ||
(cm.getTokenTypeAt(Pos(lineNo, pos + 1)) || "") == (style || ""))) {
var match = matching[ch];
if (match && (match.charAt(1) == ">") == (dir > 0)) stack.push(ch);
else if (!stack.length) return {pos: Pos(lineNo, pos), ch: ch};
Expand All @@ -80,11 +81,12 @@

function matchBrackets(cm, autoclear, config) {
// Disable brace matching in long lines, since it'll cause hugely slow updates
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000,
highlightNonMatching = config && config.highlightNonMatching;
var marks = [], ranges = cm.listSelections();
for (var i = 0; i < ranges.length; i++) {
var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
if (match && (match.match || highlightNonMatching !== false) && cm.getLine(match.from.line).length <= maxHighlightLen) {
var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
if (match.to && cm.getLine(match.to.line).length <= maxHighlightLen)
Expand All @@ -94,7 +96,7 @@

if (marks.length) {
// Kludge to work around the IE bug from issue #1193, where text
// input stops going to the textare whever this fires.
// input stops going to the textarea whenever this fires.
if (ie_lt8 && cm.state.focused) cm.focus();

var clear = function() {
Expand Down
16 changes: 9 additions & 7 deletions src/lib/codemirror/addon/hint/show-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@
this.startPos = this.cm.getCursor("start");
this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;

var self = this;
cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); });
if (this.options.updateOnCursorActivity) {
var self = this;
cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); });
}
}

var requestAnimationFrame = window.requestAnimationFrame || function(fn) {
Expand All @@ -75,7 +77,9 @@
if (!this.active()) return;
this.cm.state.completionActive = null;
this.tick = null;
this.cm.off("cursorActivity", this.activityFunc);
if (this.options.updateOnCursorActivity) {
this.cm.off("cursorActivity", this.activityFunc);
}

if (this.widget && this.data) CodeMirror.signal(this.data, "close");
if (this.widget) this.widget.close();
Expand Down Expand Up @@ -117,9 +121,7 @@
if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||
pos.ch < identStart.ch || this.cm.somethingSelected() ||
(!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {
if (this.options.closeOnCursorActivity) {
this.close();
}
this.close();
} else {
var self = this;
this.debounce = requestAnimationFrame(function() {self.update();});
Expand Down Expand Up @@ -492,9 +494,9 @@
completeSingle: true,
alignWithWord: true,
closeCharacters: /[\s()\[\]{};:>,]/,
closeOnCursorActivity: true,
closeOnPick: true,
closeOnUnfocus: true,
updateOnCursorActivity: true,
completeOnSingleClick: true,
container: null,
customKeys: null,
Expand Down
17 changes: 10 additions & 7 deletions src/lib/codemirror/lib/codemirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent);
var phantom = /PhantomJS/.test(userAgent);

var ios = !edge && /AppleWebKit/.test(userAgent) && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2);
var ios = safari && (/Mobile\/\w+/.test(userAgent) || navigator.maxTouchPoints > 2);
var android = /Android/.test(userAgent);
// This is woefully incomplete. Suggestions for alternative methods welcome.
var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);
Expand Down Expand Up @@ -5115,7 +5115,7 @@
(cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);
setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));

if (!(options && options.scroll === false) && doc.cm)
if (!(options && options.scroll === false) && doc.cm && doc.cm.getOption("readOnly") != "nocursor")
{ ensureCursorVisible(doc.cm); }
}

Expand Down Expand Up @@ -8675,10 +8675,13 @@
function moveOnce(boundToLine) {
var next;
if (unit == "codepoint") {
var ch = lineObj.text.charCodeAt(pos.ch + (unit > 0 ? 0 : -1));
if (isNaN(ch)) { next = null; }
else { next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (ch >= 0xD800 && ch < 0xDC00 ? 2 : 1))),
-dir); }
var ch = lineObj.text.charCodeAt(pos.ch + (dir > 0 ? 0 : -1));
if (isNaN(ch)) {
next = null;
} else {
var astral = dir > 0 ? ch >= 0xD800 && ch < 0xDC00 : ch >= 0xDC00 && ch < 0xDFFF;
next = new Pos(pos.line, Math.max(0, Math.min(lineObj.text.length, pos.ch + dir * (astral ? 2 : 1))), -dir);
}
} else if (visually) {
next = moveVisually(doc.cm, lineObj, pos, dir);
} else {
Expand Down Expand Up @@ -9790,7 +9793,7 @@

addLegacyProps(CodeMirror);

CodeMirror.version = "5.59.0";
CodeMirror.version = "5.59.2";

return CodeMirror;

Expand Down