summaryrefslogtreecommitdiff
path: root/corfu.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2024-11-01 11:37:18 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2024-11-01 11:37:18 +0100
commit16d5aef839477ac54790fb797c1e85dfdbbd313f (patch)
treeffe3e354866ac51dc528f68eb312ae3e4da20862 /corfu.el
parentc7e2aa41702c6a38f7253ae9c668c562b56a410a (diff)
corfu--make-frame: Remove buffer argument, use current buffer
Diffstat (limited to 'corfu.el')
-rw-r--r--corfu.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/corfu.el b/corfu.el
index 844fd1f..f8c64a9 100644
--- a/corfu.el
+++ b/corfu.el
@@ -437,8 +437,8 @@ length override, set to t for manual completion."
'resize-mode)))
;; Function adapted from posframe.el by tumashu
-(defun corfu--make-frame (frame x y width height buffer)
- "Show BUFFER in child frame at X/Y with WIDTH/HEIGHT.
+(defun corfu--make-frame (frame x y width height)
+ "Show current buffer in child frame at X/Y with WIDTH/HEIGHT.
FRAME is the existing frame."
(when-let (((frame-live-p frame))
(timer (frame-parameter frame 'corfu--hide-timer)))
@@ -488,8 +488,8 @@ FRAME is the existing frame."
unless (equal (alist-get k is) v) collect p)))
(when diff (modify-frame-parameters frame diff)))
(let ((win (frame-root-window frame)))
- (unless (eq (window-buffer win) buffer)
- (set-window-buffer win buffer))
+ (unless (eq (window-buffer win) (current-buffer))
+ (set-window-buffer win (current-buffer)))
;; Disallow selection of root window (gh:minad/corfu#63)
(set-window-parameter win 'no-delete-other-windows t)
(set-window-parameter win 'no-other-window t)
@@ -1058,8 +1058,7 @@ A scroll bar is displayed from LO to LO+BAR."
str))
lines "\n"))
(goto-char (point-min)))
- (setq corfu--frame (corfu--make-frame corfu--frame x y
- width height (current-buffer)))))))
+ (setq corfu--frame (corfu--make-frame corfu--frame x y width height))))))
(cl-defgeneric corfu--popup-hide ()
"Hide Corfu popup."