1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

Add sentence and sexp movement to python-ts-mode

* lisp/progmodes/python.el (python-ts-mode): Add relevant node
types.  (Bug#60856)
This commit is contained in:
Theodor Thornhill 2023-01-22 11:27:37 +01:00 committed by Stefan Kangas
parent 59dcd11433
commit c9e30e8c77

View File

@ -7208,6 +7208,20 @@ implementations: `python-mode' and `python-ts-mode'."
"_definition"))
(setq-local treesit-defun-name-function
#'python--treesit-defun-name)
(setq-local treesit-sentence-type-regexp
(regexp-opt '("statement"
"clause")))
(setq-local treesit-sexp-type-regexp
(regexp-opt '("expression"
"string"
"call"
"operator"
"identifier"
"integer"
"float")))
(treesit-major-mode-setup)
(setq-local syntax-propertize-function #'python--treesit-syntax-propertize)