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 = {
|
config = {
|
||||||
lambda =
|
lambda =
|
||||||
let
|
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;
|
innerCfg = config.content fnArgs;
|
||||||
in
|
in
|
||||||
lambda config.args (lib.flatten [
|
lambda config.args (lib.flatten [
|
||||||
innerCfg.extra
|
innerCfg.extra
|
||||||
|
# Autocommands
|
||||||
|
(map (v: v.genConfig) (attrValues innerCfg.vim.augroup))
|
||||||
|
# Keymaps
|
||||||
(lib.flip map innerCfg.vim.keymap.set ({ mode, lhs, rhs, ... } @ vars:
|
(lib.flip map innerCfg.vim.keymap.set ({ mode, lhs, rhs, ... } @ vars:
|
||||||
let
|
let m = if builtins.isList mode then lib.head mode else mode; in
|
||||||
m = if builtins.isList mode then lib.head mode else mode;
|
|
||||||
in
|
|
||||||
if innerCfg.vim.keymap._validate."${m}"."${lhs}" == rhs then vars.genConfig
|
if innerCfg.vim.keymap._validate."${m}"."${lhs}" == rhs then vars.genConfig
|
||||||
else abort "This case should never happen."
|
else abort "This case should never happen."
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in a new issue