[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-goggles ca75849806 065/225: Add support for evil-shif
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-goggles ca75849806 065/225: Add support for evil-shift-left and evil-shift-right |
Date: |
Wed, 12 Jan 2022 08:58:44 -0500 (EST) |
branch: elpa/evil-goggles
commit ca7584980660394988e2b0a53cd6a7598c95e3f7
Author: wouter bolsterlee <wouter@bolsterl.ee>
Commit: Evgeni Kolev <evgenysw@gmail.com>
Add support for evil-shift-left and evil-shift-right
Closes #5.
---
evil-goggles-faces.el | 5 +++++
evil-goggles.el | 21 +++++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/evil-goggles-faces.el b/evil-goggles-faces.el
index 8c1eb8ad87..4798967c47 100644
--- a/evil-goggles-faces.el
+++ b/evil-goggles-faces.el
@@ -34,6 +34,11 @@
"Face for paste action"
:group 'evil-goggles-faces)
+(defface evil-goggles-shift-face
+ '((t (:inherit region)))
+ "Face for paste action"
+ :group 'evil-goggles-faces)
+
;; non-core
(defface evil-goggles-surround-face
diff --git a/evil-goggles.el b/evil-goggles.el
index f14bf1a316..455ce1eded 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -243,6 +243,21 @@ The overlay region is derermined by evil's variable
`evil-last-paste'"
(beg-corrected (if is-beg-at-eol (1+ beg) beg) ))
(evil-goggles--show beg-corrected end 'evil-goggles-paste-face))))
+;; shift left & right
+
+(defcustom evil-goggles-enable-shift t
+ "If non-nil, enable shift left/right support"
+ :type 'boolean
+ :group 'evil-goggles)
+
+(defun evil-goggles--evil-shift-advice (orig-fun beg end &optional count
preserve-empty)
+ "Around-advice for function `evil-shift-left` and `evil-shift-right`.
+
+ORIG-FUN is the original function.
+BEG END &OPTIONAL COUNT PRESERVE-EMPTY are the arguments of the original
function."
+ (evil-goggles--with-goggles beg end 'evil-goggles-shift-face
+ (evil-goggles--funcall-preserve-interactive orig-fun beg end count
preserve-empty)))
+
;; ex global
(defun evil-goggles--evil-ex-global-advice (orig-fun beg end pattern command
&optional invert)
@@ -336,6 +351,10 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of
the original function
(advice-add 'evil-paste-after :around
'evil-goggles--evil-paste-after-advice)
(advice-add 'evil-paste-before :around
'evil-goggles--evil-paste-before-advice))
+ (when evil-goggles-enable-shift
+ (advice-add 'evil-shift-left :around 'evil-goggles--evil-shift-advice)
+ (advice-add 'evil-shift-right :around 'evil-goggles--evil-shift-advice))
+
;; make sure :global and :v don't show the goggles overlay
(advice-add 'evil-ex-global :around 'evil-goggles--evil-ex-global-advice)
@@ -358,6 +377,8 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of
the original function
(advice-remove 'evil-fill-and-move
'evil-goggles--evil-fill-and-move-advice)
(advice-remove 'evil-paste-after 'evil-goggles--evil-paste-after-advice)
(advice-remove 'evil-paste-before 'evil-goggles--evil-paste-before-advice)
+ (advice-remove 'evil-shift-left 'evil-goggles--evil-shift-advice)
+ (advice-remove 'evil-shift-right 'evil-goggles--evil-shift-advice)
(advice-remove 'evil-ex-global 'evil-goggles--evil-ex-global-advice)
- [nongnu] elpa/evil-goggles cb295a7f68 055/225: Don't show the overlay when evil's motion type is 'block, (continued)
- [nongnu] elpa/evil-goggles cb295a7f68 055/225: Don't show the overlay when evil's motion type is 'block, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles e74c8d6e29 060/225: Tweak Makefile, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 9d20051b25 009/225: Add evil-surround, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 170cc01885 017/225: Remove incorrect "generic advice", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4f04526b5d 026/225: Add evil-paste-before and evil-paste-after, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 168f07ecd6 033/225: Simplify add/remove of advices, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 4388040c0c 034/225: Check early for non-nil `evil-last-paste', ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles bebcecadef 053/225: .gitignore *.elc, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 9dae90cef6 061/225: Define faces in a separate file, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles e95fb4d6b9 058/225: Partially revert README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles ca75849806 065/225: Add support for evil-shift-left and evil-shift-right,
ELPA Syncer <=
- [nongnu] elpa/evil-goggles c2c9aedaff 075/225: No lonely parentheses in README, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles c1df77a548 079/225: Add "checkdoc" make target, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 2117f62dff 087/225: Alternative implementation for undo/redo, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 6ab09a09c7 093/225: Don't use `caadr`, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles d274e1572c 096/225: Make Travis run all of evil's tests under (evil-goggles-mode), ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 513ba2eb3e 094/225: Polish u/redo implementation to handle u/redo after "o"/"O", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles cbcad38344 021/225: Cleanup code, add some doc strings, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 3dc8417950 040/225: Add evil-fill-and-move "=", ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles bc4a117f6c 059/225: Rename evil-goggles-face to evil-goggles-default-face, ELPA Syncer, 2022/01/12
- [nongnu] elpa/evil-goggles 02a8072435 011/225: Use evil faces for delete and yank, ELPA Syncer, 2022/01/12