modules/fn: fix using autocommands in the functions
This commit is contained in:
parent
a915557ced
commit
592f9251e5
1 changed files with 6 additions and 5 deletions
|
@ -40,16 +40,17 @@ let
|
|||
config = {
|
||||
lambda =
|
||||
let
|
||||
fnArgs = builtins.listToAttrs (map (v: { name = v; value = raw v; }) config.args);
|
||||
inherit (builtins) listToAttrs attrValues;
|
||||
fnArgs = listToAttrs (map (v: { name = v; value = raw v; }) config.args);
|
||||
innerCfg = config.content fnArgs;
|
||||
in
|
||||
lambda config.args (lib.flatten [
|
||||
innerCfg.extra
|
||||
|
||||
# Autocommands
|
||||
(map (v: v.genConfig) (attrValues innerCfg.vim.augroup))
|
||||
# Keymaps
|
||||
(lib.flip map innerCfg.vim.keymap.set ({ mode, lhs, rhs, ... } @ vars:
|
||||
let
|
||||
m = if builtins.isList mode then lib.head mode else mode;
|
||||
in
|
||||
let m = if builtins.isList mode then lib.head mode else mode; in
|
||||
if innerCfg.vim.keymap._validate."${m}"."${lhs}" == rhs then vars.genConfig
|
||||
else abort "This case should never happen."
|
||||
))
|
||||
|
|
Loading…
Reference in a new issue