[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles e65aa39749 083/225: Add support for block pas
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles e65aa39749 083/225: Add support for block paste |
Date: |
Wed, 12 Jan 2022 08:58:53 -0500 (EST) |
branch: elpa/evil-goggles
commit e65aa39749f7751e49d1e4631c72cc036531a678
Author: Evgeni Kolev <evgenysw@gmail.com>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Add support for block paste
---
evil-goggles.el | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/evil-goggles.el b/evil-goggles.el
index a4a930b9e7..560a8e60aa 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -60,6 +60,18 @@
(sit-for evil-goggles-duration)
(delete-overlay ov))))
+(defun evil-goggles--show-block (beg end face)
+ "Show overlay in blcok from BEG to END with FACE."
+ (let ((ovs))
+ (unwind-protect
+ (progn
+ ;; create multiple overlays, one for each line in the block
+ (evil-apply-on-block (lambda (line-beg line-end)
+ (add-to-list 'ovs (evil-goggles--make-overlay
line-beg line-end 'face face)))
+ beg end nil)
+ (sit-for evil-goggles-duration))
+ (mapcar 'delete-overlay ovs))))
+
(defun evil-goggles--make-overlay (beg end &rest properties)
"Make overlay in region from BEG to END with PROPERTIES."
(let ((ov (make-overlay beg end)))
@@ -252,13 +264,15 @@ COUNT REGISTER YANK-HANDLER are the arguments of the
original function."
The overlay region is derermined by evil's marks [ and ]
Argument REGISTER is the evil register.
Argument YANK-HANDLER is the yank hanler."
- (unless (or evil-goggles--on (evil-goggles--evil-paste-block-p register
yank-handler))
- ;; TODO show the goggles overlay when the pasted text is a block
+ (unless evil-goggles--on
(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) ))
- (evil-goggles--show beg-corrected end 'evil-goggles-paste-face))))
+ (beg-corrected (if is-beg-at-eol (1+ beg) beg))
+ (show-fn (if (evil-goggles--evil-paste-block-p register
yank-handler)
+ 'evil-goggles--show-block
+ 'evil-goggles--show)))
+ (funcall show-fn beg-corrected end 'evil-goggles-paste-face))))
(defun evil-goggles--evil-paste-block-p (register yank-handler)
"Return t if the paste was a vertical block.
- [nongnu] elpa/evil-goggles fa7dca4f82 016/225: Cleanup delete advice, (continued)
- [nongnu] elpa/evil-goggles fa7dca4f82 016/225: Cleanup delete advice, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 0afe8cf165 020/225: Fix no-whitespace check, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 55ecf5c2c4 045/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 450e153a2d 046/225: Depend on emacs 25 for `funcall-interactively', ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 99d3416598 049/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 9927490983 042/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 08da44cf83 057/225: Add the evil-goggles face, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ef1cad8f3a 064/225: Re-add paste and fill-and-move, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 179c3002f2 071/225: Update README.md, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 904fc39728 072/225: Add doc for evil-goggles-use-diff-faces, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles e65aa39749 083/225: Add support for block paste,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles 685e3714a5 090/225: Handle a specific u/redo case when the list has 2 connecting items, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 1e9ebe5e4c 095/225: Extend support for u/redo after some text is changed., ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 221a5ed8ea 098/225: Add support for Emacs 24 by not relying on funcall-interactively, ELPA Syncer, 2022/01/12
- [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