fix(emacs/lean-mode): run company-lean--check-prefix before auto-complete
fix #191
This commit is contained in:
parent
27b20c5585
commit
1527efb108
2 changed files with 9 additions and 3 deletions
|
@ -22,6 +22,12 @@
|
||||||
(setq-local company-begin-commands '(self-insert-command)) ; start autocompletion only after typing
|
(setq-local company-begin-commands '(self-insert-command)) ; start autocompletion only after typing
|
||||||
(company-mode t))
|
(company-mode t))
|
||||||
|
|
||||||
|
(defun company-lean--check-prefix ()
|
||||||
|
"Check whether to use company-lean or not"
|
||||||
|
(or (company-lean--import-prefix)
|
||||||
|
(company-lean--findg-prefix)
|
||||||
|
(company-lean--findp-prefix)))
|
||||||
|
|
||||||
(defun company-lean--import-remove-lean (file-name)
|
(defun company-lean--import-remove-lean (file-name)
|
||||||
(cond
|
(cond
|
||||||
((s-ends-with? "/default.lean" file-name)
|
((s-ends-with? "/default.lean" file-name)
|
||||||
|
|
|
@ -67,9 +67,9 @@
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (minibufferp)
|
(if (minibufferp)
|
||||||
(minibuffer-complete)
|
(minibuffer-complete)
|
||||||
(cond (lean-company-use
|
(cond ((and lean-company-use (company-lean--check-prefix))
|
||||||
(or (company-complete)
|
(company-complete-common))
|
||||||
(eri-indent)))
|
(lean-company-use (eri-indent))
|
||||||
((lean-check-expansion)
|
((lean-check-expansion)
|
||||||
(completion-at-point-functions))
|
(completion-at-point-functions))
|
||||||
(t (eri-indent)))))
|
(t (eri-indent)))))
|
||||||
|
|
Loading…
Reference in a new issue