fix an auto-complete-mode and linum-mode annoyance

后端 未结 4 1761
难免孤独
难免孤独 2020-12-31 17:17

I\'m using auto-complete-mode which I think is totally fantastic. I\'m also a big fan of linum-mode but I\'ve got a very irritating issue when the

4条回答
  •  忘掉有多难
    2020-12-31 17:58

    Update: I ended up patching the source for linum.el. I added an extra hook that runs before updates.

    Here's the patched file: linum.el (github)

    Here's the code I have in my init.el:

    ;; Load custom linum.
    (load-file "~/.emacs.d/linum.el")
    
    ;; Suppress line number updates while auto-complete window
    ;; is displayed.
    (add-hook 'linum-before-update-hook
              '(lambda ()
                 (when auto-complete-mode
                   (if (ac-menu-live-p)
                       (setq linum-suppress-updates t)
                     (setq linum-suppress-updates nil)))))
    

    Hope it helps!

提交回复
热议问题