mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-01 12:54:30 +02:00
modules/spellfiles: init
This commit is contained in:
parent
a3245848da
commit
420470dfde
7 changed files with 1015 additions and 0 deletions
95
tests/test-sources/modules/spellfiles.nix
Normal file
95
tests/test-sources/modules/spellfiles.nix
Normal file
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
default = {
|
||||
spellfiles.enable = true;
|
||||
};
|
||||
|
||||
custom-languages = {
|
||||
spellfiles = {
|
||||
enable = true;
|
||||
|
||||
includeSuggestions = true;
|
||||
languages = [
|
||||
"en"
|
||||
"fr"
|
||||
"de"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
custom-encoding = {
|
||||
# Neovim cannot start with an encoding different from utf-8:
|
||||
# Error while calling lua chunk: vim/_options.lua:0: E519: Option not supported
|
||||
test.runNvim = false;
|
||||
|
||||
opts.encoding = "iso-8859-2";
|
||||
spellfiles = {
|
||||
enable = true;
|
||||
languages = [
|
||||
"pl"
|
||||
"ro"
|
||||
"sk"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
lang-from-nvim-options = {
|
||||
spellfiles.enable = true;
|
||||
opts.spelllang = "en_us,fr,medical";
|
||||
|
||||
imports = [
|
||||
(
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
assertions =
|
||||
let
|
||||
printList = l: ''[ "${lib.concatStringsSep ''", "'' l}" ]'';
|
||||
expected = [
|
||||
"en"
|
||||
"fr"
|
||||
];
|
||||
in
|
||||
[
|
||||
{
|
||||
assertion = config.spellfiles.languages == expected;
|
||||
message = ''
|
||||
`config.spellfiles.languages` is wrongly inferred from `opts.spellang`.
|
||||
It is ${printList config.spellfiles.languages} instead of ${printList expected}.
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
)
|
||||
];
|
||||
};
|
||||
|
||||
custom-spellfiles = {
|
||||
spellfiles = {
|
||||
enable = true;
|
||||
|
||||
spellfiles = [
|
||||
"en.utf-8.spl"
|
||||
"sr@latin.utf-8.spl"
|
||||
"tn.iso-8859-2.spl"
|
||||
"sw.latin1.sug"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
both-languages-and-spellfiles = {
|
||||
spellfiles = {
|
||||
enable = true;
|
||||
|
||||
languages = [
|
||||
"es"
|
||||
"de"
|
||||
"fr"
|
||||
];
|
||||
|
||||
spellfiles = [
|
||||
"en.utf-8.spl"
|
||||
"fr.utf-8.spl"
|
||||
"en.utf-8.sug"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue