Skip to content

Commit

Permalink
Just call syntax-ppss-flush-cache instead of an explicit property.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zonuexe committed Sep 11, 2024
1 parent 4792988 commit 8c9d10e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ All notable changes of the PHP Mode 1.19.1 release series are documented in this
* `php-method-call``php-method-call-traditional`
* `php-static-method-call``php-static-method-call-traditional`
* Add variables for the `php-function-call`, `php-method-call`, and `php-static-method-call` faces, defaulting to the `-traditional` face.
* Changes how php-syntax-propertize-rules are applied for the first time. ([#785] and [#786])
* This change is expected to make heredoc and attribute coloring more stable and reduce flicker.

### Removed

Expand All @@ -39,6 +41,8 @@ All notable changes of the PHP Mode 1.19.1 release series are documented in this
[#777]: https://github.com/emacs-php/php-mode/pull/777
[#780]: https://github.com/emacs-php/php-mode/issues/780
[#782]: https://github.com/emacs-php/php-mode/issues/782
[#785]: https://github.com/emacs-php/php-mode/issues/785
[#786]: https://github.com/emacs-php/php-mode/pull/786
[@bricka]: https://github.com/bricka
[emacs-php/php-ts-mode#68]: https://github.com/emacs-php/php-ts-mode/pull/68
[PEAR Coding Standards]: https://pear.php.net/manual/en/standards.php
Expand Down
11 changes: 3 additions & 8 deletions lisp/php-mode.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;;; php-mode.el --- Major mode for editing PHP code -*- lexical-binding: t; -*-

;; Copyright (C) 2023 Friends of Emacs-PHP development
;; Copyright (C) 2024 Friends of Emacs-PHP development
;; Copyright (C) 1999, 2000, 2001, 2003, 2004 Turadg Aleahmad
;; 2008 Aaron S. Hawley
;; 2011, 2012, 2013, 2014, 2015, 2016, 2017 Eric James Michael Ritz
Expand All @@ -10,7 +10,7 @@
;; URL: https://github.com/emacs-php/php-mode
;; Keywords: languages php
;; Version: 1.25.1
;; Package-Requires: ((emacs "26.1"))
;; Package-Requires: ((emacs "27.1"))
;; License: GPL-3.0-or-later

(eval-and-compile
Expand Down Expand Up @@ -1242,12 +1242,7 @@ After setting the stylevars run hook `php-mode-STYLENAME-hook'."
:filter-args #'php-acm-backend-tabnine-candidate-expand-filter-args)

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

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

Expand Down

0 comments on commit 8c9d10e

Please sign in to comment.