Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A method to avoid indent-guide and company-mode conflicts #53

Open
yuzumx opened this issue Sep 10, 2018 · 0 comments
Open

A method to avoid indent-guide and company-mode conflicts #53

yuzumx opened this issue Sep 10, 2018 · 0 comments

Comments

@yuzumx
Copy link

yuzumx commented Sep 10, 2018

Hello:

Inspired by the code of purcell:
https://github.com/purcell/emacs.d/blob/ce03e69652f03f636e26c92f12d6d79c024c3d2c/lisp/init-company.el#L26-L43

The following is my "copy or imitate":

(with-eval-after-load 'company
  (with-eval-after-load 'indent-guide
    (defvar sanityinc/indent-guide-on-p nil)
    (make-variable-buffer-local 'sanityinc/indent-guide-on-p)

    (defun sanityinc/indent-guide-disable (&rest ignore)
      (when (setq sanityinc/indent-guide-on-p (bound-and-true-p indent-guide-mode))
        (indent-guide-mode -1)))

    (defun sanityinc/indent-guide-maybe-reenable (&rest ignore)
      (when sanityinc/indent-guide-on-p
        (indent-guide-mode 1)))

    (add-hook 'company-completion-started-hook 'sanityinc/indent-guide-disable)
    (add-hook 'company-completion-finished-hook 'sanityinc/indent-guide-maybe-reenable)
    (add-hook 'company-completion-cancelled-hook 'sanityinc/indent-guide-maybe-reenable)))

What I want to ask is, is there any big performance problem?

Thank you, and sorry for my poor English.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant