Fuco1 / smartparens

Minor mode for Emacs that deals with parens pairs and tries to be smart about it.
GNU General Public License v3.0
1.82k stars 195 forks source link

Replace selection with a pair if delsel is on and autowrap is off #1164

Open Fuco1 opened 1 year ago

Fuco1 commented 1 year ago

Discussed in https://github.com/Fuco1/smartparens/discussions/1163

Originally posted by **Patrick-Poitras** May 21, 2023 Hello. I'd like for the behavior of inserting a pair with a highlighted region to be replacing the region with the pair. That is, if I have `this is a |thing` with `thing` highlighted, I'd like the insertion of "(" to result in `this is a ()`. Currently it gives `this is a (thing)` when sp-autowrap-region is t, and `this is a ()thing` when it is nil. Delete-selection-mode is t.