emacs-china / Spacemacs-rocks

Happy Hacking Emacs & Spacemacs (Simplified Chinese)
http://book.emacs-china.org
2.12k stars 323 forks source link

show-paren-mode打开Python大文件非常卡顿 #152

Open ZhengWG opened 5 years ago

ZhengWG commented 5 years ago

发现在打开600行的大文件的时候非常卡顿,通过profiler-start,profile-report得到是fix-show-paren-function这部分的问题,只能删除。。不知有没有其他解决方案,相关代码:

(define-advice show-paren-function (:around (fn) fix-show-paren-function)
  (cond ((looking-at-p "\\s(") (funcall fn))
     (t (save-excursin
          (ignore-errors (backward-up-list))
          (funcall fn)))))