Fixed issue where missing identifiers pushed trivia into the navigation bar

Fixes #1183.
It's a pretty nasty edge-case, but I don't think it buys us a lot. The behavior is wonky, but it's not like you'd get "right" behavior if you used `substr` anyhow.