1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-05 21:35:47 +01:00

Wrap long option values in :set output. Closes issue #84.

--HG--
extra : rebase_source : b6346cff93828af6c22b19bbd65ac5cf20b7e72d
This commit is contained in:
Kris Maglione
2010-10-14 13:06:35 -04:00
parent 450a24340e
commit a09f6321e7
4 changed files with 12 additions and 11 deletions

View File

@@ -188,7 +188,8 @@ const ConfigBase = Class(ModuleBase, {
StatusModeMsg color: inherit !important; background: inherit !important; padding-right: 1em; StatusModeMsg color: inherit !important; background: inherit !important; padding-right: 1em;
MoreMsg color: green !important; background: white !important; MoreMsg color: green !important; background: white !important;
StatusMoreMsg background: inherit !important; StatusMoreMsg background: inherit !important;
Message white-space: normal; min-width: 100%; padding-left: 2em; text-indent: -2em; display: block; Message white-space: pre-wrap !important; min-width: 100%; width: 100%; padding-left: 4em; text-indent: -4em; display: block;
!Message String white-space: pre-wrap;
NonText color: blue; min-height: 16px; padding-left: 2px; NonText color: blue; min-height: 16px; padding-left: 2px;
*Preview color: gray; *Preview color: gray;
Question color: green !important; background: white !important; font-weight: bold !important; Question color: green !important; background: white !important; font-weight: bold !important;

View File

@@ -893,7 +893,7 @@ const Options = Module("options", {
if (options["verbose"] > 0 && option.setFrom) if (options["verbose"] > 0 && option.setFrom)
msg += "\n Last set from " + option.setFrom; msg += "\n Last set from " + option.setFrom;
dactyl.echo(<span highlight="CmdOutput">{msg}</span>); dactyl.echo(<span highlight="CmdOutput Message">{msg}</span>);
} }
} }
// write access // write access

View File

@@ -147,13 +147,11 @@ const Highlights = Module("Highlight", {
* *
* @param {string} class * @param {string} class
*/ */
selector: function (class_) { selector: function (class_)
let [, hl, rest] = class_.match(/^(\w*)(.*)/); class_.replace(/(^|\s)([A-Z]\w+)\b/g,
let pattern = "[dactyl|highlight~=" + hl + "]"; function (m, n1, hl) n1 +
if (this.highlight[hl] && this.highlight[hl].class != class_) (this.highlight[hl] && this.highlight[hl].class != class_
pattern = this.highlight[hl].selector; ? this.highlight[hl] : "[dactyl|highlight~=" + hl + "]")),
return pattern + rest;
},
/** /**
* Clears all highlighting rules. Rules with default values are * Clears all highlighting rules. Rules with default values are

View File

@@ -234,8 +234,10 @@ const Template = Module("Template", {
this.map(opts, function (opt) this.map(opts, function (opt)
<tr> <tr>
<td> <td>
<span style={opt.isDefault ? "" : "font-weight: bold"}>{opt.pre}{opt.name}</span><span>{opt.value}</span> <div highlight="Message"
{opt.isDefault || opt.default == null ? "" : <span class="extra-info"> (default: {opt.default})</span>} ><span style={opt.isDefault ? "" : "font-weight: bold"}>{opt.pre}{opt.name}</span><span>{opt.value}</span>{
opt.isDefault || opt.default == null ? "" : <span class="extra-info"> (default: {opt.default})</span>
}</div>
</td> </td>
</tr>) </tr>)
} }