Skip to content

Commit a0a14e7

Browse files
committed
Just call syntax-ppss-flush-cache instead of an explicit property.
This issue was first introduced in #316 as a workaround for a problem with Emacs 25 not coloring properly. This approach was disadvantageous for large files, and although performance was improved in #531, we often suffered from flickering.
1 parent 4792988 commit a0a14e7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ All notable changes of the PHP Mode 1.19.1 release series are documented in this
2424
* `php-method-call``php-method-call-traditional`
2525
* `php-static-method-call``php-static-method-call-traditional`
2626
* Add variables for the `php-function-call`, `php-method-call`, and `php-static-method-call` faces, defaulting to the `-traditional` face.
27+
* Changes how php-syntax-propertize-rules are applied for the first time. ([#785] and [#786])
28+
* This change is expected to make heredoc and attribute coloring more stable and reduce flicker.
2729

2830
### Removed
2931

@@ -39,6 +41,8 @@ All notable changes of the PHP Mode 1.19.1 release series are documented in this
3941
[#777]: https://github.com/emacs-php/php-mode/pull/777
4042
[#780]: https://github.com/emacs-php/php-mode/issues/780
4143
[#782]: https://github.com/emacs-php/php-mode/issues/782
44+
[#785]: https://github.com/emacs-php/php-mode/issues/785
45+
[#786]: https://github.com/emacs-php/php-mode/pull/786
4246
[@bricka]: https://github.com/bricka
4347
[emacs-php/php-ts-mode#68]: https://github.com/emacs-php/php-ts-mode/pull/68
4448
[PEAR Coding Standards]: https://pear.php.net/manual/en/standards.php

lisp/php-mode.el

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
;;; php-mode.el --- Major mode for editing PHP code -*- lexical-binding: t; -*-
22

3-
;; Copyright (C) 2023 Friends of Emacs-PHP development
3+
;; Copyright (C) 2024 Friends of Emacs-PHP development
44
;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad
55
;; 2008 Aaron S. Hawley
66
;; 2011, 2012, 2013, 2014, 2015, 2016, 2017 Eric James Michael Ritz
@@ -1242,12 +1242,7 @@ After setting the stylevars run hook `php-mode-STYLENAME-hook'."
12421242
:filter-args #'php-acm-backend-tabnine-candidate-expand-filter-args)
12431243

12441244
(when (eval-when-compile (>= emacs-major-version 25))
1245-
(with-silent-modifications
1246-
(save-excursion
1247-
(let* ((start (point-min))
1248-
(end (min (point-max)
1249-
(+ start syntax-propertize-chunk-size))))
1250-
(php-syntax-propertize-function start end))))))
1245+
(syntax-ppss-flush-cache (point-min))))
12511246

12521247
(declare-function semantic-create-imenu-index "semantic/imenu" (&optional stream))
12531248

0 commit comments

Comments
 (0)