[gnome-text-editor] view: update primary clipboard with deleted line
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] view: update primary clipboard with deleted line
- Date: Fri, 12 Nov 2021 20:32:15 +0000 (UTC)
commit cfb4c8d46ff45f2ed486717e8216f9e951989fa4
Author: Christian Hergert <chergert redhat com>
Date: Fri Nov 12 12:31:59 2021 -0800
view: update primary clipboard with deleted line
When deleting a line with Ctrl+D it is nice to update the primary selection
clipboard with the contents of the deleted line so that the user may
middle-mouse-click to paste the line elsewhere.
Related #215
src/editor-source-view.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/src/editor-source-view.c b/src/editor-source-view.c
index 7a0556f..0880ed8 100644
--- a/src/editor-source-view.c
+++ b/src/editor-source-view.c
@@ -413,6 +413,11 @@ editor_source_view_action_delete_line (GtkWidget *widget,
g_unichar_isspace (gtk_text_iter_get_char (&begin)))
gtk_text_iter_forward_char (&begin);
gtk_text_buffer_select_range (buffer, &begin, &begin);
+
+ /* it's nice to place the text into the primary selection so that
+ * the user can paste it in other places.
+ */
+ gdk_clipboard_set_text (gtk_widget_get_primary_clipboard (widget), text);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]