]> git.eshelyaron.com Git - emacs.git/commitdiff
CC Mode. Fix slow scrolling by adding a search limit.
authorAlan Mackenzie <acm@muc.de>
Sat, 2 Nov 2019 13:03:50 +0000 (13:03 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 2 Nov 2019 13:03:50 +0000 (13:03 +0000)
This fixes bug #10149.

* lisp/progmodes/cc-fonts.el (c-font-lock-single-decl) Limit the search by
c-go-up-list-backwards to 500 non-literal characters.

lisp/progmodes/cc-fonts.el

index f58caf2f1ae0d6e3368eb8a89a4d44a50e10fd63..c27b70603edbb2f969e75f08b1e2ed9b8a3ce118 100644 (file)
@@ -1244,7 +1244,7 @@ casts and declarations are fontified.  Used on level 2 and higher."
   (if (save-excursion
        (and
         (car (cddr decl-or-cast))      ; maybe-expression flag.
-        (c-go-up-list-backward)
+        (c-go-up-list-backward nil (c-determine-limit 500))
         (eq (char-after) ?\()
         (progn (c-backward-syntactic-ws)
                (c-simple-skip-symbol-backward))