diff --git a/tree-sitter-highlight.el b/tree-sitter-highlight.el index da70e385..b4cda5ef 100644 --- a/tree-sitter-highlight.el +++ b/tree-sitter-highlight.el @@ -267,15 +267,15 @@ to faces. Each function takes no arguments." tree-sitter-highlight--orig-region-function font-lock-fontify-region-function) (setq-local font-lock-fontify-buffer-function (lambda () (tree-sitter-highlight--jit (point-min) - (point-max))) - font-lock-fontify-region-function (lambda (start end _verbose) + (point-max)))) + (setq-local font-lock-fontify-region-function (lambda (start end _verbose) (tree-sitter-highlight--jit start end))) ) (defun tree-sitter-highlight--disable () "Disable `tree-sitter-highlight' in this buffer." - (setq-local font-lock-fontify-buffer-function tree-sitter-highlight--orig-buffer-function - font-lock-fontify-region-function tree-sitter-highlight--orig-region-function) + (setq-local font-lock-fontify-buffer-function tree-sitter-highlight--orig-buffer-function) + (setq-local font-lock-fontify-region-function tree-sitter-highlight--orig-region-function) (font-lock-unfontify-buffer)) (define-minor-mode tree-sitter-highlight-mode