Fix loss of documentation face in certain CC Mode doc comment situations
* lisp/progmodes/cc-fonts.el (c-font-lock-doc-comments): Take into account the possibility of font-lock-comment-delimiter-face. Test rigorously for "/**" (etc.) being itself inside a literal, rather than just depending on the face of the previous character.
This commit is contained in:
parent
8a73b7003e
commit
293720e930
1 changed files with 10 additions and 3 deletions
|
@ -2670,8 +2670,8 @@ need for `pike-font-lock-extra-types'.")
|
||||||
;; This function might do hidden buffer changes.
|
;; This function might do hidden buffer changes.
|
||||||
|
|
||||||
(let (comment-beg region-beg)
|
(let (comment-beg region-beg)
|
||||||
(if (eq (get-text-property (point) 'face)
|
(if (memq (get-text-property (point) 'face)
|
||||||
'font-lock-comment-face)
|
'(font-lock-comment-face font-lock-comment-delimiter-face))
|
||||||
;; Handle the case when the fontified region starts inside a
|
;; Handle the case when the fontified region starts inside a
|
||||||
;; comment.
|
;; comment.
|
||||||
(let ((start (c-literal-start)))
|
(let ((start (c-literal-start)))
|
||||||
|
@ -2691,8 +2691,15 @@ need for `pike-font-lock-extra-types'.")
|
||||||
(or (not (c-got-face-at comment-beg
|
(or (not (c-got-face-at comment-beg
|
||||||
c-literal-faces))
|
c-literal-faces))
|
||||||
(and (/= comment-beg (point-min))
|
(and (/= comment-beg (point-min))
|
||||||
|
;; Cheap check which is unreliable (the previous
|
||||||
|
;; character could be the end of a previous
|
||||||
|
;; comment).
|
||||||
(c-got-face-at (1- comment-beg)
|
(c-got-face-at (1- comment-beg)
|
||||||
c-literal-faces))))
|
c-literal-faces)
|
||||||
|
;; Expensive reliable check.
|
||||||
|
(save-excursion
|
||||||
|
(goto-char comment-beg)
|
||||||
|
(c-in-literal)))))
|
||||||
(setq comment-beg nil))
|
(setq comment-beg nil))
|
||||||
(setq region-beg comment-beg))
|
(setq region-beg comment-beg))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue