aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-10-09 23:25:56 +1100
committerNeil <nyamatongwe@gmail.com>2014-10-09 23:25:56 +1100
commit5fb1efae8f621a56ea4c93ff7dfb7e69c5bd2267 (patch)
tree6067ec5060e8341e00603f9350c9a10d1bd9d9bd
parentf45e76fd128dade00562a8f2f8e59e655720b709 (diff)
downloadscintilla-mirror-5fb1efae8f621a56ea4c93ff7dfb7e69c5bd2267.tar.gz
Avoid extra space when pasting from external application on Windows.
From Mitchell Foral.
-rw-r--r--doc/ScintillaHistory.html3
-rw-r--r--gtk/ScintillaGTK.cxx7
2 files changed, 10 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 79b302302..4b459c277 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -501,6 +501,9 @@
<a href="http://sourceforge.net/p/scintilla/feature-requests/1080/">Feature #1080.</a>
</li>
<li>
+ For GTK+ on Windows, avoid extra space when pasting from external application.
+ </li>
+ <li>
Support MinGW compilation under Linux.
<a href="http://sourceforge.net/p/scintilla/feature-requests/1077/">Feature #1077.</a>
</li>
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 7764f8ec2..0c45843ec 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1564,6 +1564,13 @@ void ScintillaGTK::GetGtkSelectionText(GtkSelectionData *selectionData, Selectio
len--; // Forget the extra '\0'
#endif
+#if PLAT_GTK_WIN32
+ // Win32 includes an ending '\0' byte in 'len' for clipboard text from
+ // external applications; ignore it.
+ if ((len > 0) && (data[len - 1] == '\0'))
+ len--;
+#endif
+
std::string dest(data, len);
if (selectionTypeData == GDK_TARGET_STRING) {
if (IsUnicodeMode()) {