Fix over-aggressive smartparens in org-mode #285

This commit is contained in:
Henrik Lissner 2017-12-09 00:17:01 -05:00
parent adcc2865c0
commit efdde6961e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 38 additions and 1 deletions

View file

@ -79,7 +79,19 @@
(ignore-errors
(save-excursion
(outline-previous-visible-heading 1)
(org-show-subtree))))))
(org-show-subtree)))))
(defun +org-sp-point-in-checkbox-p (_id action _context)
(when (eq action 'insert)
(sp--looking-at-p "\\s-*]")))
;; make delimiter auto-closing a little more conservative
(sp-with-modes 'org-mode
(sp-local-pair "*" nil :unless '(sp-point-after-word-p sp-point-before-word-p sp-point-at-bol-p))
(sp-local-pair "_" nil :unless '(sp-point-after-word-p sp-point-before-word-p))
(sp-local-pair "/" nil :unless '(sp-point-after-word-p sp-point-before-word-p +org-sp-point-in-checkbox-p))
(sp-local-pair "~" nil :unless '(sp-point-after-word-p sp-point-before-word-p))
(sp-local-pair "=" nil :unless '(sp-point-after-word-p sp-point-before-word-p))))
;;
(defun +org-init-ui ()