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

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

[elpa] externals/company 97cfbc3 37/46: Merge pull request #1033 from ed


From: Dmitry Gutov
Subject: [elpa] externals/company 97cfbc3 37/46: Merge pull request #1033 from edwargix/master
Date: Wed, 30 Dec 2020 18:33:10 -0500 (EST)

branch: externals/company
commit 97cfbc3967c195fb4ccb171735b9b1dea97e681a
Merge: dd92593 bea3195
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: GitHub <noreply@github.com>

    Merge pull request #1033 from edwargix/master
    
    Implement `company-select-first' and `company-select-last'
---
 NEWS.md    |  1 +
 company.el | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/NEWS.md b/NEWS.md
index e89cd59..b91d56a 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## Next
 
+* New commands `company-select-first` and `company-select-last`.
 * `company-tng-mode` has been added to replace both
   `company-tng-configure-default` and the manual method of enabling
   `company-tng-frontend` (see also `company-tng-auto-configure`). Also,
diff --git a/company.el b/company.el
index 57cf960..1bffc7a 100644
--- a/company.el
+++ b/company.el
@@ -2098,6 +2098,16 @@ With ARG, move by that many elements."
     (company-abort)
     (company--unread-this-command-keys)))
 
+(defun company-select-first ()
+  "Select the first completion candidate."
+  (interactive)
+  (company-set-selection 0))
+
+(defun company-select-last ()
+  "Select the last completion candidate."
+  (interactive)
+  (company-set-selection (1- company-candidates-length)))
+
 (defun company-next-page ()
   "Select the candidate one page further."
   (interactive)



reply via email to

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