Problem: Some modules are setting empty strings to extraConfig* options
with the intention to not generate any config. But empty
strings are also values, so they are still concatenated in the
final value of extraConfig* options. This results in a
multiple empty strings in extraConfigs.
Solution: Avoid using optionalString when setting values to extraConfig*
options. Use mkIf instead.
This commit also fixes mkIf condition in autocmd module.
`mkNeovimPlugin` is a special case. To avoid evaluating
caller's arguments mkMerge/optionalAttrs pattern is used
instead.
The motivation for this change was to avoid generating empty
config sections like
vim.cmd([[
]])
To make a config generation cleaner several helper functions introduced:
* `hasContent` have been moved to helpers
* `concatNonEmptyLines` joins strings (which has content) separated with
newlines
* `wrapVimscriptForLua` wraps a lua string for using in Vimscript, but
only if the string has content, otherwise empty string is returned
* `wrapLuaForVimscript` wraps Vimscript for using in lua, but only if
the string has content, otherwise empty string is returned
Added tests:
* testing that all possible config sections are present in the final
generated config
* testing that the config files generated by empty `files` definitions
don't have any content in it
When setting any filetype suboption to null (or anything else guarded by
mkIf) it's value becomes:
{ extension = null; filename = null; pattern = null; }
Account for that case in mkIf condition so that the option would not
produce empty filetype definition.
This avoids having the option always "defined".
This also avoids luaLoader configuration in extra files by default.
Earlier `vim.loader.disable()` was always added to configs produced
by `files` option, effectively disabling luaLoader even if it was
explicitly enabled in a top-level configuration.
- Run the `update.yml` workflow on the triggered branch, replace the
job matrix with a conditional step that runs update on nixos-24.05.
- Added a `cancel-in-progress` concurrency group.
- Disabled committing in PR action (using negative add-paths).
Introduce `_mk-source-plugin.nix`, which returns a module handling a
specific none-ls source plugin.
This wasn't possible previously due to IFD conflicting with evaluating
module imports.
Adjusted the test to use the `options` provided via module args, and
cleaned up some stuff allowing "unpackaged" sources to not be listed
again in the test file.
The plugin's default is not compatible with nix, because it ends up in
the read-only /nix/store.
Set our default to the one used in their upcoming "1.0" version.
- Rename workflow to simply "update"
- Drop the DeterminateSystems/update-flake-lock action
- Instead use `nix flake update --commit-lock-file`
- Also use `generate-files`'s `--commit` option
- Use peter-evans/create-pull-request to open a PR