summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2025-12-04 20:10:30 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2025-12-04 20:10:30 +0100
commitea42506402cf4f7837801e6cf020246156b00517 (patch)
tree7f0d5695fc066e4051a372afcf134c2274a427b9
parent99a6ff693f4a9ae1deaeb20ddb91f305d4b3a825 (diff)
corfu--exhibit: Fix rare issue when position is at end of buffer
In this case posn-at-point returns nil.
-rw-r--r--corfu.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/corfu.el b/corfu.el
index 6e322e2..f659582 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.