branch: externals/corfu
commit cf75c085b95b55f5c08aa58dd9c3c21ba2015dea
Author: JD Smith <93749+jdtsm...@users.noreply.github.com>
Commit: GitHub <nore...@github.com>

    Go back to prompt with scroll on first candidate. (#51)
---
 corfu.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/corfu.el b/corfu.el
index 9d5403b..7dee72d 100644
--- a/corfu.el
+++ b/corfu.el
@@ -726,9 +726,10 @@ completion began less than that number of seconds ago."
      (1- corfu--index))))
 
 (defun corfu-scroll-down ()
-  "Go back by one page."
+  "Go back by one page, or to the prompt when the first candidate is selected."
   (interactive)
-  (corfu--goto (max 0 (- corfu--index corfu-count))))
+  (corfu--goto
+   (if (> corfu--index 0) (max 0 (- corfu--index corfu-count)) -1)))
 
 (defun corfu-scroll-up ()
   "Go forward by one page."

Reply via email to