branch: externals/phps-mode commit e7e23cce607acf98897726bb01e56e0092b20b28 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Fix for incremental syntax coloring issue --- TODO.md | 2 -- phps-mode-lex-analyzer.el | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TODO.md b/TODO.md index 0528c33773..7929711626 100644 --- a/TODO.md +++ b/TODO.md @@ -1,7 +1,5 @@ # TODO -* Perform buffer changes in the middle of a token will make cache reuse lex over point and this will distort the lex at point but not at points further down - ## Indentation 'language' => diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el index 7fcf4c20a4..e774502300 100644 --- a/phps-mode-lex-analyzer.el +++ b/phps-mode-lex-analyzer.el @@ -475,8 +475,10 @@ ALLOW-CACHE-READ and ALLOW-CACHE-WRITE." (let ((start (car (cdr token))) (end (cdr (cdr token)))) (when (and - (>= start incremental-start-new-buffer) - (<= end buffer-point-max)) + (<= end buffer-point-max) + (or + (>= start incremental-start-new-buffer) + (>= end incremental-start-new-buffer))) ;; Apply syntax color on token (let ((token-syntax-color (phps-mode-lex-analyzer--get-token-syntax-color token)))