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

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

[elpa] externals/jinx 2458dcb603: Only recenter if misspelling is out of


From: ELPA Syncer
Subject: [elpa] externals/jinx 2458dcb603: Only recenter if misspelling is out of sight
Date: Fri, 16 Jun 2023 09:58:52 -0400 (EDT)

branch: externals/jinx
commit 2458dcb6039811a174aff8c784abdb552a361c4f
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    Only recenter if misspelling is out of sight
---
 jinx.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/jinx.el b/jinx.el
index 3ad09da79c..ab402c1b84 100644
--- a/jinx.el
+++ b/jinx.el
@@ -694,14 +694,15 @@ If CHECK is non-nil, always check first."
                    (annotation-function . jinx--correct-annotation))
       (complete-with-action action word str pred))))
 
-(defun jinx--correct (overlay recenter info)
-  "Correct word at OVERLAY, maybe RECENTER and show prompt INFO."
+(defun jinx--correct (overlay info)
+  "Correct word at OVERLAY, maybe show prompt INFO."
   (let* ((word (buffer-substring-no-properties
                 (overlay-start overlay) (overlay-end overlay)))
          (choice
           (jinx--correct-highlight overlay
             (lambda ()
-              (when recenter (recenter))
+              (when (or (< (point) (window-start)) (> (point) (window-end nil 
t)))
+                (recenter))
               (minibuffer-with-setup-hook
                   #'jinx--correct-setup
                 (or (completing-read
@@ -846,8 +847,7 @@ If prefix argument ALL non-nil correct all misspellings."
                          (catch 'jinx--goto
                            (unless deleted
                              (jinx--correct
-                              ov all
-                              (and all (format " (%d of %d)" (1+ idx) 
count)))))))
+                              ov (and all (format " (%d of %d)" (1+ idx) 
count)))))))
                    (cond
                     ((integerp skip) (setq idx (mod (+ idx skip) count)))
                     ((or all deleted) (cl-incf idx))))))



reply via email to

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