[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master d3032e2 06/23: company-next-page: Wrap only when at the la
From: |
Dmitry Gutov |
Subject: |
[elpa] master d3032e2 06/23: company-next-page: Wrap only when at the last item |
Date: |
Fri, 11 Nov 2016 22:21:41 +0000 (UTC) |
branch: master
commit d3032e237e7b4f732ccc351908d2e5280919af67
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
company-next-page: Wrap only when at the last item
Ditto company-previous-page.
Fixes #533.
---
NEWS.md | 3 +++
company.el | 16 ++++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/NEWS.md b/NEWS.md
index c9aacb0..fe8df0b 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,9 @@
## Next
+* `company-next-page` and `company-previous-page` adhere to
+ `company-selection-wrap-around` docstring more closely and only wrap around
+ when the selection is at the start of the end of the list.
* `company-pseudo-tooltip-unless-just-one-frontend-with-delay` handles custom
frontends derived from `company-preview-frontend` better.
* `company-idle-delay` is automatically converted to a non-zero value.
diff --git a/company.el b/company.el
index 2b59a2a..70bd5b4 100644
--- a/company.el
+++ b/company.el
@@ -1981,15 +1981,23 @@ With ARG, move by that many elements."
"Select the candidate one page further."
(interactive)
(when (company-manual-begin)
- (company-set-selection (+ company-selection
- company-tooltip-limit))))
+ (if (and company-selection-wrap-around
+ (= company-selection (1- company-candidates-length)))
+ (company-set-selection 0)
+ (let (company-selection-wrap-around)
+ (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))))
+ (if (and company-selection-wrap-around
+ (zerop company-selection))
+ (company-set-selection (1- company-candidates-length))
+ (let (company-selection-wrap-around)
+ (company-set-selection (- company-selection
+ company-tooltip-limit))))))
(defvar company-pseudo-tooltip-overlay)
- [elpa] master updated (ec15f45 -> 85bd83e), Dmitry Gutov, 2016/11/11
- [elpa] master 99d2e84 01/23: Cancel the tooltip-with-delay timer on hide, Dmitry Gutov, 2016/11/11
- [elpa] master 05a934b 02/23: Simplify, Dmitry Gutov, 2016/11/11
- [elpa] master 5fe2c23 04/23: Consider any frontend deriving from company-preview-frontend, Dmitry Gutov, 2016/11/11
- [elpa] master d3032e2 06/23: company-next-page: Wrap only when at the last item,
Dmitry Gutov <=
- [elpa] master 63d4332 07/23: Reword, Dmitry Gutov, 2016/11/11
- [elpa] master e53f150 05/23: Mention the previous change, too, Dmitry Gutov, 2016/11/11
- [elpa] master 8e321eb 03/23: Auto-adjust company-idle-delay when it's zero, Dmitry Gutov, 2016/11/11
- [elpa] master 3d369e1 11/23: Don't convert user-error signals to error (#560), Dmitry Gutov, 2016/11/11
- [elpa] master 86c1f60 10/23: company-dabbrev-code: Look inside comments and strings when appropriate, Dmitry Gutov, 2016/11/11
- [elpa] master ac2606a 18/23: Add JSX modes to javascript aliases, Dmitry Gutov, 2016/11/11
- [elpa] master fc39277 15/23: Add keywords for rust-mode to company-keywords., Dmitry Gutov, 2016/11/11
- [elpa] master f78f9c1 21/23: Initialize grouped backends on the fly as well, Dmitry Gutov, 2016/11/11
- [elpa] master e6689ea 12/23: company-files--directory-files: Swallow file-error, Dmitry Gutov, 2016/11/11
- [elpa] master 9476aef 09/23: company-files--directory-files: Don't ignore errors, Dmitry Gutov, 2016/11/11