[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 5e67e7c 268/395: counsel.el (counsel-rg): Spl
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 5e67e7c 268/395: counsel.el (counsel-rg): Split command args independent of the order |
Date: |
Thu, 25 Feb 2021 08:32:17 -0500 (EST) |
branch: externals/ivy-hydra
commit 5e67e7c3ddb0c4df3989267ced88b1290af2dc28
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
counsel.el (counsel-rg): Split command args independent of the order
* ivy-test.el (counsel--split-command-args): Add test.
Both:
require i -- -g*.el
and:
-g*.el -- require
are vaild and result in the same search.
Fixes #2547
---
counsel.el | 8 +++++---
ivy-test.el | 3 +++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/counsel.el b/counsel.el
index 431ba23..2ad5fbf 100644
--- a/counsel.el
+++ b/counsel.el
@@ -2956,9 +2956,11 @@ regex string."
"Split ARGUMENTS into its switches and search-term parts.
Return pair of corresponding strings (SWITCHES . SEARCH-TERM)."
(if (string-match counsel--command-args-separator arguments)
- (cons
- (substring arguments (match-end 0))
- (substring arguments 0 (match-beginning 0)))
+ (let ((args (substring arguments (match-end 0)))
+ (search-term (substring arguments 0 (match-beginning 0))))
+ (if (string-prefix-p "-" arguments)
+ (cons search-term args)
+ (cons args search-term)))
(cons "" arguments)))
(defun counsel--format-ag-command (extra-args needle)
diff --git a/ivy-test.el b/ivy-test.el
index 599f840..08ffb6e 100644
--- a/ivy-test.el
+++ b/ivy-test.el
@@ -1543,6 +1543,9 @@ a buffer visiting a file."
(counsel--split-command-args "require -- -g*.el")
'("-g*.el" . "require")))
(should (equal
+ (counsel--split-command-args "-g*.el -- require")
+ '("-g*.el" . "require")))
+ (should (equal
(counsel--split-command-args "counsel--format")
'("" . "counsel--format"))))
- [elpa] externals/ivy-hydra 334d08c 227/395: ivy.el (ivy--update-history): Use ivy-text if it's not "", (continued)
- [elpa] externals/ivy-hydra 334d08c 227/395: ivy.el (ivy--update-history): Use ivy-text if it's not "", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 24e68ea 225/395: counsel.el (counsel-git-log-cmd): Disable coloring., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra cfb395e 239/395: counsel.el (counsel--sync-sentinel-on-exit): Simplify, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f4a7d87 241/395: Fix recent addition of caddr in counsel.el, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b91a4e2 238/395: counsel.el (counsel--git-grep-index): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 781cbbc 255/395: Advertise ivy-string< over string-lessp, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0e4a55f 242/395: ivy.el (ivy--preselect-index): Don't return nil, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra af2a5fa 247/395: * counsel.el (counsel-pt): Fix counsel-ag usage, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4aa8073 264/395: ivy.el (ivy-call): Make "M-x cd" work again, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d1ba9b8 269/395: ivy.el (ivy-resume): Refresh on modified buffer for swiper-isearch, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 5e67e7c 268/395: counsel.el (counsel-rg): Split command args independent of the order,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 6369139 271/395: ivy.el (ivy--update-history): Behave more like completing-read-default, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra c0dc909 277/395: ivy.el (ivy-resume): Support multiple ivy sessions, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8989ed1 276/395: ivy.el (ivy--update-minibuffer): don't filter while there's input, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d790e53 278/395: doc/ivy.org: Mention multiple-session ivy-resume, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fb8804d 280/395: ivy.el (ivy--call-marked): Extract, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 489bc57 284/395: counsel.el (counsel-rg-base-command): Make the default a list, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7fd0662 285/395: counsel.el (counsel-grep-like-occur): Fix for marked files in dired, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f1c57a1 292/395: counsel.el (counsel-async-command-delay): Set the default to 0.0, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra fb73bfe 288/395: counsel.el (counsel--rg-targets): Fix regression, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2b26f83 289/395: counsel.el (counsel--sync-sentinel-on-exit): Don't reset index, Basil L. Contovounesios, 2021/02/25