Merge pull request #685 from actionless/hotkeys_extended_mathes
feat(awful: hotkeys): extended matching rules
This commit is contained in:
commit
bb85e10042
|
@ -9,12 +9,12 @@
|
||||||
|
|
||||||
local hotkeys_popup = require("awful.hotkeys_popup.widget")
|
local hotkeys_popup = require("awful.hotkeys_popup.widget")
|
||||||
|
|
||||||
local vim_rule = {name="vim"}
|
local vim_rule_any = {name={"vim", "VIM"}}
|
||||||
for group_name, group_data in pairs({
|
for group_name, group_data in pairs({
|
||||||
vim_motion= { color="#009F00", rule=vim_rule },
|
vim_motion= { color="#009F00", rule_any=vim_rule_any },
|
||||||
vim_command= { color="#aFaF00", rule=vim_rule },
|
vim_command= { color="#aFaF00", rule_any=vim_rule_any },
|
||||||
vim_command_insert= { color="#cF4F40", rule=vim_rule },
|
vim_command_insert= { color="#cF4F40", rule_any=vim_rule_any },
|
||||||
vim_operator= { color="#aF6F00", rule=vim_rule },
|
vim_operator= { color="#aF6F00", rule_any=vim_rule_any },
|
||||||
}) do
|
}) do
|
||||||
hotkeys_popup.group_rules[group_name] = group_data
|
hotkeys_popup.group_rules[group_name] = group_data
|
||||||
end
|
end
|
||||||
|
|
|
@ -376,8 +376,15 @@ function widget.show_help(c, s)
|
||||||
for group, _ in pairs(group_list) do
|
for group, _ in pairs(group_list) do
|
||||||
local need_match
|
local need_match
|
||||||
for group_name, data in pairs(widget.group_rules) do
|
for group_name, data in pairs(widget.group_rules) do
|
||||||
if group_name==group and data.rule then
|
if group_name==group and (
|
||||||
if not c or not awful.rules.match(c, data.rule) then
|
data.rule or data.rule_any or data.except or data.except_any
|
||||||
|
) then
|
||||||
|
if not c or not awful.rules.matches(c, {
|
||||||
|
rule=data.rule,
|
||||||
|
rule_any=data.rule_any,
|
||||||
|
except=data.except,
|
||||||
|
except_any=data.except_any
|
||||||
|
}) then
|
||||||
need_match = true
|
need_match = true
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue