slop-review

Spelling

A remark can be checked against the dictionaries the machine already has. Nothing is shipped or downloaded: this goes through enchant, which is the broker the rest of the desktop's spell checking already goes through, so what a remark is measured against is what you installed — your languages, and the words you have added to them yourself.

spell_check = ["en_US", "ru_RU"]

Empty is off, which is also what a machine with no enchant on it has — opened by name at run time, so a missing one means no check rather than a window that will not start. A tag nothing has a dictionary for is named on stderr along with the ones that do, rather than quietly checking nothing.

The nix package brings an enchant of its own, because NixOS has nowhere a library opened by name is found. The dictionaries are still yours: install them, hunspellDicts.ru_RU and the like, into your profile so they are on XDG_DATA_DIRS. An enchant already on your LD_LIBRARY_PATH wins over the one the package brings.

When no enchant is found by name, the lib beside each share on XDG_DATA_DIRS is looked in too. That is where a profile keeps its libraries, so an enchant installed into the same profile as the dictionaries — pkgs.enchant in home.packages, say — is found from a window started from the desktop as well as from a shell.

The enchant the package brings carries every spelling backend nixpkgs builds it with, about 120 MiB. To leave it out, switch it off in the module you install with:

programs.slop-review = {
  enable = true;
  enchant.enable = false;
};

The switch is on the wrapper rather than the build, so this still comes from the binary cache rather than being compiled, and an enchant in your profile is still found the way described above. It applies to a package you set yourself as well, and a package installed without the modules takes it as .override { withEnchant = false; }.

The settings window offers this one as a list to pick from rather than a name to type: what it can pick is what enchant reported installed on this machine, which is the only setting whose choices come off the machine rather than out of the program. A tag already written down that this machine has not got is listed anyway and said to be missing, because a file a team shares will name dictionaries not everyone has installed.

A remark about code is mostly not prose, and a check that underlined usize, to_string and main.rs is one nobody leaves switched on. So identifiers, paths, addresses, anything in backticks and anything inside a fenced block are passed over before a dictionary is asked about any of it; what is left is the sentences. A misspelling is tinted in the theme's red where it stands rather than underlined with a wavy line: iced's text box takes a highlighter that hands back a colour and a face, and there is nowhere for the line to come from until it grows one.

Put the caret on a tinted word — click it, or move onto it with the arrow keys — and what could go in its place is offered under the box, best first, each one a button that puts it there. Stop typing with the caret on a tinted word and it is offered for too, a moment later: working out what to offer is a search over the dictionary's whole word list, too slow to run on every keystroke, and the caret sits at the end of a half-typed word after each one. The offer goes away as soon as the box is typed in again.