From ec89870a324c2ba3c707a0aec2330db681283bbc Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Wed, 20 Oct 2021 11:19:25 +0200 Subject: sdgui: trim selection text Just like sdtui does. --- src/sdgui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sdgui.c') diff --git a/src/sdgui.c b/src/sdgui.c index 0cbee8f..1310900 100644 --- a/src/sdgui.c +++ b/src/sdgui.c @@ -129,7 +129,9 @@ on_selection_received (G_GNUC_UNUSED GtkClipboard *clipboard, const gchar *text, if (!text) return; - gtk_entry_set_text (GTK_ENTRY (g.entry), text); + gchar *trimmed = g_strstrip (g_strdup (text)); + gtk_entry_set_text (GTK_ENTRY (g.entry), trimmed); + g_free (trimmed); g_signal_emit_by_name (g.entry, "move-cursor", GTK_MOVEMENT_BUFFER_ENDS, 1, FALSE); } -- cgit v1.2.3-70-g09d2