emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 559b4f2 49/66: Don't repeat search with empty string


From: Dmitry Gutov
Subject: [elpa] master 559b4f2 49/66: Don't repeat search with empty string
Date: Tue, 13 Jan 2015 02:45:02 +0000

branch: master
commit 559b4f291301a0ef77207e83933c19d6663ebfb2
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    Don't repeat search with empty string
---
 company.el |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/company.el b/company.el
index 65e601b..faa7c22 100644
--- a/company.el
+++ b/company.el
@@ -1603,10 +1603,15 @@ from the rest of the back-ends in the group, if any, 
will be left at the end."
             company-search-lighter (concat " Search: \"" new "\""))
       (company-set-selection (+ company-selection pos) t))))
 
+(defun company-search--assert-input ()
+  (company-search-assert-enabled)
+  (unless (cl-plusp (length company-search-string))
+    (error "Empty search string")))
+
 (defun company-search-repeat-forward ()
   "Repeat the incremental search in completion candidates forward."
   (interactive)
-  (company-search-assert-enabled)
+  (company-search--assert-input)
   (let ((pos (company-search company-search-string
                              (cdr (nthcdr company-selection
                                           company-candidates)))))
@@ -1617,7 +1622,7 @@ from the rest of the back-ends in the group, if any, will 
be left at the end."
 (defun company-search-repeat-backward ()
   "Repeat the incremental search in completion candidates backwards."
   (interactive)
-  (company-search-assert-enabled)
+  (company-search--assert-input)
   (let ((pos (company-search company-search-string
                              (nthcdr (- company-candidates-length
                                         company-selection)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]