[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles 5bd77428e3 142/225: Cleanup internal API for
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles 5bd77428e3 142/225: Cleanup internal API for showing a vertical hint once |
Date: |
Wed, 12 Jan 2022 08:59:03 -0500 (EST) |
branch: elpa/evil-goggles
commit 5bd77428e3f6776b1f6f42b63b3dc7d64af5860d
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Cleanup internal API for showing a vertical hint once
---
evil-goggles.el | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index 35603f9d63..06d245f65f 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -111,6 +111,9 @@ example, when the user executes `evil-delete', the overlay
should be
displayed, but when `evil-delete' calls internally `evil-yank', the
overlay must not be re-displayed.")
+(defvar evil-goggles--force-block nil
+ "When non-nil, force the hint about to be shown to be a block.")
+
(defun evil-goggles--show-p (beg end)
"Return t if the overlay should be displayed in region BEG to END."
(and (not evil-inhibit-operator-value)
@@ -185,7 +188,7 @@ the hint is \"blocking\" because BODY won't run until the
hint has
disappeared."
(declare (indent 4) (debug t))
`(evil-goggles--if-hint-on ,beg ,end (progn ,@body)
- (if (eq evil-this-type 'block)
+ (if (or (eq evil-this-type 'block) evil-goggles--force-block)
(evil-goggles--show-block-overlay ,beg ,end ,face (or ,dur
evil-goggles-duration))
(evil-goggles--show-overlay ,beg ,end ,face (or ,dur
evil-goggles-duration)))
,@body))
@@ -204,10 +207,12 @@ will be adjusted if BODY modifies the text in it."
(sit-for ,dur))
(delete-overlay ov))))
-(defun evil-goggles--show-hint (beg end face dur)
- "Show hint from BEG to END with face FACE for DUR sec."
- ;; call evil-goggles--with-async-hint with no BODY
- (evil-goggles--with-async-hint beg end face dur))
+(defun evil-goggles--show-hint (beg end face dur &optional force-block)
+ "Show hint from BEG to END with face FACE for DUR sec.
+
+The hint will be a vertical block if FORCE-BLOCK is non-nil."
+ (let ((evil-goggles--force-block force-block))
+ (evil-goggles--with-blocking-hint beg end face dur)))
(defun evil-goggles--show-block-overlay (beg end face dur)
"Show overlay from BEG to END with face FACE for DUR seconds.
@@ -543,11 +548,9 @@ Argument YANK-HANDLER is the yank hanler."
(let* ((beg (save-excursion (evil-goto-mark ?\[) (point)))
(end (save-excursion (evil-goto-mark ?\]) (point)))
(is-beg-at-eol (save-excursion (goto-char beg) (eolp)))
- (beg-corrected (if is-beg-at-eol (1+ beg) beg)))
- (if (evil-goggles--evil-paste-block-p register yank-handler)
- ;; TODO evil-goggles--show-block-overlay doesn't check if the --on
var is t/nil
- (evil-goggles--show-block-overlay beg-corrected end
'evil-goggles-paste-face evil-goggles-paste-duration)
- (evil-goggles--show-hint beg-corrected end 'evil-goggles-paste-face
evil-goggles-paste-duration)))))
+ (beg-corrected (if is-beg-at-eol (1+ beg) beg))
+ (use-block-hint (evil-goggles--evil-paste-block-p register
yank-handler)))
+ (evil-goggles--show-hint beg-corrected end 'evil-goggles-paste-face
evil-goggles-paste-duration use-block-hint))))
(defun evil-goggles--evil-paste-block-p (register yank-handler)
"Return t if the paste was a vertical block.
- [nongnu] elpa/evil-goggles aaa93841f9 103/225: Update evil-goggles.el, (continued)
- [nongnu] elpa/evil-goggles aaa93841f9 103/225: Update evil-goggles.el, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles f79c03ba62 108/225: Experimental: add support for pulsing, new option`evil-goggles-pulse', ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 9fa3d448ca 112/225: Update "Recent Significant Changes" section in README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 219d93e125 118/225: Add support for displaying the hint after the operation, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles c5c49d7965 127/225: Use different duration for before/after hints, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 5c313522cf 128/225: Don't call deprecated functions, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 03cb67fc4c 125/225: Remove duplicated line, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 70ed667698 131/225: Fix compile warnings, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ea0102bcf5 133/225: Use "post" hint when commenting, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3f6dd85657 151/225: Update README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 5bd77428e3 142/225: Cleanup internal API for showing a vertical hint once,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles c515477fd4 160/225: Clarify docs for evil-goggles-async-duration and evil-goggles-blocking-duration, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 674a1be5aa 188/225: Merge branch 'hint-only-when-command-is-interactive'. Close #18, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 946598059f 204/225: Fix compilation warnings, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles b756edf31e 182/225: Show hint on u/redo after inserting text with "O", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 6d2ce52faa 200/225: Add hint for `m`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 8aa26e9671 205/225: CI: run package-lint, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 77a8bb1785 207/225: Update README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 87722a5b46 210/225: Add hint for `D`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d7876e6566 218/225: Drop unnecessary helper macro, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 636b263361 215/225: Make async overlay cleanup more robust, without using pre-command-hook, ELPA Syncer, 2022/01/12