[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/evil-visualstar aafece5bc2 10/19: Commit 2015-05-08 19:00
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/evil-visualstar aafece5bc2 10/19: Commit 2015-05-08 19:00 |
Date: |
Thu, 6 Jan 2022 04:00:22 -0500 (EST) |
branch: elpa/evil-visualstar
commit aafece5bc213ca4c34a5c559d027b1eb381bea2e
Merge: 6e9f2349ad a18dfe7612
Author: Guido Van Hoecke <guivho@gmail.com>
Commit: Guido Van Hoecke <guivho@gmail.com>
Commit 2015-05-08 19:00
---
README.md | 6 ++++++
evil-visualstar.el | 16 ++++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
index 0c0fe6c97a..6cb854549e 100644
--- a/README.md
+++ b/README.md
@@ -15,4 +15,10 @@ Add `(global-evil-visualstar-mode)` to your configuration.
Make a visual selection with `v` or `V`, and then hit `*` to search that
selection forward, or `#` to search that selection backward.
+If the `evil-visualstar/persistent` option is not nil, visual-state will
+remain in effect, allowing for repeated `*` or #`.
+
+Note that you than have to exit visualstar-mode before hitting a
+direction key to avoid extending the selection.
+
[1]: http://melpa.org
diff --git a/evil-visualstar.el b/evil-visualstar.el
index df596b41d3..3aa9568f85 100644
--- a/evil-visualstar.el
+++ b/evil-visualstar.el
@@ -45,6 +45,11 @@
(require 'evil)
+(defvar evil-visualstar/persistent nil
+ "Set to t if * or # should keep visual-mode.
+This allows for repeated use of * in # but keeps vusual mode.
+You'd need to hit escape to leave visual-mode.")
+
(defun evil-visualstar/begin-search (beg end direction)
(when (evil-visual-state-p)
(evil-exit-visual-state)
@@ -59,11 +64,14 @@
(setq evil-ex-search-direction direction)
(setq evil-ex-search-pattern pattern)
(evil-ex-search-activate-highlight pattern)
+ ;; update search history unless this pattern equals the
+ ;; previous pattern
+ (unless (equal (car-safe evil-ex-search-history) selection)
+ (push selection evil-ex-search-history))
+ (evil-push-search-history selection (eq direction 'forward))
(setq found (evil-ex-search-next))))
- (when found
- (push-mark (- (+ end (point)) beg) t)
- (exchange-point-and-mark)
- (exchange-point-and-mark)))))
+ (when (and evil-visualstar/persistent found)
+ (push-mark (+ (point) (- end beg)) nil t)))))
(defun evil-visualstar/begin-search-forward (beg end)
"Search for the visual selection forwards."
- [nongnu] branch elpa/evil-visualstar created (now 06c053d8f7), ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar 253e8a594c 05/19: add commentary and version bump, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar b62323e92b 01/19: initial commit, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar 87a5bd8457 14/19: reworded comment and bumped version nr, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar aafece5bc2 10/19: Commit 2015-05-08 19:00,
ELPA Syncer <=
- [nongnu] elpa/evil-visualstar 687ae03c24 18/19: set jumps and don't repeat. resolves #7 and #9., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar 37de793029 16/19: Update Evil homepage URL, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar c8ca5799b5 13/19: Added missing quote, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar 1bb9ecd6f5 02/19: add readme., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar a18dfe7612 09/19: Merge pull request #5 from andyque/master, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar eb996eca00 17/19: Merge pull request #8 from syohex/update-evil-url, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar 06c053d8f7 19/19: should be defined as motions, not commands, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar 3f9bb0e6a1 11/19: Allow for option controlled persistent visualstar searches, ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar 4a93eb8790 04/19: correct package-requires syntax., ELPA Syncer, 2022/01/06
- [nongnu] elpa/evil-visualstar bd9e1b50c0 15/19: Merge pull request #4 from guivho/master, ELPA Syncer, 2022/01/06