[gnome-builder/gnome-builder-3-26] editor: paste from external text at wrong position



commit 04bc8169f0227ade4f4750f8c0e89967ba56775e
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Thu Sep 28 15:13:08 2017 +0200

    editor: paste from external text at wrong position
    
    Possible mismatch between the clipboard content and the utf-8 converted text
    so we set back the utf-8 text in the clipboard to be sure.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788278

 libide/sourceview/ide-source-view.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/libide/sourceview/ide-source-view.c b/libide/sourceview/ide-source-view.c
index 3d12ce4..5fca1bf 100644
--- a/libide/sourceview/ide-source-view.c
+++ b/libide/sourceview/ide-source-view.c
@@ -3396,6 +3396,10 @@ ide_source_view_real_paste_clipboard_extended (IdeSourceView *self,
 
   clipboard = gtk_widget_get_clipboard (GTK_WIDGET (self), GDK_SELECTION_CLIPBOARD);
   text = gtk_clipboard_wait_for_text (clipboard);
+  /* Possible mismatch between the clipboard content and the utf-8 converted text
+   * so we set back the utf-8 text in the clipboard to be sure.
+   */
+  gtk_clipboard_set_text (clipboard, text, -1);
 
   gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
   target_line = gtk_text_iter_get_line (&iter);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]