mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-04 09:35:45 +01:00
Fix inifinite loop in <S-Tab>.
This commit is contained in:
@@ -1164,7 +1164,6 @@ var CommandLine = Module("commandline", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
nextItem: function nextItem(tuple, offset, noWrap) {
|
nextItem: function nextItem(tuple, offset, noWrap) {
|
||||||
util.dumpStack("NEXTITEM(" + [tuple, offset, noWrap] + ")", 2);
|
|
||||||
if (!this.activeContexts.length)
|
if (!this.activeContexts.length)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -1380,6 +1379,9 @@ var CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
while (this.tabs.length) {
|
while (this.tabs.length) {
|
||||||
[count, this.wildtypes] = this.tabs.shift();
|
[count, this.wildtypes] = this.tabs.shift();
|
||||||
|
let dir = count;
|
||||||
|
count = Math.abs(count);
|
||||||
|
|
||||||
let steps = Math.constrain(this.wildtypes.length - this.wildIndex, 1, count);
|
let steps = Math.constrain(this.wildtypes.length - this.wildIndex, 1, count);
|
||||||
count = Math.max(1, count - steps);
|
count = Math.max(1, count - steps);
|
||||||
|
|
||||||
@@ -1398,7 +1400,7 @@ var CommandLine = Module("commandline", {
|
|||||||
// Fallthrough
|
// Fallthrough
|
||||||
case "full":
|
case "full":
|
||||||
let c = steps ? 1 : count;
|
let c = steps ? 1 : count;
|
||||||
this.select(c < 0 ? this.UP : this.DOWN, Math.abs(c), true);
|
this.select(dir < 0 ? this.UP : this.DOWN, c, true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2093,8 +2095,6 @@ var ItemList = Class("ItemList", {
|
|||||||
|
|
||||||
get selectedIdx() this._selectedIdx,
|
get selectedIdx() this._selectedIdx,
|
||||||
set selectedIdx(idx) {
|
set selectedIdx(idx) {
|
||||||
if (idx == null && this._selectedIdx != null)
|
|
||||||
util.dumpStack("get selectedIdx " + this._selectedIdx + " => null " + this.context.name, 4);
|
|
||||||
if (this.selectedRow && this._selectedIdx != idx)
|
if (this.selectedRow && this._selectedIdx != idx)
|
||||||
DOM(this.selectedRow).attr("selected", null);
|
DOM(this.selectedRow).attr("selected", null);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user