diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2022-11-17 23:06:07 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2022-11-17 23:06:07 +0100 |
| commit | b82f1dbdd11aa97d787dddfbdeacf280a14f7c6f (patch) | |
| tree | 7cd3a55d94363d604c5a502a0a14c80d0d42240b | |
| parent | 42010706540b0288ebc1c9f315b54307481bd9fb (diff) | |
Simplify corfu-docframe
| -rw-r--r-- | extensions/corfu-docframe.el | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/extensions/corfu-docframe.el b/extensions/corfu-docframe.el index dac7284..b670174 100644 --- a/extensions/corfu-docframe.el +++ b/extensions/corfu-docframe.el @@ -329,13 +329,12 @@ it should be compared with the value recorded by `corfu--index'." (nth corfu--index corfu--candidates)))) (if (not candidate) (corfu-docframe--hide) - (let ((should-update-doc-p - (not (and (corfu-docframe--visible-p) - (equal candidate corfu-docframe--candidate)))) - ;; check if the coordinates of the corfu popup have changed - (cfp-edges-changed-p - (not (equal (frame-edges corfu--frame 'inner-edges) - corfu-docframe--edges)))) + (let* ((should-update-doc-p + (not (and (corfu-docframe--visible-p) + (equal candidate corfu-docframe--candidate)))) + ;; check if the coordinates of the corfu popup have changed + (new-edges (frame-edges corfu--frame 'inner-edges)) + (cfp-edges-changed-p (not (equal new-edges corfu-docframe--edges)))) (when should-update-doc-p (if-let* ((doc (corfu-docframe--get-doc))) ;; turn on word wrap and hide fringe indicators @@ -368,8 +367,7 @@ it should be compared with the value recorded by `corfu--index'." (get-buffer " *corfu-docframe*")) corfu-docframe--direction area-d))) (setq corfu-docframe--candidate candidate - corfu-docframe--edges - (frame-edges corfu--frame 'inner-edges)))))) + corfu-docframe--edges new-edges))))) (defun corfu-docframe--hide () "Clear the doc popup buffer content and hide it." |
