1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-05 00:35:46 +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:
Kris Maglione
2010-10-12 02:57:10 -04:00
parent 3d43582f0d
commit a3ce7ae169
3 changed files with 24 additions and 25 deletions

View File

@@ -272,8 +272,10 @@ const CompletionContext = Class("CompletionContext", {
get completions() this._completions || [],
set completions(items) {
if (items && isArray(items.array))
items = items.array;
// Accept a generator
if (items && !(isArray(items) || isArray(items.__proto__)))
if (!isArray(items))
items = [x for (x in Iterator(items || []))];
if (this._completions !== items) {
delete this.cache.filtered;

View File

@@ -1124,8 +1124,15 @@ const Dactyl = Module("dactyl", {
"Allow reading of an RC file in the current directory",
"boolean", false);
const groups = {
commandline: {
options.add(["fullscreen", "fs"],
"Show the current window fullscreen",
"boolean", false, {
setter: function (value) window.fullScreen = value,
getter: function () window.fullScreen
});
const groups = [
{
opts: {
c: ["Always show the command-line, even when empty"],
C: ["Always show the command-line outside of the status line"],
@@ -1135,7 +1142,7 @@ const Dactyl = Module("dactyl", {
commandline.widgets.updateVisibility();
}
},
config: {
{
opts: config.guioptions,
setter: function (opts) {
for (let [opt, [, ids]] in Iterator(this.opts)) {
@@ -1147,7 +1154,7 @@ const Dactyl = Module("dactyl", {
}
}
},
scroll: {
{
opts: {
r: ["Right 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),
UTF8("Only one of l or r allowed"))
},
tab: {
{
feature: "tabs",
opts: {
n: ["Tab number", highlight.selector("TabNumber")],
@@ -1186,32 +1193,21 @@ const Dactyl = Module("dactyl", {
statusline.updateTabCount();
}
}
};
options.add(["fullscreen", "fs"],
"Show the current window fullscreen",
"boolean", false, {
setter: function (value) window.fullScreen = value,
getter: function () window.fullScreen
});
].filter(function (group) !group.feature || dactyl.has(group.feature));
options.add(["guioptions", "go"],
"Show or hide certain GUI elements like the menu or toolbar",
"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) {
for (let [, group] in Iterator(groups))
if (!group.feature || dactyl.has(group.feature))
group.setter(value);
for (let group in values(groups))
group.setter(value);
events.checkFocus();
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) &&
[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"],

View File

@@ -43,7 +43,8 @@ const Modes = Module("modes", {
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", {}, {
get pref() options.getPref("accessibility.browsewithcaret"),
set pref(val) options.setPref("accessibility.browsewithcaret", val),
@@ -112,7 +113,7 @@ const Modes = Module("modes", {
let val = this._modeMap[this._main].display();
if (val)
return "-- " + this._modeMap[this._main].display() + ext;
return "-- " + val + ext;
return macromode;
},