lang/cc: fix smartparens not autopairing/skipping <>
Also removed +cc/autoclose->-maybe -- let smartparens handle this.
This commit is contained in:
parent
11373e0128
commit
b43743d565
2 changed files with 12 additions and 17 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue