Oh, I'm sorry, forgot to mention that Smart Typing and Re-Indent is off in Text Editing. Word characters is "_". When I turn Smart Typing off, the error disappears.
That is, when I turn it on, the bug disappears. So Smart Typing off = bug, Smart Typing on = no bug.
Frederik