[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 4d4465fd59 168/225: Improve logic deciding wh
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 4d4465fd59 168/225: Improve logic deciding whether to pulse or not |
Date: |
Wed, 12 Jan 2022 08:59:05 -0500 (EST) |
branch: elpa/evil-goggles
commit 4d4465fd591d2952ca613a9162ce14d2c535bb11
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Improve logic deciding whether to pulse or not
---
evil-goggles.el | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index 8cb5cae8d9..5688ff797a 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -181,11 +181,21 @@ non-nil, else for `evil-goggles-duration' seconds."
DUR is used only when pulsing.
The overlay is pulsed if variable `evil-goggles-pulse' is t."
- ;; pulsing requires a face with background, so don't pulse if the
- ;; face defines no background
- (if (and evil-goggles-pulse (face-background face nil t))
- (evil-goggles--pulse-overlay ov (evil-goggles--face-background face) dur)
- (overlay-put ov 'face face)))
+ (let ((fg (face-foreground face nil t))
+ (bg (face-background face nil t)))
+ (cond
+ ;; pulse enabled and the face has a bg - pulse with the given face's bg
+ ((and evil-goggles-pulse bg)
+ (evil-goggles--pulse-overlay ov bg dur))
+ ;; pulse enabled and the face has no bg or fg - pulse with the default
face's bg
+ ((and evil-goggles-pulse (null bg) (null fg))
+ (evil-goggles--pulse-overlay ov (face-background
'evil-goggles-default-face nil t) dur))
+ ;; pulse disabled or face has fg only - show the hint with given face
+ ((and (null bg) (null fg))
+ (overlay-put ov 'face 'evil-goggles-default-face))
+ ;; else show the hint with the given face
+ (t
+ (overlay-put ov 'face face)))))
(defmacro evil-goggles--if-hint-on (beg end body1 &rest body2)
"Run one block of code if hint is visible, run the other if not.
- [nongnu] elpa/evil-goggles 92d614e731 119/225: Display the hint after indenting and "replacing with register" #7, (continued)
- [nongnu] elpa/evil-goggles 92d614e731 119/225: Display the hint after indenting and "replacing with register" #7, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles c7e3f6ff17 116/225: Remove incorrectly commited snippet, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4777cd7849 121/225: Show hint after indenting, not before #7, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 287491d0a0 124/225: Add WIP support for per-action durations, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f5e98355f4 135/225: Use one function for `evil-paste-after` and `evil-paste-before` advices, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d705bef9d4 134/225: Fix CI failing, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f6519214b8 149/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 5db6848df8 154/225: Undo adds should show a blocking hint, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 440324a1ed 161/225: Silence compilation warning for unused lexical variable, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3dce5937ac 166/225: Pulsing is no longer experimental, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4d4465fd59 168/225: Improve logic deciding whether to pulse or not,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles 3b874c7630 178/225: Set mark advice: show hint on whitespace-only lines, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ca18c944ed 179/225: Show hint on start/stop record macro, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 943382b367 194/225: Add hints for surround, commentary, nerd commenter, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 04d66ddc20 201/225: Add hint for `q`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles b896ca797c 211/225: Add support for evil-org. Close #21, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 2186289a01 213/225: evil-goggles--show-p: no need to check evil-inhibit-operator-value, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 42456816de 015/225: Use macros to preserve "interactivity", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles dd76fd3d28 019/225: Make sure the overlay is cleaned-up, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 1014993453 028/225: Add custom variable evil-goggles-blacklist to allow disabling individual functions, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f29820fe98 029/225: Detect only `evil-inhibit-operator-value` into account, ELPA Syncer, 2022/01/12