CC Mode: Fix the handling of two adjacent after-change-functionses.
The bug involved failing to set c-new-END correctly, which lead to an args-out-of-range error when after-change-functions was invoked twice without an intervening invocation of before-change-functions. * lisp/progmodes/cc-mode.el (c-after-change): Correct a coding error in the handling of c-just-done-before-change.
This commit is contained in:
parent
a1abf73c76
commit
a3c2d186eb
1 changed files with 6 additions and 7 deletions
|
@ -1992,17 +1992,16 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".")
|
||||||
|
|
||||||
;; Note: c-just-done-before-change is nil, t, or 'whole-buffer.
|
;; Note: c-just-done-before-change is nil, t, or 'whole-buffer.
|
||||||
(unless (c-called-from-text-property-change-p)
|
(unless (c-called-from-text-property-change-p)
|
||||||
|
(unless (eq c-just-done-before-change t)
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(widen)
|
(widen)
|
||||||
(unless c-just-done-before-change
|
(when (null c-just-done-before-change)
|
||||||
(c-before-change (point-min) (point-max)))
|
(c-before-change (point-min) (point-max)))
|
||||||
(unless (eq c-just-done-before-change t)
|
|
||||||
(setq beg (point-min)
|
(setq beg (point-min)
|
||||||
end (point-max)
|
end (point-max)
|
||||||
old-len (- end beg)
|
old-len (- end beg)
|
||||||
c-new-BEG (point-min)
|
c-new-BEG (point-min)
|
||||||
c-new-END (point-max)))
|
c-new-END (point-max)))))
|
||||||
(setq c-just-done-before-change nil)))
|
|
||||||
|
|
||||||
;; (c-new-BEG c-new-END) will be the region to fontify. It may become
|
;; (c-new-BEG c-new-END) will be the region to fontify. It may become
|
||||||
;; larger than (beg end).
|
;; larger than (beg end).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue