branch: elpa/smartparens
commit e3e563b20e405d87e3f1b3792174803bb8de2b7b
Merge: 096a8f6a64 afffa3f6c2
Author: Matus Goljer <matus.gol...@gmail.com>
Commit: GitHub <nore...@github.com>

    Merge pull request #1152 from zyxir/master
    
    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 1b0d285883..af2ee3a71a 100644
--- a/smartparens-config.el
+++ b/smartparens-config.el
@@ -132,7 +132,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 "'''" "'''")

Reply via email to