From 36bcda5654a73a53fbd9db55a2adca5e82d9aaf6 Mon Sep 17 00:00:00 2001 From: Undead Kernel Date: Sun, 6 Nov 2016 14:09:06 +0100 Subject: [PATCH] Enable company mode when asked to autocomplete --- core/defuns/defuns-company.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/defuns/defuns-company.el b/core/defuns/defuns-company.el index 274b4540a..b107e110a 100644 --- a/core/defuns/defuns-company.el +++ b/core/defuns/defuns-company.el @@ -42,6 +42,8 @@ "`company-mode' completion backend that completes whole-lines, akin to vim's C-x C-l." (interactive (list 'interactive)) + (require 'company) + (unless (bound-and-true-p company-mode) (company-mode)) (let ((lines (doom--company-whole-lines))) (cl-case command (interactive (company-begin-backend 'doom/company-whole-lines)) @@ -59,8 +61,8 @@ C-x C-l." "Bring up the completion popup. If only one result, complete it." (interactive) (require 'company) - (when (and (bound-and-true-p company-mode) - (company-manual-begin) + (unless (bound-and-true-p company-mode) (company-mode)) + (when (and (company-manual-begin) (= company-candidates-length 1)) (company-complete-common)))