Suppose I have a short string in C++ and I accidentally delete the double quote that ends it. What Emacs does is highlight the rest of the code as a single very long string, which messes up all the formatting until I put the double quote back in. It also feels a little slow when it's refontifying the whole buffer.
I skimmed through cc-mode.el
, but I couldn't find the setting for it or the place where string fontification happens.
Is there a way to tell c++-mode (or font-lock maybe?) that my strings never contain newlines and it should never look beyond the first newline if it finds an unterminated string literal?