branch: elpa/smartparens commit afffa3f6c223c1a61e88c764e4828ac932ef4464 Author: Eric Zhuo Chen <zyxirc...@outlook.com> Commit: Eric Zhuo Chen <zyxirc...@outlook.com>
Add python-ts-mode (treesit) as an alias for python-mode --- smartparens-config.el | 2 +- smartparens-python.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/smartparens-config.el b/smartparens-config.el index 282a974bcc..65e2b8ff8e 100644 --- a/smartparens-config.el +++ b/smartparens-config.el @@ -117,7 +117,7 @@ ID, ACTION, CONTEXT." (eval-after-load 'latex '(require 'smartparens-latex)) (eval-after-load 'lua-mode '(require 'smartparens-lua)) (eval-after-load 'markdown-mode '(require 'smartparens-markdown)) -(--each '(python-mode python) +(--each '(python-mode python-ts-mode python) (eval-after-load it '(require 'smartparens-python))) (eval-after-load 'org '(require 'smartparens-org)) (eval-after-load 'racket-mode '(require 'smartparens-racket)) diff --git a/smartparens-python.el b/smartparens-python.el index dbe63338f6..2c342b1336 100644 --- a/smartparens-python.el +++ b/smartparens-python.el @@ -65,7 +65,7 @@ Supported definitions are: ;; Python has no sexp suffices. This fixes slurping ;; (|sys).path.append---the dot should not travel with the closing ;; paren -(--each '(python-mode inferior-python-mode) +(--each '(python-mode python-ts-mode inferior-python-mode) (add-to-list 'sp-sexp-suffix (list it 'regexp ""))) (defun sp-python-maybe-add-colon-python (_id action _context) @@ -93,7 +93,7 @@ See also the option `sp-python-insert-colon-in-function-definitions'." (forward-char) ;; skip closing paren (insert ":")))) -(sp-with-modes 'python-mode +(sp-with-modes '(python-mode python-ts-mode) (sp-local-pair "'" "'" :unless '(sp-in-comment-p sp-in-string-quotes-p) :post-handlers '(:add sp-python-fix-tripple-quotes)) (sp-local-pair "\"" "\"" :post-handlers '(:add sp-python-fix-tripple-quotes)) (sp-local-pair "'''" "'''")