on master help sign in
make paste commands exit select mode
1271a50Ryan Mehri
helix-term/src/commands.rs+7
@@ -4085,22 +4085,27 @@ pub(crate) fn paste_bracketed_value(cx: &mut Context, contents: String) {
4085 };
4085 };
4086 let (view, doc) = current!(cx.editor);
4086 let (view, doc) = current!(cx.editor);
4087 paste_impl(&[contents], doc, view, paste, count, cx.editor.mode);
4087 paste_impl(&[contents], doc, view, paste, count, cx.editor.mode);
4088+ exit_select_mode(cx);
4088}
4089}
4089
4090
4090fn paste_clipboard_after(cx: &mut Context) {
4091fn paste_clipboard_after(cx: &mut Context) {
4091 paste(cx.editor, '+', Paste::After, cx.count());
4092 paste(cx.editor, '+', Paste::After, cx.count());
4093+ exit_select_mode(cx);
4092}
4094}
4093
4095
4094fn paste_clipboard_before(cx: &mut Context) {
4096fn paste_clipboard_before(cx: &mut Context) {
4095 paste(cx.editor, '+', Paste::Before, cx.count());
4097 paste(cx.editor, '+', Paste::Before, cx.count());
4098+ exit_select_mode(cx);
4096}
4099}
4097
4100
4098fn paste_primary_clipboard_after(cx: &mut Context) {
4101fn paste_primary_clipboard_after(cx: &mut Context) {
4099 paste(cx.editor, '*', Paste::After, cx.count());
4102 paste(cx.editor, '*', Paste::After, cx.count());
4103+ exit_select_mode(cx);
4100}
4104}
4101
4105
4102fn paste_primary_clipboard_before(cx: &mut Context) {
4106fn paste_primary_clipboard_before(cx: &mut Context) {
4103 paste(cx.editor, '*', Paste::Before, cx.count());
4107 paste(cx.editor, '*', Paste::Before, cx.count());
4108+ exit_select_mode(cx);
4104}
4109}
4105
4110
4106fn replace_with_yanked(cx: &mut Context) {
4111fn replace_with_yanked(cx: &mut Context) {
@@ -4160,6 +4165,7 @@ fn paste_after(cx: &mut Context) {
4160 Paste::After,
4165 Paste::After,
4161 cx.count(),
4166 cx.count(),
4162 );
4167 );
4168+ exit_select_mode(cx);
4163}
4169}
4164
4170
4165fn paste_before(cx: &mut Context) {
4171fn paste_before(cx: &mut Context) {
@@ -4169,6 +4175,7 @@ fn paste_before(cx: &mut Context) {
4169 Paste::Before,
4175 Paste::Before,
4170 cx.count(),
4176 cx.count(),
4171 );
4177 );
4178+ exit_select_mode(cx);
4172}
4179}
4173
4180
4174fn get_lines(doc: &Document, view_id: ViewId) -> Vec<usize> {
4181fn get_lines(doc: &Document, view_id: ViewId) -> Vec<usize> {