From 8256b9631ad7eb425e24902218daa741f30010a7 Mon Sep 17 00:00:00 2001 From: "0.kgy" Date: Wed, 3 Jul 2024 19:04:24 +0800 Subject: [PATCH] open newline after `RET` pressed --- smartparens-rust.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smartparens-rust.el b/smartparens-rust.el index f5058610..5b8b4539 100644 --- a/smartparens-rust.el +++ b/smartparens-rust.el @@ -133,6 +133,10 @@ ARGS." :when '(sp-rust-filter-angle-brackets) :skip-match 'sp-rust-skip-match-angle-bracket)) + (dolist (open '("<" "{" "[" "(")) + (sp-local-pair '(rust-mode rust-ts-mode rustic-mode) + open nil :post-handlers '(:add ("||\n[i]" "RET")))) + ;; Rust has no sexp suffices. This fixes slurping ;; (|foo).bar -> (foo.bar) (add-to-list 'sp-sexp-suffix (list #'rust-mode 'regexp ""))