mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 10:30:25 -08:00
Fix infloop in python-ts-mode string fontification (bug#79457)
* lisp/progmodes/python.el (python--treesit-fontify-string): Make sure there's no infloop.
This commit is contained in:
parent
77921ce458
commit
202425f934
1 changed files with 7 additions and 6 deletions
|
|
@ -1122,12 +1122,13 @@ fontified."
|
|||
"body"))
|
||||
(throw 'break 'font-lock-doc-face))
|
||||
|
||||
(let ((idx 0))
|
||||
(while (< idx cursor-idx)
|
||||
(unless (equal (treesit-node-type
|
||||
(treesit-node-child parent idx))
|
||||
"comment")
|
||||
(throw 'break 'font-lock-string-face))))
|
||||
;; If there's any non-comment sibling before
|
||||
;; cursor, the string isn't a docstring.
|
||||
(dotimes (idx cursor-idx)
|
||||
(unless (equal (treesit-node-type
|
||||
(treesit-node-child parent idx))
|
||||
"comment")
|
||||
(throw 'break 'font-lock-string-face)))
|
||||
(setq cursor parent)))))
|
||||
(ignore-interpolation
|
||||
(not (seq-some
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue