Temporary fix for autoskipping >'s in C/C++'
This commit is contained in:
parent
94525b779f
commit
892fc8969b
1 changed files with 13 additions and 1 deletions
|
@ -36,9 +36,21 @@
|
|||
(define-key c-mode-base-map ")" 'self-insert-command)
|
||||
|
||||
(define-key c++-mode-map "}" nil)
|
||||
(define-key c++-mode-map ">" nil)
|
||||
;; FIXME: fix smartparens
|
||||
;; (define-key c++-mode-map ">" nil)
|
||||
(map! :map c++-mode-map :i ">" 'narf/autoclose->-maybe)
|
||||
(define-key c++-mode-map "<" nil))
|
||||
|
||||
;;;###autoload
|
||||
(defun narf/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)))
|
||||
|
||||
(defun narf--copy-face (new-face face)
|
||||
"Define NEW-FACE from existing FACE."
|
||||
(copy-face face new-face)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue