From 3d43582f0dd13185e125e07441ae0ead9996a498 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Tue, 12 Oct 2010 01:23:53 -0400 Subject: [PATCH] Add go+=c and move the mode message to the left of the status-line. CSS needs some work. --- common/content/abbreviations.js | 4 +--- common/content/commandline.js | 14 +++++++++----- common/content/configbase.js | 2 +- common/content/dactyl.js | 3 ++- common/content/dactyl.xul | 11 ++++++++--- common/locale/en-US/options.xml | 1 + common/skin/dactyl.css | 4 ++++ pentadactyl/NEWS | 3 ++- 8 files changed, 28 insertions(+), 14 deletions(-) diff --git a/common/content/abbreviations.js b/common/content/abbreviations.js index f2171090..8e1847eb 100644 --- a/common/content/abbreviations.js +++ b/common/content/abbreviations.js @@ -15,9 +15,7 @@ const Abbreviation = Class("Abbreviation", { this.rhs = rhs; }, - equals: function (other) { - return this.lhs == other.lhs && this.rhs == other.rhs; - }, + equals: function (other) this.lhs == other.lhs && this.rhs == other.rhs, expand: function (editor) String(callable(this.rhs) ? this.rhs(editor) : this.rhs), diff --git a/common/content/commandline.js b/common/content/commandline.js index 8d23dc27..c4c0b055 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -19,8 +19,12 @@ const CommandWidgets = Class("CommandWidgets", { this.addElem({ name: "commandline", getGroup: function () options.get("guioptions").has("C") ? this.commandbar : this.statusbar, - getValue: function () this.command, - noValue: true, + getValue: function () this.command + }); + this.addElem({ + name: "strut", + getGroup: function () this.commandbar, + getValue: function () options.get("guioptions").has("c") }); this.addElem({ name: "command", @@ -85,7 +89,7 @@ const CommandWidgets = Class("CommandWidgets", { memoize(this.statusbar, obj.name, function () get("dactyl-statusline-field-" + (obj.id || obj.name))); memoize(this.commandbar, obj.name, function () get("dactyl-" + (obj.id || obj.name))); - if (!obj.noValue) + if (!(obj.noValue || obj.getValue)) Object.defineProperty(this, obj.name, Modes.boundProperty({ get: function () { let elem = self.getGroup(obj.name, obj.value)[obj.name]; @@ -543,7 +547,7 @@ const CommandLine = Module("commandline", { this.hide(); let field = this.widgets.active.message.inputField; - if (!forceSingle && field.editor.rootElement.scrollWidth > field.scrollWidth) { + if (field.value && !forceSingle && field.editor.rootElement.scrollWidth > field.scrollWidth) { this.widgets.message = null; this._echoMultiline({str}, highlightGroup); } @@ -658,7 +662,7 @@ const CommandLine = Module("commandline", { this._echoMultiline({this._lastEcho}, this.widgets.message[0]); - if (action == this._echoLine && !(flags & this.FORCE_MULTILINE) && !this.widgets.mowContainer.collapsed) { + if (action === this._echoLine && !(flags & this.FORCE_MULTILINE) && !this.widgets.mowContainer.collapsed) { highlightGroup += " Message"; action = this._echoMultiline; } diff --git a/common/content/configbase.js b/common/content/configbase.js index c4f9f9ee..39985283 100644 --- a/common/content/configbase.js +++ b/common/content/configbase.js @@ -185,7 +185,7 @@ const ConfigBase = Class(ModuleBase, { StatusInfoMsg color: inherit !important; background: inherit !important; LineNr color: orange !important; background: white !important; ModeMsg color: black !important; background: white !important; - StatusModeMsg color: inherit !important; background: inherit !important; + StatusModeMsg color: inherit !important; background: inherit !important; padding-right: 1em; MoreMsg color: green !important; background: white !important; StatusMoreMsg background: inherit !important; Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block; diff --git a/common/content/dactyl.js b/common/content/dactyl.js index ae0a55b6..ad013588 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1127,8 +1127,9 @@ const Dactyl = Module("dactyl", { const groups = { commandline: { opts: { - M: ["Always show messages outside of the status line"], + c: ["Always show the command-line, even when empty"], C: ["Always show the command-line outside of the status line"], + M: ["Always show messages outside of the status line"] }, setter: function (opts) { commandline.widgets.updateVisibility(); diff --git a/common/content/dactyl.xul b/common/content/dactyl.xul index e52ce6ff..b8054aef 100644 --- a/common/content/dactyl.xul +++ b/common/content/dactyl.xul @@ -83,6 +83,7 @@ + @@ -106,9 +107,13 @@