[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a986e4e 071/184: ivy.el (ivy--yank-handle-case-fold): Add
From: |
Oleh Krehel |
Subject: |
[elpa] master a986e4e 071/184: ivy.el (ivy--yank-handle-case-fold): Add |
Date: |
Wed, 16 Oct 2019 13:14:51 -0400 (EDT) |
branch: master
commit a986e4ea113162e1f5407b83b6954381499e7d64
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy--yank-handle-case-fold): Add
Fixes #2194
---
ivy-test.el | 10 ++++++++++
ivy.el | 11 ++++++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/ivy-test.el b/ivy-test.el
index 0989abd..a6fb301 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1368,6 +1368,16 @@ a buffer visiting a file."
(should (string= (ivy-with read-numbers "C-' a") "1"))
(should (string= (ivy-with read-numbers "C-v C-' d") "7")))))
+(ert-deftest ivy--yank-handle-case-fold ()
+ (should (string=
+ (let ((ivy-text ""))
+ (ivy--yank-handle-case-fold "FirstName"))
+ "FirstName"))
+ (should (string=
+ (let ((ivy-text "f"))
+ (ivy--yank-handle-case-fold "irstName"))
+ "irstname")))
+
(provide 'ivy-test)
;;; ivy-test.el ends here
diff --git a/ivy.el b/ivy.el
index 5a33d6f..983b87a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4302,6 +4302,12 @@ Skip buffers that match `ivy-ignore-buffers'."
:keymap ivy-switch-buffer-map
:caller 'ivy-switch-buffer-other-window))
+(defun ivy--yank-handle-case-fold (text)
+ (if (and (> (length ivy-text) 0)
+ (string= (downcase ivy-text) ivy-text))
+ (downcase text)
+ text))
+
(defun ivy--yank-by (fn &rest args)
"Pull buffer text from current line into search string.
The region to extract is determined by the respective values of
@@ -4320,7 +4326,10 @@ point before and after applying FN to ARGS."
(unless text
(goto-char beg)))))
(when text
- (insert (replace-regexp-in-string " +" " " text t t)))))
+ (insert (replace-regexp-in-string
+ " +" " "
+ (ivy--yank-handle-case-fold text)
+ t t)))))
(defun ivy-yank-word (&optional arg)
"Pull next word from buffer into search string.
- [elpa] master 0132ced 044/184: counsel.el: Run ispell-comments-and-strings, (continued)
- [elpa] master 0132ced 044/184: counsel.el: Run ispell-comments-and-strings, Oleh Krehel, 2019/10/16
- [elpa] master c4842ec 043/184: Fix typo: 'beggining', Oleh Krehel, 2019/10/16
- [elpa] master 28e9416 052/184: ivy.el (ivy--input): Fix for ediff, Oleh Krehel, 2019/10/16
- [elpa] master dd3e1c9 038/184: swiper.el (swiper--maybe-recenter): Refactor, Oleh Krehel, 2019/10/16
- [elpa] master 5ff5139 051/184: ivy.el (ivy-read-action-function): Allow to read actions using Ivy, Oleh Krehel, 2019/10/16
- [elpa] master e4e0ec4 049/184: counsel.el (counsel--file-name-filter): Return "cat" on empty input, Oleh Krehel, 2019/10/16
- [elpa] master 17d9c70 036/184: counsel.el (counsel--find-return-list): Re-use counsel--call, Oleh Krehel, 2019/10/16
- [elpa] master 44c4bab 057/184: Restore use-ignore setting on ivy-resume, Oleh Krehel, 2019/10/16
- [elpa] master d3e4514 063/184: Remove obsolete aliases older than one year, Oleh Krehel, 2019/10/16
- [elpa] master 0be5b58 067/184: ivy.el (ivy-partial): Don't rely on subr-x, Oleh Krehel, 2019/10/16
- [elpa] master a986e4e 071/184: ivy.el (ivy--yank-handle-case-fold): Add,
Oleh Krehel <=
- [elpa] master e41cbec 073/184: ivy.el (ivy-immediate-done): Fix parent dirs for read-directory-name, Oleh Krehel, 2019/10/16
- [elpa] master 3256447 076/184: ivy.el (ivy--partial-cd-for-single-directory): Extract, Oleh Krehel, 2019/10/16
- [elpa] master 03b3f82 075/184: ivy.el (ivy-partial): Use ivy--filter in place of all-completions, Oleh Krehel, 2019/10/16
- [elpa] master daf4683 081/184: ivy.el (ivy--directory-done): Inhibit distracting TRAMP message for /sudo::, Oleh Krehel, 2019/10/16
- [elpa] master 9e03f36 095/184: ivy-test.el: Turn two tests back on, Oleh Krehel, 2019/10/16
- [elpa] master 4b7b075 093/184: ivy-test.el (ivy-test-inhibit-message): Add, Oleh Krehel, 2019/10/16
- [elpa] master 967d046 091/184: ivy-test.el (counsel-yank-pop): Fix on Windows, Oleh Krehel, 2019/10/16
- [elpa] master cfbf481 089/184: Lazy load ffap, Oleh Krehel, 2019/10/16
- [elpa] master 464875a 103/184: counsel.el (counsel-mark-ring): Refactor for reducing nested let, Oleh Krehel, 2019/10/16
- [elpa] master 0c1901e 100/184: ivy.el (ivy--regex-ignore-order): Fix docstring, Oleh Krehel, 2019/10/16