lang/cc: fix smartparens not autopairing/skipping <>

Also removed +cc/autoclose->-maybe -- let smartparens handle this.
This commit is contained in:
Henrik Lissner 2018-02-14 05:06:26 -05:00
parent 11373e0128
commit b43743d565
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 12 additions and 17 deletions

View file

@ -32,21 +32,14 @@
0 ; no additional indent
(apply orig-fun args)))
;;;###autoload
(defun +cc/autoclose->-maybe ()
"For some reason smartparens won't autoskip >'s, this hack does."
(interactive)
(if (save-excursion
(backward-char)
(looking-at-p "[^ \t]>"))
(forward-char)
(call-interactively #'self-insert-command)))
;;;###autoload
(defun +cc-sp-point-is-template-p (id action context)
"Return t if point is in the right place for C++ angle-brackets."
(and (sp-in-code-p id action context)
(sp-point-after-word-p id action context)))
(cond ((eq action 'insert)
(sp-point-after-word-p id action context))
((eq action 'autoskip)
(/= (char-before) 32)))))
;;;###autoload
(defun +cc-sp-point-after-include-p (id action context)