diff options
author | Alan Mackenzie <acm@muc.de> | 2022-05-17 11:26:05 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2022-05-17 11:26:05 +0000 |
commit | 3ef68c2d7a3d7c314cebc27b7cbeb3016211b53e (patch) | |
tree | 9424af6d391d664e9bfe24b4460d9356866b5f8e /lisp/progmodes/cc-engine.el | |
parent | 71249b774aa04b8cd46e4201c17470e59cd32dff (diff) | |
download | emacs-3ef68c2d7a3d7c314cebc27b7cbeb3016211b53e.tar.gz emacs-3ef68c2d7a3d7c314cebc27b7cbeb3016211b53e.tar.bz2 emacs-3ef68c2d7a3d7c314cebc27b7cbeb3016211b53e.zip |
CC Mode: Correct a rare error in the state cache
* lisp/progmodes/cc-engine.el (c-append-lower-brace-pair-to-state-cache): Do
not record a position in a macro as the starting position in
c-state-brace-pair-desert. Instead record the position at the beginning of
that macro.
Diffstat (limited to 'lisp/progmodes/cc-engine.el')
-rw-r--r-- | lisp/progmodes/cc-engine.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 2a9a7a8bf5e..8794a527f88 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -3886,7 +3886,10 @@ initializing CC Mode. Currently (2020-06) these are `js-mode' and (cons (if (and ce (< bra ce) (> ce here)) ; {..} straddling HERE? bra (point-min)) - (min here from))))))))) + (progn + (goto-char (min here from)) + (c-beginning-of-macro) + (point)))))))))) (defsubst c-state-push-any-brace-pair (bra+1 macro-start-or-here) ;; If BRA+1 is nil, do nothing. Otherwise, BRA+1 is the buffer position |