concatStringsSep "\n" -> concatLines

concatStringsSep "\n" map -> concatMapStringsSep "\n"
This commit is contained in:
Gerg-L 2024-07-08 17:20:46 -04:00
commit 0c8dff8a89
No known key found for this signature in database
2 changed files with 10 additions and 10 deletions

View file

@ -2,7 +2,7 @@
{lib}: let
inherit (builtins) hasAttr head throw typeOf isList isAttrs isBool isInt isString isPath isFloat toJSON;
inherit (lib.attrsets) mapAttrsToList filterAttrs;
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters;
inherit (lib.strings) concatStringsSep concatMapStringsSep stringToCharacters concatLines;
inherit (lib.trivial) boolToString warn;
in rec {
wrapLuaConfig = {
@ -11,7 +11,7 @@ in rec {
luaAfter ? "",
}: ''
lua << EOF
${concatStringsSep "\n" [luaBefore luaConfig luaAfter]}
${concatLines [luaBefore luaConfig luaAfter]}
EOF
'';

View file

@ -6,7 +6,7 @@
inherit (builtins) map mapAttrs toJSON filter;
inherit (lib.options) mkOption;
inherit (lib.attrsets) filterAttrs getAttrs attrValues attrNames;
inherit (lib.strings) isString concatStringsSep;
inherit (lib.strings) isString concatLines concatMapStringsSep;
inherit (lib.misc) mapAttrsFlatten;
inherit (lib.trivial) showWarnings;
inherit (lib.types) str nullOr;
@ -126,7 +126,7 @@ in {
in {
vim = {
configRC = {
globalsScript = entryAnywhere (concatStringsSep "\n" globalsScript);
globalsScript = entryAnywhere (concatLines globalsScript);
# Call additional lua files with :luafile in Vimscript
# section of the configuration, only after
@ -134,14 +134,14 @@ in {
extraLuaFiles = let
callLuaFiles = map (file: "luafile ${file}") cfg.extraLuaFiles;
in
entryAfter ["globalScript"] (concatStringsSep "\n" callLuaFiles);
entryAfter ["globalScript"] (concatLines callLuaFiles);
# wrap the lua config in a lua block
# using the wrapLuaConfic function from the lib
luaScript = let
mapResult = result: (wrapLuaConfig {
luaBefore = "${cfg.luaConfigPre}";
luaConfig = concatStringsSep "\n" (map mkLuarcSection result);
luaConfig = concatLines (map mkLuarcSection result);
luaAfter = "${cfg.luaConfigPost}";
});
@ -155,7 +155,7 @@ in {
extraPluginConfigs = let
mapResult = result: (wrapLuaConfig {
luaConfig = concatStringsSep "\n" (map mkLuarcSection result);
luaConfig = concatLines (map mkLuarcSection result);
});
extraPluginsDag = mapAttrs (_: {
@ -189,7 +189,7 @@ in {
icmap
allmap
];
mapConfig = wrapLuaConfig {luaConfig = concatStringsSep "\n" (map (v: concatStringsSep "\n" v) maps);};
mapConfig = wrapLuaConfig {luaConfig = concatLines (map concatLines maps);};
in
entryAfter ["globalsScript"] mapConfig;
};
@ -200,10 +200,10 @@ in {
failedAssertions = map (x: x.message) (filter (x: !x.assertion) config.assertions);
baseSystemAssertWarn =
if failedAssertions != []
then throw "\nFailed assertions:\n${concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
then throw "\nFailed assertions:\n${concatMapStringsSep "\n" (x: "- ${x}") failedAssertions}"
else showWarnings config.warnings;
mapResult = result: (concatStringsSep "\n" (map mkVimrcSection result));
mapResult = result: concatMapStringsSep "\n" mkVimrcSection result;
vimConfig = resolveDag {
name = "vim config script";
dag = cfg.configRC;