CC Mode: Get proper search limits in c-font-lock-cut-off-declarators

* lisp/progmodes/cc-fonts.el (c-font-lock-cut-off-declarators): Instead of
using a crude 2,000 characters back limit for backward searching, which is
erroneous when that point is in a literal, use the already calculated
c-determine-limit result.
This commit is contained in:
Alan Mackenzie 2021-04-25 17:40:16 +00:00
parent 6dabbddb5f
commit 142babb9bd

View file

@ -1669,9 +1669,7 @@ casts and declarations are fontified. Used on level 2 and higher."
c-recognize-knr-p) ; Strictly speaking, bogus, but it
; speeds up lisp.h tremendously.
(save-excursion
(when (not (c-back-over-member-initializers
(max (- (point) 2000) (point-min)))) ; c-determine-limit
; is too slow, here.
(when (not (c-back-over-member-initializers decl-search-lim))
(unless (or (eobp)
(looking-at "\\s(\\|\\s)"))
(forward-char))