From 2d720fe4f2d760385e64cc9bbf652354958a5420 Mon Sep 17 00:00:00 2001 From: Adam Kruszewski Date: Tue, 4 Jul 2023 15:46:22 +0200 Subject: [PATCH] Make c-c-o-complete-at-point expand templates as well --- corfu-candidate-overlay.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/corfu-candidate-overlay.el b/corfu-candidate-overlay.el index b060444..9347ed9 100644 --- a/corfu-candidate-overlay.el +++ b/corfu-candidate-overlay.el @@ -343,8 +343,16 @@ the end of word." (overlayp corfu-candidate-overlay--overlay) (corfu-candidate-overlay-at-word-boundary-p)) (corfu-candidate-overlay--show) - (corfu-insert) - (corfu-quit))) + (when (not + (string= + (corfu-candidate-overlay--get-overlay-property 'after-string) + "")) + ;; basically we emulate normal corfu's popup completion + ;; to have templates expanded as well. + (corfu-insert) + (completion-at-point) + (corfu-complete) + (corfu-quit)))) ;;;###autoload (define-minor-mode corfu-candidate-overlay-mode