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

Give the Cmd* and Status* highlight groups slightly higher precedence than their unadorned variants.

This commit is contained in:
Kris Maglione
2010-10-05 20:03:06 -04:00
parent e953ec0801
commit f17790a39a
2 changed files with 23 additions and 3 deletions

View File

@@ -160,6 +160,24 @@ const ConfigBase = Class(ModuleBase, {
Enabled color: blue;
Disabled color: red;
// Hack to give these groups slightly higher precedence
// than their unadorned variants.
//
CmdNormal;[dactyl|highlight]
StatusNormal;[dactyl|highlight]
CmdErrorMsg;[dactyl|highlight]
StatusErrorMsg;[dactyl|highlight]
CmdInfoMsg;[dactyl|highlight]
StatusInfoMsg;[dactyl|highlight]
CmdModeMsg;[dactyl|highlight]
StatusModeMsg;[dactyl|highlight]
CmdMoreMsg;[dactyl|highlight]
StatusMoreMsg;[dactyl|highlight]
CmdQuestion;[dactyl|highlight]
StatusQuestion;[dactyl|highlight]
CmdWarningMsg;[dactyl|highlight]
StatusWarningMsg;[dactyl|highlight]
!Normal color: black !important; background: white !important; font-weight: normal !important;
!StatusNormal color: inherit !important; background: inherit !important;
ErrorMsg color: white !important; background: red !important; font-weight: bold !important;

View File

@@ -73,11 +73,13 @@ const Highlights = Module("Highlight", {
let old = this.highlight[obj.class];
this.highlight[obj.class] = obj;
// This *must* come before any other property changes.
if (old)
if (old) {
obj.selector = old.selector;
obj.style = old.style;
}
if (/^[>+ ]/.test(obj.selector))
obj.selector = this.selector(obj.class) + obj.selector;
if (/^[[>+ ]/.test(args[1]))
obj.selector = this.selector(obj.class) + args[1];
if (old && old.value != old.default)
obj.value = old.style;