Skip to content

Find the hunspell aff and dic files in XDG_DATA_DIRS#6

Open
p1k0chu wants to merge 1 commit intotorvalds:mainfrom
p1k0chu:xdg-dirs
Open

Find the hunspell aff and dic files in XDG_DATA_DIRS#6
p1k0chu wants to merge 1 commit intotorvalds:mainfrom
p1k0chu:xdg-dirs

Conversation

@p1k0chu
Copy link

@p1k0chu p1k0chu commented Jan 20, 2026

on a linux distro like nixos /usr/share doesn't exist but XDG_DATA_DIRS is set to the location of hunspell files (if they are installed ofc)

so we look for each directory in XDG_DATA_DIRS,
check if theres an en_us dictionary in it,
if not, fall back to previous /usr/share/... path

tested this on my nixos and on an ubuntu docker image

on a linux distro like nixos /usr/share doesn't exist
but XDG_DATA_DIRS is set to the location of hunspell files
(if they are installed ofc)

so we look for each directory in XDG_DATA_DIRS,
check if theres an en_us dictionary in it,
if not, fall back to previous /usr/share/... path

Signed-off-by: p1k0chu <p1k0chu.vim@gmail.com>
Copy link

@benny01000010 benny01000010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants