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:
parent
59dcd11433
commit
c9e30e8c77
@ -7208,6 +7208,20 @@ implementations: `python-mode' and `python-ts-mode'."
|
|||||||
"_definition"))
|
"_definition"))
|
||||||
(setq-local treesit-defun-name-function
|
(setq-local treesit-defun-name-function
|
||||||
#'python--treesit-defun-name)
|
#'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)
|
(treesit-major-mode-setup)
|
||||||
|
|
||||||
(setq-local syntax-propertize-function #'python--treesit-syntax-propertize)
|
(setq-local syntax-propertize-function #'python--treesit-syntax-propertize)
|
||||||
|
Loading…
Reference in New Issue
Block a user