[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d27bdf6 5/7: Add company-next-page and company-previous-pa
From: |
Dmitry Gutov |
Subject: |
[elpa] master d27bdf6 5/7: Add company-next-page and company-previous-page |
Date: |
Thu, 22 Jan 2015 23:06:53 +0000 |
branch: master
commit d27bdf6eb8defdec0d975d7c4372e81bd92082ae
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
Add company-next-page and company-previous-page
Resolves #283
---
NEWS.md | 5 +++++
company.el | 16 ++++++++++++++++
2 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index 70d6a0f..4139186 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,5 +1,10 @@
# History of user-visible changes
+## 2015-01-23 (0.8.9)
+
+* New commands `company-next-page` and `company-previous-page`, remapping
+ `scroll-up-command` and `scroll-down-command` during completion.
+
## 2015-01-13 (0.8.8)
* Pressing `M-n` or `M-p` doesn't quit the search mode.
diff --git a/company.el b/company.el
index 005413b..cd78bd9 100644
--- a/company.el
+++ b/company.el
@@ -614,6 +614,8 @@ asynchronous call into synchronous.")
(define-key keymap (kbd "M-p") 'company-select-previous)
(define-key keymap (kbd "<down>") 'company-select-next-or-abort)
(define-key keymap (kbd "<up>") 'company-select-previous-or-abort)
+ (define-key keymap [remap scroll-up-command] 'company-next-page)
+ (define-key keymap [remap scroll-down-command] 'company-previous-page)
(define-key keymap [down-mouse-1] 'ignore)
(define-key keymap [down-mouse-3] 'ignore)
(define-key keymap [mouse-1] 'company-complete-mouse)
@@ -1811,6 +1813,20 @@ and invoke the normal binding."
(company-abort)
(company--unread-last-input)))
+(defun company-next-page ()
+ "Select the candidate one page further."
+ (interactive)
+ (when (company-manual-begin)
+ (company-set-selection (+ company-selection
+ company-tooltip-limit))))
+
+(defun company-previous-page ()
+ "Select the candidate one page earlier."
+ (interactive)
+ (when (company-manual-begin)
+ (company-set-selection (- company-selection
+ company-tooltip-limit))))
+
(defvar company-pseudo-tooltip-overlay)
(defvar company-tooltip-offset)
- [elpa] master updated (ca6142f -> c7f675e), Dmitry Gutov, 2015/01/22
- [elpa] master 78e8d0a 3/7: company-ispell: Filter returned candidates locally, Dmitry Gutov, 2015/01/22
- [elpa] master 75f578e 2/7: company--create-lines: Handle keep-prefix with multiple-width chars in prefix, Dmitry Gutov, 2015/01/22
- [elpa] master 9c60a4f 4/7: Update copyright years, Dmitry Gutov, 2015/01/22
- [elpa] master d27bdf6 5/7: Add company-next-page and company-previous-page,
Dmitry Gutov <=
- [elpa] master a4ac0de 6/7: Bump the version, Dmitry Gutov, 2015/01/22
- [elpa] master c7f675e 7/7: Merge commit 'a4ac0dead8e9cb440c1f8aec9141d6c64bad4933' from company, Dmitry Gutov, 2015/01/22
- [elpa] master 7c02be2 1/7: * packages/company/test/clang-tests.el: Add copyright notice, Dmitry Gutov, 2015/01/22