radian-software / radian

🍉 Dotfiles that marry elegance and practicality.
MIT License
495 stars 47 forks source link

Mode line display is laggy in large Git repositories #414

Closed raxod502 closed 4 years ago

raxod502 commented 6 years ago

We should run Git asynchronously to compute the mode line display, otherwise Emacs may lag.

Temporary hack:

(defun radian-local-wrap-mode-line (orig &rest args)
    (cl-letf (((symbol-function #'executable-find) #'ignore))
      (apply orig args)))

  (define-minor-mode radian-local-big-git-mode
    "Disable checking Git status in mode line."
    nil nil nil
    (if radian-local-big-git-mode
        (advice-add #'radian-mode-line-compute-project-and-branch
                    :around #'radian-local-wrap-mode-line)
      (advice-remove #'radian-mode-line-compute-project-and-branch
                     #'radian-local-wrap-mode-line)))
raxod502 commented 4 years ago

Solved by removing the Git status from the mode line.