[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master cf2c7bc 067/272: Modify "M-n" prediction when region is ac
From: |
Oleh Krehel |
Subject: |
[elpa] master cf2c7bc 067/272: Modify "M-n" prediction when region is active |
Date: |
Mon, 25 Apr 2016 10:13:17 +0000 |
branch: master
commit cf2c7bccd9ecc6e9288c65337525587371f15e82
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Modify "M-n" prediction when region is active
* ivy.el (ivy--reset-state): When the region is active and "M-n" is
called, insert the region contents into the minibuffer and deactivate
the region. The region deactivation is done for `swiper', to make it
easier to search for multiple words or a subword.
---
ivy.el | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/ivy.el b/ivy.el
index a5da026..f44dbdf 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1312,10 +1312,16 @@ This is useful for recursive `ivy-read'."
coll)))
0))))
(setq ivy-exit nil)
- (setq ivy--default (or
- (thing-at-point 'url)
- (thing-at-point 'symbol)
- ""))
+ (setq ivy--default
+ (if (region-active-p)
+ (prog1 (buffer-substring
+ (region-beginning)
+ (region-end))
+ (deactivate-mark))
+ (or
+ (thing-at-point 'url)
+ (thing-at-point 'symbol)
+ "")))
(setq ivy--prompt
(cond ((string-match "%.*d" prompt)
prompt)
- [elpa] master a9205fa 232/272: counsel.el (counsel-expression-history): New command, (continued)
- [elpa] master a9205fa 232/272: counsel.el (counsel-expression-history): New command, Oleh Krehel, 2016/04/25
- [elpa] master 88169a3 147/272: "C-x C-f" can un-ignore dotfiles with a leading dot input, Oleh Krehel, 2016/04/25
- [elpa] master b4b8d3e 106/272: counsel.el: Organize the file with outlines, Oleh Krehel, 2016/04/25
- [elpa] master 2905d17 153/272: doc/ivy.org: fix typos, Oleh Krehel, 2016/04/25
- [elpa] master 4c81973 181/272: counsel.el (counsel-locate-cmd-es): Fix regex, Oleh Krehel, 2016/04/25
- [elpa] master 591c8fe 167/272: ivy.el (ivy-expand-file-if-directory): Fix "/ssh:" regression, Oleh Krehel, 2016/04/25
- [elpa] master 6817381 068/272: Allow to compose static collections with `counsel--async-command', Oleh Krehel, 2016/04/25
- [elpa] master 212a4b8 098/272: Update the documentation and the manual, Oleh Krehel, 2016/04/25
- [elpa] master b400fcc 108/272: counsel.el: Shuffle functions and rename headings, Oleh Krehel, 2016/04/25
- [elpa] master 63688c6 267/272: Add a couple tests for ivy-read with alists, Oleh Krehel, 2016/04/25
- [elpa] master cf2c7bc 067/272: Modify "M-n" prediction when region is active,
Oleh Krehel <=
- [elpa] master b3f4db7 268/272: ivy.el (ivy--format-minibuffer-line): Update, Oleh Krehel, 2016/04/25
- [elpa] master e9e8ec0 112/272: counsel.el: Shuffle functions, Oleh Krehel, 2016/04/25
- [elpa] master d7561d2 203/272: counsel.el: Reduce counsel-grep char req to 2, Oleh Krehel, 2016/04/25
- [elpa] master 94a7b0f 140/272: * ivy.el (ivy-format-function-line): Remove `extra' parameter., Oleh Krehel, 2016/04/25
- [elpa] master bf7d95f 143/272: Move read-file-name to :display-transformer-fn, Oleh Krehel, 2016/04/25
- [elpa] master 80825a6 082/272: ivy.el: Fixup face docs, Oleh Krehel, 2016/04/25
- [elpa] master 44856a3 219/272: ivy.el (ivy-read): Revert abf880f, Oleh Krehel, 2016/04/25
- [elpa] master 0afb000 077/272: Fix default-directory for ivy-occur + counsel-git-grep, Oleh Krehel, 2016/04/25
- [elpa] master a6cd189 192/272: counsel.el (counsel-linux-apps-list): Skip spaces around =, Oleh Krehel, 2016/04/25
- [elpa] master e8f516e 182/272: counsel.el (counsel-ag): Add transformer, Oleh Krehel, 2016/04/25