Last 12 weeks · 5 commits
2 of 6 standards met
Repository: torvalds/HunspellColorize. Description: Wrapper around 'less' to colorize spelling mistakes using Hunspell Stars: 310, Forks: 12. Primary language: C. Languages: C (95.4%), Makefile (4.6%). License: GPL-2.0. Open PRs: 3, open issues: 0. Last activity: 1mo ago. Community health: 42%. Top contributors: torvalds.
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
This PR modifies the color scheme of HunspellColorize to make misspelled words appear in red in the terminal. Previously, the program used ANSI bold sequences (\033[1m / \033[22m) which some terminals do not display clearly. Changes made: Updated START and STOP macros: #define START "\033[31m" #define STOP "\033[0m" This improves visibility of misspelled words and provides a clearer visual cue for users reading text through the program. The Hunspell functionality remains unchanged, and the program still correctly identifies misspelled words using the same dictionaries. Tested on WSL/Ubuntu with English dictionary (en_US.aff/en_US.dic). No additional dependencies are required. Suggested Usage: echo "This is a simpel txt" less -R Now, misspelled words like "simpel" and "txt" appear in red.
hi replace write() to -> fwrite() just for fun like fuckwrite()