mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-05 22:14:12 +01:00
Hack to hide -- COMMAND LINE -- with MOW open (what the... does multiline out mode have to do with command-line mode, anyway?)
This commit is contained in:
@@ -272,8 +272,10 @@ const CompletionContext = Class("CompletionContext", {
|
|||||||
|
|
||||||
get completions() this._completions || [],
|
get completions() this._completions || [],
|
||||||
set completions(items) {
|
set completions(items) {
|
||||||
|
if (items && isArray(items.array))
|
||||||
|
items = items.array;
|
||||||
// Accept a generator
|
// Accept a generator
|
||||||
if (items && !(isArray(items) || isArray(items.__proto__)))
|
if (!isArray(items))
|
||||||
items = [x for (x in Iterator(items || []))];
|
items = [x for (x in Iterator(items || []))];
|
||||||
if (this._completions !== items) {
|
if (this._completions !== items) {
|
||||||
delete this.cache.filtered;
|
delete this.cache.filtered;
|
||||||
|
|||||||
@@ -1124,8 +1124,15 @@ const Dactyl = Module("dactyl", {
|
|||||||
"Allow reading of an RC file in the current directory",
|
"Allow reading of an RC file in the current directory",
|
||||||
"boolean", false);
|
"boolean", false);
|
||||||
|
|
||||||
const groups = {
|
options.add(["fullscreen", "fs"],
|
||||||
commandline: {
|
"Show the current window fullscreen",
|
||||||
|
"boolean", false, {
|
||||||
|
setter: function (value) window.fullScreen = value,
|
||||||
|
getter: function () window.fullScreen
|
||||||
|
});
|
||||||
|
|
||||||
|
const groups = [
|
||||||
|
{
|
||||||
opts: {
|
opts: {
|
||||||
c: ["Always show the command-line, even when empty"],
|
c: ["Always show the command-line, even when empty"],
|
||||||
C: ["Always show the command-line outside of the status line"],
|
C: ["Always show the command-line outside of the status line"],
|
||||||
@@ -1135,7 +1142,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
commandline.widgets.updateVisibility();
|
commandline.widgets.updateVisibility();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
config: {
|
{
|
||||||
opts: config.guioptions,
|
opts: config.guioptions,
|
||||||
setter: function (opts) {
|
setter: function (opts) {
|
||||||
for (let [opt, [, ids]] in Iterator(this.opts)) {
|
for (let [opt, [, ids]] in Iterator(this.opts)) {
|
||||||
@@ -1147,7 +1154,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scroll: {
|
{
|
||||||
opts: {
|
opts: {
|
||||||
r: ["Right Scrollbar", "vertical"],
|
r: ["Right Scrollbar", "vertical"],
|
||||||
l: ["Left Scrollbar", "vertical"],
|
l: ["Left Scrollbar", "vertical"],
|
||||||
@@ -1170,7 +1177,7 @@ const Dactyl = Module("dactyl", {
|
|||||||
validator: function (opts) Option.validIf(!(opts.indexOf("l") >= 0 && opts.indexOf("r") >= 0),
|
validator: function (opts) Option.validIf(!(opts.indexOf("l") >= 0 && opts.indexOf("r") >= 0),
|
||||||
UTF8("Only one of ‘l’ or ‘r’ allowed"))
|
UTF8("Only one of ‘l’ or ‘r’ allowed"))
|
||||||
},
|
},
|
||||||
tab: {
|
{
|
||||||
feature: "tabs",
|
feature: "tabs",
|
||||||
opts: {
|
opts: {
|
||||||
n: ["Tab number", highlight.selector("TabNumber")],
|
n: ["Tab number", highlight.selector("TabNumber")],
|
||||||
@@ -1186,32 +1193,21 @@ const Dactyl = Module("dactyl", {
|
|||||||
statusline.updateTabCount();
|
statusline.updateTabCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
].filter(function (group) !group.feature || dactyl.has(group.feature));
|
||||||
|
|
||||||
options.add(["fullscreen", "fs"],
|
|
||||||
"Show the current window fullscreen",
|
|
||||||
"boolean", false, {
|
|
||||||
setter: function (value) window.fullScreen = value,
|
|
||||||
getter: function () window.fullScreen
|
|
||||||
});
|
|
||||||
|
|
||||||
options.add(["guioptions", "go"],
|
options.add(["guioptions", "go"],
|
||||||
"Show or hide certain GUI elements like the menu or toolbar",
|
"Show or hide certain GUI elements like the menu or toolbar",
|
||||||
"charlist", config.defaults.guioptions || "", {
|
"charlist", config.defaults.guioptions || "", {
|
||||||
|
completer: function (context)
|
||||||
|
array(groups).map(function (g) [[k, v[0]] for ([k, v] in Iterator(g.opts))]).flatten(),
|
||||||
setter: function (value) {
|
setter: function (value) {
|
||||||
for (let [, group] in Iterator(groups))
|
for (let group in values(groups))
|
||||||
if (!group.feature || dactyl.has(group.feature))
|
group.setter(value);
|
||||||
group.setter(value);
|
|
||||||
events.checkFocus();
|
events.checkFocus();
|
||||||
return value;
|
return value;
|
||||||
},
|
},
|
||||||
completer: function (context) {
|
|
||||||
let opts = [v.opts for ([k, v] in Iterator(groups)) if (!v.feature || dactyl.has(v.feature))];
|
|
||||||
opts = opts.map(function (opt) [[k, v[0]] for ([k, v] in Iterator(opt))]);
|
|
||||||
return array.flatten(opts);
|
|
||||||
},
|
|
||||||
validator: function (val) Option.validateCompleter.call(this, val) &&
|
validator: function (val) Option.validateCompleter.call(this, val) &&
|
||||||
[v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val))
|
groups.every(function (g) !g.validator || g.validator(val))
|
||||||
});
|
});
|
||||||
|
|
||||||
options.add(["helpfile", "hf"],
|
options.add(["helpfile", "hf"],
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ const Modes = Module("modes", {
|
|||||||
editor.unselectText();
|
editor.unselectText();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.addMode("COMMAND_LINE", { char: "c", input: true });
|
this.addMode("COMMAND_LINE", { char: "c", input: true,
|
||||||
|
display: function () modes.extended & modes.OUTPUT_MULTILINE ? null : this.disp });
|
||||||
this.addMode("CARET", {}, {
|
this.addMode("CARET", {}, {
|
||||||
get pref() options.getPref("accessibility.browsewithcaret"),
|
get pref() options.getPref("accessibility.browsewithcaret"),
|
||||||
set pref(val) options.setPref("accessibility.browsewithcaret", val),
|
set pref(val) options.setPref("accessibility.browsewithcaret", val),
|
||||||
@@ -112,7 +113,7 @@ const Modes = Module("modes", {
|
|||||||
|
|
||||||
let val = this._modeMap[this._main].display();
|
let val = this._modeMap[this._main].display();
|
||||||
if (val)
|
if (val)
|
||||||
return "-- " + this._modeMap[this._main].display() + ext;
|
return "-- " + val + ext;
|
||||||
return macromode;
|
return macromode;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user