branch: elpa/flycheck
commit ee6ad0e0da4eba9c14c1d5ec48f304c6bc1a094c
Author: Bozhidar Batsov <[email protected]>
Commit: Bozhidar Batsov <[email protected]>

    Skip error list highlighting when the error list is not visible
    
    The error list highlight function runs on every post-command-hook,
    scanning all errors even when the error list buffer is hidden.  Skip
    the work entirely when no window is displaying the error list, since
    the highlights would not be seen anyway and will be recomputed when
    the error list becomes visible again.
    
    Closes #1170
---
 flycheck.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/flycheck.el b/flycheck.el
index 0c88c5f0a0..7664bbc139 100644
--- a/flycheck.el
+++ b/flycheck.el
@@ -5519,8 +5519,11 @@ nil, if there is no next error."
 Highlight all errors in the error list that are at point in the
 source buffer, and on the same line as point.  Then recenter the
 error list to the highlighted error, unless PRESERVE-POS is
-non-nil."
-  (when (get-buffer flycheck-error-list-buffer)
+non-nil.
+
+Skip highlighting when the error list buffer is not visible, to
+avoid slowing down editing when the error list is hidden."
+  (when (get-buffer-window flycheck-error-list-buffer)
     (with-current-buffer flycheck-error-list-buffer
       (let ((current-errors
              (when (buffer-live-p flycheck-error-list-source-buffer)

Reply via email to