Skip to content

Commit

Permalink
support emacs version < 27
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rex committed Jan 2, 2020
1 parent 2ae22c4 commit 00d558f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tree-sitter-highlight.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00d558f

Please sign in to comment.