diff --git a/core/core-editor.el b/core/core-editor.el index faca0482e..28707ebea 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -122,7 +122,7 @@ (add-hook 'evil-replace-state-entry-hook 'turn-off-smartparens-mode) (add-hook 'evil-replace-state-exit-hook 'turn-on-smartparens-mode) ;; Auto-close more conservatively - (sp-pair "'" nil :unless '(sp-point-after-word-p)) + (sp-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p)) (sp-pair "\"" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p)) (sp-pair "{" nil :post-handlers '(("||\n[i]" "RET") ("| " " ")) :unless '(sp-point-before-word-p sp-point-before-same-p)) diff --git a/modules/lang/python/config.el b/modules/lang/python/config.el index 2ab6c666e..458574eb4 100644 --- a/modules/lang/python/config.el +++ b/modules/lang/python/config.el @@ -19,7 +19,10 @@ :config (set! :repl 'python-mode '+python/repl) - (define-key python-mode-map (kbd "DEL") nil)) ; interferes with smartparens + (define-key python-mode-map (kbd "DEL") nil) ; interferes with smartparens + + (sp-with-modes 'python-mode + (sp-local-pair "'" nil :unless '(sp-point-before-word-p sp-point-after-word-p sp-point-before-same-p)))) (def-package! anaconda-mode