From c151e40d01a646f1d1ec6bbe1f5bc0441235dc9d Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 28 Sep 2014 04:39:57 +0400 Subject: [PATCH] company-search-printing-char: Don't update company-search-string when no match Fixes #194 --- company.el | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/company.el b/company.el index 15a6eeed6..a72136665 100644 --- a/company.el +++ b/company.el @@ -1575,14 +1575,12 @@ from the rest of the back-ends in the group, if any, will be left at the end." (defun company-search-printing-char () (interactive) (company-search-assert-enabled) - (setq company-search-string - (concat (or company-search-string "") (string last-command-event)) - company-search-lighter (concat " Search: \"" company-search-string - "\"")) - (let ((pos (company-search company-search-string - (nthcdr company-selection company-candidates)))) + (let* ((ss (concat company-search-string (string last-command-event))) + (pos (company-search ss (nthcdr company-selection company-candidates)))) (if (null pos) (ding) + (setq company-search-string ss + company-search-lighter (concat " Search: \"" ss "\"")) (company-set-selection (+ company-selection pos) t)))) (defun company-search-repeat-forward () -- 2.39.2