summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-07-21 16:06:43 +0200
committerGitHub <noreply@github.com>2020-07-21 16:06:43 +0200
commit103b46733ac4f53259575a528a1f6a3be034f227 (patch)
treeac9f920a87717b0f673e827a29b32e4a029d8792
parentf6b6d51052b64c9ce11039db7a35e75e374e6ef3 (diff)
parent0107550cf16e3701e076263393e3b6da5d725759 (diff)
Merge pull request #40533 from zaevi/fix_clipboard_crlf
fix crlf for clipboard
-rw-r--r--platform/windows/display_server_windows.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp
index 0251ffe664..6ee9b6d698 100644
--- a/platform/windows/display_server_windows.cpp
+++ b/platform/windows/display_server_windows.cpp
@@ -170,7 +170,7 @@ void DisplayServerWindows::clipboard_set(const String &p_text) {
// Convert LF line endings to CRLF in clipboard content
// Otherwise, line endings won't be visible when pasted in other software
- String text = p_text.replace("\n", "\r\n");
+ String text = p_text.replace("\r\n", "\n").replace("\n", "\r\n"); // avoid \r\r\n
if (!OpenClipboard(windows[last_focused_window].hWnd)) {
ERR_FAIL_MSG("Unable to open clipboard.");