Skip to content

Commit fdd276b

Browse files
committed
Merge branch 'master' into passthrough-only-on-insert
2 parents 956c35d + 144894b commit fdd276b

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

common/content/buffer.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,12 @@ const Buffer = Module("buffer", {
10951095

10961096
scrollVertical: function scrollVertical(elem, increment, number) {
10971097
elem = elem || Buffer.findScrollable(number, false);
1098+
1099+
if (elem == null && buffer.loaded == 0) {
1100+
liberator.echoerr("Page is still loading");
1101+
return;
1102+
}
1103+
10981104
let fontSize = parseInt(util.computedStyle(elem).fontSize);
10991105
if (increment == "lines")
11001106
increment = fontSize;
@@ -1108,6 +1114,12 @@ const Buffer = Module("buffer", {
11081114

11091115
scrollHorizontal: function scrollHorizontal(elem, increment, number) {
11101116
elem = elem || Buffer.findScrollable(number, true);
1117+
1118+
if (elem == null && buffer.loaded == 0) {
1119+
liberator.echoerr("Page is still loading");
1120+
return;
1121+
}
1122+
11111123
let fontSize = parseInt(util.computedStyle(elem).fontSize);
11121124
if (increment == "columns")
11131125
increment = fontSize; // Good enough, I suppose.

common/content/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const Command = Class("Command", {
155155
action: null,
156156
/**
157157
* @property {string} This command's argument count spec.
158-
* @see Commands#parseArguments
158+
* @see Commands#parseArgs
159159
*/
160160
argCount: 0,
161161
/**
@@ -167,7 +167,7 @@ const Command = Class("Command", {
167167
hereDoc: false,
168168
/**
169169
* @property {Array} The options this command takes.
170-
* @see Commands@parseArguments
170+
* @see Commands@parseArgs
171171
*/
172172
options: [],
173173
/**

common/content/events.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ const Events = Module("events", {
10981098

10991099
onKeyUpOrDown: function (event) {
11001100
// Always let the event be handled by the webpage/Firefox for certain modes
1101-
if (modes.passNextKey || modes.isMenuShown)
1101+
if (modes.isMenuShown)
11021102
return;
11031103

11041104
let key = events.toString(event);
@@ -1115,6 +1115,11 @@ const Events = Module("events", {
11151115
// Many sites perform (useful) actions on keydown.
11161116
// Let's keep the most common ones unless we have a mapping for that
11171117
if (event.type == "keydown" && this.isEscapeKey(key)) {
1118+
if (modes.passNextKey) {
1119+
modes.passNextKey = false;
1120+
return;
1121+
}
1122+
11181123
this.onEscape(); // We do our Escape handling here, as the on "onKeyPress" may not always work if websites override the keydown event
11191124
event.stopPropagation();
11201125
return;

common/content/mappings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ const Mappings = Module("mappings", {
349349
*/
350350
hasMap: function (mode, cmd, patternOrUrl) {
351351
let self = this;
352-
this._user[mode].some(function (map) map.hasName(cmd) && self._matchingUrlsTest(map, patternOrUrl));
352+
return this._user[mode].some(function (map) map.hasName(cmd) && self._matchingUrlsTest(map, patternOrUrl));
353353
},
354354

355355
/**

common/content/tabs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,8 @@ const Tabs = Module("tabs", {
717717
commands.add(["tabd[o]", "bufd[o]"],
718718
"Execute a command in each tab",
719719
function (args) {
720-
for (let i = 0; i < tabs.count; i++) {
720+
let count = tabs.count;
721+
for (let i = 0; i < Math.min(tabs.count, count); i++) {
721722
tabs.select(i);
722723
liberator.execute(args.string, null, true);
723724
}

0 commit comments

Comments
 (0)