From 7e957c7b0a76ff26efc6eef95c3a89cd876fa8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Ho=C5=82ubowicz?= Date: Mon, 24 Nov 2025 19:35:36 +0100 Subject: [PATCH] feat(markdown): add support for built-in markdown-ts-mode --- smartparens-config.el | 3 ++- smartparens-markdown.el | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/smartparens-config.el b/smartparens-config.el index 03f02525..f06a82e6 100644 --- a/smartparens-config.el +++ b/smartparens-config.el @@ -148,7 +148,8 @@ ID, ACTION, CONTEXT." (eval-after-load 'latex '(require 'smartparens-latex)) (eval-after-load 'lua-mode '(require 'smartparens-lua)) (eval-after-load 'lua-ts-mode '(require 'smartparens-lua)) -(eval-after-load 'markdown-mode '(require 'smartparens-markdown)) +(--each '(markdown-mode markdown-ts-mode) + (eval-after-load it '(require 'smartparens-markdown))) (--each '(python-mode python-ts-mode python) (eval-after-load it '(require 'smartparens-python))) (eval-after-load 'org '(require 'smartparens-org)) diff --git a/smartparens-markdown.el b/smartparens-markdown.el index 772dc331..92a36014 100644 --- a/smartparens-markdown.el +++ b/smartparens-markdown.el @@ -69,7 +69,7 @@ This predicate is only tested on \"insert\" action." (goto-char mb) (save-match-data (looking-at "^\\* ")))) -(sp-with-modes '(markdown-mode gfm-mode) +(sp-with-modes '(markdown-mode markdown-ts-mode gfm-mode) (sp-local-pair "*" "*" :unless '(sp--gfm-point-after-word-p sp-point-at-bol-p) :post-handlers '(("[d1]" "SPC")) @@ -77,7 +77,7 @@ This predicate is only tested on \"insert\" action." (sp-local-pair "**" "**") (sp-local-pair "_" "_" :unless '(sp-point-after-word-p))) -(sp-with-modes 'markdown-mode +(sp-with-modes '(markdown-mode markdown-ts-mode) (sp-local-pair "```" "```")) (sp-with-modes 'gfm-mode