branch: externals/corfu
commit ea42506402cf4f7837801e6cf020246156b00517
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    corfu--exhibit: Fix rare issue when position is at end of buffer
    
    In this case posn-at-point returns nil.
---
 corfu.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/corfu.el b/corfu.el
index 6e322e240a..f65958209e 100644
--- a/corfu.el
+++ b/corfu.el
@@ -1252,7 +1252,7 @@ AUTO is non-nil when initializing auto completion."
         (corfu--done (car corfu--candidates) 'finished nil)))
      ;; 2) There exist candidates => Show candidates popup.
      (corfu--candidates
-      (let ((pos (posn-at-point (+ beg (length corfu--base)))))
+      (let ((pos (posn-at-point (min (point-max) (+ beg (length 
corfu--base))))))
         (corfu--preview-current beg end)
         (corfu--candidates-popup pos)))
      ;; 3) No candidates & `corfu-quit-no-match' & initialized => Confirmation 
popup.

Reply via email to