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



commit 2cfa5a09eabaa8cdc659e400130b7e843b59ebb6
Author: Sebastien Lafargue <slafargue gnome org>
Date:   Thu Sep 28 15:09:02 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.

 src/libide/sourceview/ide-source-view.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/libide/sourceview/ide-source-view.c b/src/libide/sourceview/ide-source-view.c
index 0924c3c..f8820f9 100644
--- a/src/libide/sourceview/ide-source-view.c
+++ b/src/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]