mirror of
https://github.com/doomemacs/doomemacs
synced 2025-09-06 15:13:33 -05:00
Temporary fix for autoskipping >'s in C/C++'
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user