Spelling and Grammar doesn't underline typos

No issues here either. Perhaps try resetting Scrivener’s Preferences? That can fix a whole bunch of problems. Resetting Preferences / macOS: Troubleshooting / Knowledge Base - Literature and Latte Support

Definitely weird that it works okay in TextEdit and not Scrivener, because yes, Scrivener uses the spell-checking and grammar-checking functionality provided by macOS. Both applications should be displaying the same behaviour.

When was the last time you rebooted your system? macOS does strange things if it has been up too long. Whenever I notice weird behavior I find that a reboot almost always solves the problem.

Not quite true, since Scrivener has additional settings.

Yes, this does happen. I see it most days.

I think it has something to do with the change Keith made to remove the grammar-checking that Apple introduced into spell-checking. The change was made because Apple’s “suggestions” are wrong 90% of the time.

I do not know what triggers the problem, though I have suspicions.

I never use the grammar-checker.

ime, you can kickstart things by putting a space after the incorrect word. Also, if you move to another document and then return, any incorrect words will be marked – this is clearly easier than cut and pasting into another app.

Thank you everyone for your replies.

Some more info on your suggestions:

  1. The problem persists across system restarts. I’ve just restarted again to be sure, and I can confirm that rebooting the mac doesn’t affect the problem.
  2. Same for resetting the Scrivener preferences. I basically use the defaults, and resetting them doesn’t seem to have any effect.
  3. I don’t normally use the grammar checker (green underlines) either. I only really want to use the spell checker (red underline), and that’s my normal setup. In one of my previous messages I mentioned enabling the grammar checker only as a weird workaround.

@auxbuss yes, I’ve also experienced that sometimes placing the cursor next to an unflagged typo and adding a space is enough to kickstart the spell checking for that word. Alas, this seems to only work in some specific situations. From what I can see, this trick works for situations where I click to place the cursor in the middle of a sentence, then I introduce a typo, and then I click somewhere else without ever adding a space after the misspelled word. Going back to the typo and adding a space after it fixes the problem in that case. The same is true for the trick of switching back and forth between documents. Both only work when the type checker would normally recognize the typo, but simply hadn’t been triggered yet. This is also a bug IMO, but at least I can verify that the same happens in TextEdit, so I assume it’s just an annoying quirk of macOS’s spellchecker.

But even ignoring that, there are other typos that Scrivener just won’t detect for me. No matter how many times I switch between documents or add and remove spaces.

In this screenshot you can see some typos in Scrivener and TextEdit. I typed them word by word in both apps. Then tried to copy and paste them. Tried to add and remove spaces, etc. Always with the same result.

It was mentioned that Keith changed something in this area of the app. Is there a proper way to escalate this topic to get his attention, or to file a bug report?

I’m reading *** BUG REPORTING: Please read before posting! ***. Should I re-post this under bug?

Anyway, detailed reproduction steps:

  1. Create a new Scrivener project. I used the “General Non-Fiction” one.
  2. Open the Scrivener project. Ensure that under the Edit > Spelling and Grammar menu the Check Spelling While Typing option is enabled. In my test, I’ve left the other options disabled.
  3. Go to any empty document. I used the pre-created one under Manuscript > Chapter > Section.
  4. Type these exact words: How iss this even posible, preccious?
  5. Expectation: the words “iss”, “posible” and “preccious” will be underlined in red as typos.
  6. What actually happens: “preccious” is underlined in red, but the rest of the sentence is not.
  7. Repeat this in a new TextEdit document: the typos will be highlighted as expected.

I can confirm. It’s exactly as you say.

That’s on an M1 Mac Mini with Monterey 12.3.1 and Scrivener 3.2.3.

Thanks for the report. This is down to some workaround code Scrivener has in place. In macOS Mojave, Apple made a rather silly change in the spell-checker system, making it so that it would underline words such as “of”, “then” and “were” because it thought (erroneously) that you meant “off”, “than” or “where” (even when grammar-checking was turned off - these would be treated as misspellings). So I have some code that checks anything flagged as a misspelling by the OS in isolation, to make sure it is an actual misspelling. But bizarrely Apple’s shared spell checker is telling my code that “iss” and “posible” are legitimate spellings when taken in isolation!

The easiest fix is just to remove my workaround code if the original problem no longer exists - I’ve tested some text in TextEdit and it seems that words such as “of” and “were” are no longer mistakenly underlined. If anyone else can trigger the grammar-related red underlines in TextEdit or Pages, though, please let me know, as that will necessitate a more complicated workaround.

All the best,
Keith

3 Likes

Thank you for taking a look.

But bizarrely Apple’s shared spell checker is telling my code that “iss” and “posible” are legitimate spellings when taken in isolation!

The easiest fix is just to remove my workaround code if the original problem no longer exists - I’ve tested some text in TextEdit and it seems that words such as “of” and “were” are no longer mistakenly underlined.

I see. Thanks for the context. It’d be interesting to see if this is only a problem on Monterey, or if it’s also happening on previous macOS versions.

I’ve repeated my reproduction steps on macOS Catalina 10.15.7.
There, too, Scrivener fails to underline the typos but TextEdit seems to work fine.

I might have come across one of these cases, where the text system is incorrectly flagging a valid word as a typo.

That screenshot was taken using the same reproduction steps from my previous post, with different text.

TextEdit was configured to “Check Spelling While Typing”, but not grammar. Enabling the grammar check didn’t change the result.

Scrivener was configured to check both spelling and grammar. That’s just the workaround I described in a previous message in this thread, as usually the grammar check (green underline) will flag typos missed by Scrivener’s spelling checker. If I disable Scrivener’s grammar checker (therefore configuring it like TextEdit), then it doesn’t underline “there” at all.

If I mouse-hover the green-underlined “there” in Scrivener, the tooltip suggestion is the same at the one from TextEdit (screenshot).

I’ve verified this on both macOS 12.3.1 (Apple Silicon) and 10.15.7 (Intel).

Same here in TextEdit, macOS 12.3.1.

I don’t see a way to turn off grammar checking in Preferences.

See the links in the footnotes of my first post.

I’m surprised (and a little shocked) that TextEdit has preferences for that. But grammar checking is off:

Thanks for that, tompave. That shows the underlying bug that I’m trying to work around is still present on macOS, annoyingly.

And wow, this is a tricky one. It seems to be down to using “Automatic by language” as the spell-checking language. Try going to Edit > Spelling and Grammar > Show Spelling and Grammar, switch from “Automatic by Language” to “British English”, “American English” or whatever your own variant is, and then reload the document (e.g. by switching to another document in the binder and back again). All words should now be underlined correctly.

TextEdit’s behaviour is also a little weird and doesn’t underline everything correctly either. For instance, you suggested I type this sentence:

“How iss this even posible, preccious?”

With this sentence, “iss” and “posible” are underlined in TextEdit but not in Scrivener.

But try taking out the “even” in TextEdit, so that it becomes:

“How iss this posible, preccious?”

Now “iss” and “posible” aren’t underlined in TextEdit, either.

As I say, this is all down to “Automatic by Language” - with this setting (which is the default), macOS tries to guess which language it should spell-check against as you type - and it doesn’t always get it right, it seems. I believe that it recognises “iss” and “posible” as correctly spellings in some languages but finds their grammar odd in the longer sentence.

I can fix more errors by passing the current system language into my extra spell-check, but we’ll have to see if this causes more problems… I won’t be able to fix it so that it finds errors where TextEdit doesn’t, though.

All the best,
Keith

2 Likes

No it’s not. That’s a green underline signalling it’s querying a grammatical error.

:grin:

Mark

Am I the only one who’s constantly amazed at the powers that be thinking red and green are useful colors, when so many of us are red-green color blind(ish)?

1 Like

Hi Keith,

thank you for continuing to investigate this.

I can confirm that this works. By manually selecting an English language I can obtain consistent results in both TextEdit and Scrivener. :grinning: :white_check_mark:

On the topic of “there” being incorrectly flagged as a typo, with that silly suggestion to replace it with “they’re” or “their”. That’s still there in TextEdit (red underline).
If I configure Scrivener to only check spelling (and not grammar), Scrivener doesn’t underline it, and I guess that this is thanks to the fix/workaround in Scrivener’s code that you described in your previous post. Interestingly, if I do enable both spelling and grammar checks in Scrivener, then “there” will still be highlighted in green (like in the screenshot in my previous post). It appears that that’s flagged as a spelling mistake in TextEdit, and as a grammar mistake in Scrivener. Even ignoring the incorrectness of the OS suggestion, mixing up spelling and grammar suggestions sounds like a bug in macOS. Just to explore all options, I wonder if your workaround in Scrivener’s code is somehow affecting it.

Yes, this matches my observations. It looks like it needs a few correct words in one language in order to detect that language, and if the first few words are incorrect it fails to detect the language at all. This makes sense, in a way.

Yes, it’s a bit confusing.
If you check the screenshot, you’ll see that the two apps use both red and green underlines for the same word. That’s the whole point of the observation I was making.