Skip to content

Commit 532b302

Browse files
authored
Add shim for corfu (#662)
1 parent c6963f8 commit 532b302

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

meow-shims.el

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,24 @@ Argument ENABLE non-nil means turn on."
105105
(add-hook 'meow-insert-exit-hook #'meow--company-maybe-abort-advice)
106106
(remove-hook 'meow-insert-exit-hook #'meow--company-maybe-abort-advice)))
107107

108+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
109+
;; corfu
110+
111+
(defvar meow--corfu-setup nil
112+
"Whether already setup corfu.")
113+
114+
(defun meow--corfu-maybe-abort-advice ()
115+
"Adviced for `meow-insert-exit'."
116+
(when corfu-mode (corfu-quit)))
117+
118+
(defun meow--setup-corfu (enable)
119+
"Setup for corfu.
120+
Argument ENABLE non-nil means turn on."
121+
(setq meow--corfu-setup enable)
122+
(if enable
123+
(add-hook 'meow-insert-exit-hook #'meow--corfu-maybe-abort-advice)
124+
(remove-hook 'meow-insert-exit-hook #'meow--corfu-maybe-abort-advice)))
125+
108126
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
109127
;; repeat-map
110128

@@ -466,6 +484,7 @@ Argument ENABLE non-nil means turn on."
466484
(eval-after-load "magit" (lambda () (meow--setup-magit t)))
467485
(eval-after-load "wgrep" (lambda () (meow--setup-wgrep t)))
468486
(eval-after-load "company" (lambda () (meow--setup-company t)))
487+
(eval-after-load "corfu" (lambda () (meow--setup-corfu t)))
469488
(eval-after-load "polymode" (lambda () (meow--setup-polymode t)))
470489
(eval-after-load "cider" (lambda () (meow--setup-cider t)))
471490
(eval-after-load "sly" (lambda () (meow--setup-sly t)))
@@ -486,6 +505,7 @@ Argument ENABLE non-nil means turn on."
486505
(when meow--edebug-setup (meow--setup-edebug nil))
487506
(when meow--magit-setup (meow--setup-magit nil))
488507
(when meow--company-setup (meow--setup-company nil))
508+
(when meow--corfu-setup (meow--setup-corfu nil))
489509
(when meow--wgrep-setup (meow--setup-wgrep nil))
490510
(when meow--polymode-setup (meow--setup-polymode nil))
491511
(when meow--cider-setup (meow--setup-cider nil))

0 commit comments

Comments
 (0)