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.
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.
Added support for the plugin's "advanced" config settings.
Removed the enum restriction and prefix concatenation, allowing anything
to be passed through, including raw lua: fixes#1675
The theme list is now much shorter and is included directly in the option
description.
Some general cleanup, in particular to `extraConfig` and `customColorschemeType`.
Moved `extraFiles` from `modules/output.nix` into its own file `modules/files.nix`.
Users should now assign text to a `text` attribute, however they could
also assign a file path to a `source` attribute instead.
The old method of directly assigning a string still works, and is
coerced to the new type along with a deprecation warning.