[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mmm-mode af4c12e 11/12: Don't refontify outside of spec
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/mmm-mode af4c12e 11/12: Don't refontify outside of specified bounds |
Date: |
Sun, 24 May 2020 20:16:10 -0400 (EDT) |
branch: externals/mmm-mode
commit af4c12eecd5eea9d2ed9f1f3555cb1ea55c1ada5
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Don't refontify outside of specified bounds
Deals with certain blinking in the case of nested subregions
#102
---
mmm-region.el | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/mmm-region.el b/mmm-region.el
index a8238eb..35c5d6a 100644
--- a/mmm-region.el
+++ b/mmm-region.el
@@ -793,7 +793,8 @@ of the REGIONS covers START to STOP."
mmm-current-submode mmm-current-overlay)
(mapc (lambda (elt)
(when (get (car elt) 'mmm-font-lock-mode)
- (mmm-fontify-region-list (car elt) (cdr elt))))
+ (mmm-fontify-region-list (car elt) (cdr elt)
+ start stop)))
(mmm-regions-alist start stop)))
;; `post-command-hook' contains `mmm-update-submode-region',
;; but jit-lock runs later, so we need to restore local vars now.
@@ -804,8 +805,9 @@ of the REGIONS covers START to STOP."
(defvar syntax-ppss-cache)
(defvar syntax-ppss-last)
-(defun mmm-fontify-region-list (mode regions)
- "Fontify REGIONS, each like (BEG END), in mode MODE."
+(defun mmm-fontify-region-list (mode regions start stop)
+ "Fontify REGIONS, each like (BEG END), in mode MODE.
+START and STOP are the boundaries of the area to fontify."
(save-excursion
(let ((func (get mode 'mmm-fontify-region-function))
font-lock-extend-region-functions)
@@ -829,7 +831,10 @@ of the REGIONS covers START to STOP."
;; respects submode boundaries.
(when (and ovl (not (memq mode mmm-c-derived-modes)))
(narrow-to-region beg end))
- (funcall func beg end nil)))
+ (funcall func
+ (max beg start)
+ (min end stop)
+ nil)))
;; Catch changes in font-lock cache.
(mmm-save-changed-local-variables
mmm-current-submode mmm-current-overlay)))
- [elpa] externals/mmm-mode 1b4ada3 04/12: mmm-c-derived-modes: Include js-mode and typescript-mode, (continued)
- [elpa] externals/mmm-mode 1b4ada3 04/12: mmm-c-derived-modes: Include js-mode and typescript-mode, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 2ab099a 01/12: Save and restore sytax-ppss-table as buffer-local var, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 1529d8e 02/12: Remove some trailing whitespace, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 783572f 03/12: Actually save it per-buffer, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 27eb95e 05/12: add documentencoding, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode e4db97a 07/12: mmm-sort-overlays: Use copy-sequence, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 94089d7 08/12: mmm-save-all: Support edebug, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 552d740 09/12: mmm-sort-overlays: Sort by nesting when no priorities, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 9fecfd4 10/12: Unbreak some of the tests, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode 981795b 06/12: Merge pull request #101 from typester/fix/make-with-texinfo6.7, Dmitry Gutov, 2020/05/24
- [elpa] externals/mmm-mode af4c12e 11/12: Don't refontify outside of specified bounds,
Dmitry Gutov <=
- [elpa] externals/mmm-mode 8aed53f 12/12: Release 0.5.8, Dmitry Gutov, 2020/05/24