[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/symbol-overlay 4a70f6d999 075/152: When renaming, don't ad
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/symbol-overlay 4a70f6d999 075/152: When renaming, don't add coloured highlight if there wasn't previously one |
Date: |
Thu, 7 Jul 2022 12:04:16 -0400 (EDT) |
branch: elpa/symbol-overlay
commit 4a70f6d999450b8ae5a83af71ef2f6b82428a9ed
Author: Steve Purcell <steve@sanityinc.com>
Commit: GitHub <noreply@github.com>
When renaming, don't add coloured highlight if there wasn't previously one
I don't use coloured symbol overlays, but I use lazy highlighting and
`symbol-overlay-rename`. After renaming, that function adds a coloured overlay,
where none previously existed. With this commit, a new coloured overlay is
added only if there was one prior to renaming, which reduces the friction of
this function in my use case.
---
symbol-overlay.el | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/symbol-overlay.el b/symbol-overlay.el
index e986e71609..b4b759ba82 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -520,14 +520,16 @@ DIR must be 1 or -1."
(substring symbol 3 -3))
new (symbol-overlay-get-symbol txt))
(unless (string= new symbol)
- (symbol-overlay-maybe-remove (symbol-overlay-assoc new))
- (save-excursion
- (save-restriction
- (symbol-overlay-narrow scope)
- (goto-char (point-min))
- (let ((inhibit-modification-hooks t))
- (while (re-search-forward symbol nil t) (replace-match txt t)))))
- (setq keyword (symbol-overlay-put-all new scope keyword)))
+ (let ((prev-overlay (symbol-overlay-assoc new)))
+ (symbol-overlay-maybe-remove prev-overlay)
+ (save-excursion
+ (save-restriction
+ (symbol-overlay-narrow scope)
+ (goto-char (point-min))
+ (let ((inhibit-modification-hooks t))
+ (while (re-search-forward symbol nil t) (replace-match txt
t)))))
+ (when prev-overlay
+ (setq keyword (symbol-overlay-put-all new scope keyword)))))
(when (string= new (symbol-overlay-get-symbol nil t))
(symbol-overlay-maybe-count keyword)))))
- [nongnu] elpa/symbol-overlay 18d2f4ea65 148/152: Enable lexical-binding use hashed symbols for better compiler warnings, (continued)
- [nongnu] elpa/symbol-overlay 18d2f4ea65 148/152: Enable lexical-binding use hashed symbols for better compiler warnings, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 5290fd464f 150/152: Only use one timer for all buffers, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay a71d6d1f31 018/152: add auto-refresh, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 5b00bb2952 032/152: (v2.6) new feature: scope, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 8cdd9ab096 038/152: add documentation of new feature, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 59053522a8 044/152: fix bugs, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 5c6c57a529 054/152: fix message, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay f5392fb932 051/152: fix case-error in rename, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 01aff461c2 055/152: better query-replace and rename, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 3eb0864b65 071/152: Merge pull request #9 from purcell/patch-1, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 4a70f6d999 075/152: When renaming, don't add coloured highlight if there wasn't previously one,
ELPA Syncer <=
- [nongnu] elpa/symbol-overlay 305ef1d283 080/152: fix bug caused by last merge, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay f3046beeae 085/152: better not to use box as faces, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 39a2ad8ba5 104/152: Add "h" binding for help in symbol-overlay-map, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay dd7f126217 112/152: update readme, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 11f91ce5b6 110/152: Merge pull request #34 from tarsiiformes/preserve-highlighting, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 66eaaefb8c 134/152: Check liveness of buffer in timer callback, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay e40a7c407f 121/152: Use non-regex symbols internally, and only convert to regexp when needed, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 50a2bd6480 125/152: Merge pull request #47 from langston-barrett/master, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 4a2d6b0e0a 010/152: edit the summary, ELPA Syncer, 2022/07/07
- [nongnu] elpa/symbol-overlay 068c6c801a 053/152: narrow to paragraph when scope is not found, ELPA Syncer, 2022/07/07