diff --git a/doc/man/mcedit.1.in b/doc/man/mcedit.1.in index 57a9b9971..56bcaf17b 100644 --- a/doc/man/mcedit.1.in +++ b/doc/man/mcedit.1.in @@ -556,6 +556,9 @@ Toggle show visible tabs, if editor_visible_tabs=1 tabs showed as '<\-\-\-\->' .I editor_persistent_selections Do not remove block selection after moving the cursor. .TP +.I editor_drop_selection_on_copy +Reset selection after copy to clipboard. +.TP .I editor_cursor_beyond_eol Allow moving cursor beyond the end of line. .TP diff --git a/src/editor/edit.h b/src/editor/edit.h index 2382d732f..5db38c7eb 100644 --- a/src/editor/edit.h +++ b/src/editor/edit.h @@ -39,6 +39,7 @@ extern int option_return_does_auto_indent; extern int option_backspace_through_tabs; extern int option_fake_half_tabs; extern int option_persistent_selections; +extern int option_drop_selection_on_copy; extern int option_cursor_beyond_eol; extern gboolean option_cursor_after_inserted_block; extern int option_line_state; diff --git a/src/editor/editcmd.c b/src/editor/editcmd.c index b726b850d..202cb79fa 100644 --- a/src/editor/editcmd.c +++ b/src/editor/editcmd.c @@ -91,6 +91,9 @@ int search_create_bookmark = FALSE; /* queries on a save */ int edit_confirm_save = 1; +/* whether we need to drop selection on copy to buffer */ +int option_drop_selection_on_copy = 1; + /*** file scope macro definitions ****************************************************************/ #define space_width 1 @@ -2899,6 +2902,9 @@ edit_copy_to_X_buf_cmd (WEdit * edit) /* try use external clipboard utility */ mc_event_raise (MCEVENT_GROUP_CORE, "clipboard_file_to_ext_clip", NULL); + if (option_drop_selection_on_copy) + edit_mark_cmd (edit, TRUE); + return TRUE; } diff --git a/src/setup.c b/src/setup.c index e02584ede..2da22b095 100644 --- a/src/setup.c +++ b/src/setup.c @@ -349,6 +349,7 @@ static const struct { "editor_edit_confirm_save", &edit_confirm_save }, { "editor_syntax_highlighting", &option_syntax_highlighting }, { "editor_persistent_selections", &option_persistent_selections }, + { "editor_drop_selection_on_copy", &option_drop_selection_on_copy }, { "editor_cursor_beyond_eol", &option_cursor_beyond_eol }, { "editor_cursor_after_inserted_block", &option_cursor_after_inserted_block }, { "editor_visible_tabs", &visible_tabs },