[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 24c95b7 018/399: ivy.el (ivy-thing-at-point): Extend
From: |
Oleh Krehel |
Subject: |
[elpa] master 24c95b7 018/399: ivy.el (ivy-thing-at-point): Extend |
Date: |
Sat, 20 Jul 2019 14:56:39 -0400 (EDT) |
branch: master
commit 24c95b7361ac834bb6bb501eb8c3c7a070d487c1
Author: Nathan Moreau <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-thing-at-point): Extend
Fixes #1871
---
ivy.el | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/ivy.el b/ivy.el
index 064e561..184acf4 100644
--- a/ivy.el
+++ b/ivy.el
@@ -474,20 +474,25 @@ the restoring themselves.")
"Return a string that corresponds to the current thing at point."
(substring-no-properties
(cond
- ((thing-at-point 'url))
- ((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
- (let ((inhibit-message t))
- (ignore-errors
- (ffap-file-at-point)))))
- ((let ((s (thing-at-point 'symbol)))
- (and (stringp s)
- (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
- (match-string 1 s)
- s))))
- ((looking-at "(+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
- (match-string-no-properties 1))
- (t
- ""))))
+ ((use-region-p)
+ (let* ((beg (region-beginning))
+ (end (region-end))
+ (eol (save-excursion (goto-char beg) (line-end-position))))
+ (buffer-substring-no-properties beg (min end eol))))
+ ((thing-at-point 'url))
+ ((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
+ (let ((inhibit-message t))
+ (ignore-errors
+ (ffap-file-at-point)))))
+ ((let ((s (thing-at-point 'symbol)))
+ (and (stringp s)
+ (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
+ (match-string 1 s)
+ s))))
+ ((looking-at "(+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
+ (match-string-no-properties 1))
+ (t
+ ""))))
(defvar ivy-history nil
"History list of candidates entered in the minibuffer.
- [elpa] master c2eb4b5 009/399: ivy.el (ivy--kill-buffer-action): Integrate with ivy-switch-buffer-kill, (continued)
- [elpa] master c2eb4b5 009/399: ivy.el (ivy--kill-buffer-action): Integrate with ivy-switch-buffer-kill, Oleh Krehel, 2019/07/20
- [elpa] master f631d75 013/399: swiper.el (swiper-font-lock-exclude): Add xref--xref-buffer-mode, Oleh Krehel, 2019/07/20
- [elpa] master 3773c26 015/399: swiper.el (swiper--current-window-start): Add docstring, Oleh Krehel, 2019/07/20
- [elpa] master da85d1e 016/399: ivy.el: Require TRAMP earlier, Oleh Krehel, 2019/07/20
- [elpa] master 98b70a7 011/399: swiper.el (swiper--update-input-ivy): Don't recenter when non-graphical, Oleh Krehel, 2019/07/20
- [elpa] master e86cf2e 010/399: counsel.el (counsel-require-program): Change arg meaning, Oleh Krehel, 2019/07/20
- [elpa] master 007d672 012/399: swiper.el (swiper--update-input-ivy): Use display-graphic-p, Oleh Krehel, 2019/07/20
- [elpa] master 686cf5a 014/399: swiper.el (swiper--action): Fix for emacs -nw, Oleh Krehel, 2019/07/20
- [elpa] master b1ac725 017/399: ivy.el (ivy-initial-inputs-alist): Now a defcustom., Oleh Krehel, 2019/07/20
- [elpa] master 43f169b 019/399: swiper.el (swiper-font-lock-ensure-p): Try checking for non prog-mode, Oleh Krehel, 2019/07/20
- [elpa] master 24c95b7 018/399: ivy.el (ivy-thing-at-point): Extend,
Oleh Krehel <=
- [elpa] master 51446e5 021/399: swiper.el (swiper--avy-candidates): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 050b4a4 023/399: counsel.el (counsel-grep-history): Add, Oleh Krehel, 2019/07/20
- [elpa] master 88b3548 020/399: swiper.el (swiper--avy-goto): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 28e88ab 025/399: Allow to mark/unmark candidates with "m", "u", "DEL", "t", Oleh Krehel, 2019/07/20
- [elpa] master 48c7087 028/399: ivy.el (ivy-reverse-i-search): Don't bind ivy-recursive-restore to nil, Oleh Krehel, 2019/07/20
- [elpa] master 6853290 031/399: counsel-switch-buffer: Add support for ivy-use-virtual-buffers., Oleh Krehel, 2019/07/20
- [elpa] master b0c0371 038/399: Enable counsel-read-env to properly handle directories, Oleh Krehel, 2019/07/20
- [elpa] master 47c8c3d 034/399: counsel.el (counsel-read-env): Simplify, Oleh Krehel, 2019/07/20
- [elpa] master 4ca721c 022/399: swiper.el (swiper-avy): If the input is 1 char, re-highlight, Oleh Krehel, 2019/07/20
- [elpa] master ffffc21 024/399: swiper.el (swiper-mc): Update doc, Oleh Krehel, 2019/07/20