Don't narrow to REPL cell when fontifying syntactically

There is no need to do so since
`jupyter-repl-font-lock-fontify-region` already takes care of
narrowing to cell bounds and `font-lock-syntactic-face-function` is
called during the fontification process of the narrowed cell.
This commit is contained in:
Nathaniel Nicandro 2021-02-06 19:43:52 -06:00 committed by Nathaniel Nicandro
parent 477dcfd71c
commit 303a8f2e81

View file

@ -1793,11 +1793,6 @@ VERBOSE has the same meaning as in
(forward-char)
(skip-syntax-forward "^()\"")))))
(defun jupyter-repl-font-lock-syntactic-face-function (face-fun state)
"Narrow to the input cell, use FACE-FUN to obtain the face given STATE."
(jupyter-with-repl-cell
(funcall face-fun state)))
(cl-defgeneric jupyter-repl-initialize-fontification ()
"Initialize fontification for the current REPL buffer."
(let (fld frf sff spf comment)
@ -1823,9 +1818,7 @@ VERBOSE has the same meaning as in
(cons 'font-lock-fontify-region-function
(apply-partially
#'jupyter-repl-font-lock-fontify-region frf))
(cons 'font-lock-syntactic-face-function
(apply-partially
#'jupyter-repl-font-lock-syntactic-face-function sff)))))
(cons 'font-lock-syntactic-face-function sff))))
(setq-local comment-start comment)
(setq font-lock-defaults
(apply #'list kws kws-only case-fold syntax-alist vars)))