From 20365dd02d583185d11b5b779d37247a6ea448b6 Mon Sep 17 00:00:00 2001 From: PJ Date: Tue, 14 Jul 2026 07:57:24 +0530 Subject: [PATCH] fix(proofing): stop flagging bare URLs as misspelled on macOS NSSpellChecker's implicit URL handling is unreliable for URLs alone on a line (a bookmark list), flagging the whole URL as one misspelling. Request the link checking type alongside spelling so the data detector claims URL ranges, then keep only spelling results. Real misspellings are unaffected. --- src-tauri/src/macspell.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/macspell.rs b/src-tauri/src/macspell.rs index 9c45a76..5182f02 100644 --- a/src-tauri/src/macspell.rs +++ b/src-tauri/src/macspell.rs @@ -33,7 +33,7 @@ pub fn check(text: &str, custom: &HashSet) -> Vec { checker.checkString_range_types_options_inSpellDocumentWithTag_orthography_wordCount( &ns, NSRange { location: 0, length: len }, - NSTextCheckingType::Spelling.bits(), + (NSTextCheckingType::Spelling | NSTextCheckingType::Link).bits(), None, 0, None, @@ -45,6 +45,9 @@ pub fn check(text: &str, custom: &HashSet) -> Vec { let chars: Vec = text.chars().collect(); let mut issues = Vec::new(); for result in results.iter() { + if result.resultType() != NSTextCheckingType::Spelling { + continue; + } let range = result.range(); let start = map[range.location.min(len)]; let end = map[(range.location + range.length).min(len)];