branch: externals/jinx
commit b3a4b86ea79ef0ff0c8667b5f2299f7f2cab9d55
Author: Daniel Mendler <[email protected]>
Commit: Daniel Mendler <[email protected]>

    jinx--correct-select: Check that candidate is non-nil
---
 jinx.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/jinx.el b/jinx.el
index fb7ab7b92c..dee19ec1d8 100644
--- a/jinx.el
+++ b/jinx.el
@@ -600,11 +600,11 @@ If VISIBLE is non-nil, only include visible overlays."
 (defun jinx--correct-select ()
   "Quick selection key for corrections."
   (interactive)
-  (delete-minibuffer-contents)
-  (insert
-   (nth (- last-input-event ?1)
-        (all-completions "" minibuffer-completion-table)))
-  (exit-minibuffer))
+  (when-let ((str (nth (- last-input-event ?1)
+                       (all-completions "" minibuffer-completion-table))))
+    (delete-minibuffer-contents)
+    (insert str)
+    (exit-minibuffer)))
 
 (defun jinx--correct (overlay &optional recenter info)
   "Correct word at OVERLAY with optional RECENTER and prompt INFO."

Reply via email to