From 6f2be6b05c0f291b49713dbbfd9e3fd79c22acf7 Mon Sep 17 00:00:00 2001 From: Zae Date: Mon, 20 Jul 2020 15:42:32 +0800 Subject: [PATCH] [3.2] fix crlf for clipboard --- platform/windows/os_windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 7560eddd630..dd47151b2b6 100755 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1733,7 +1733,7 @@ void OS_Windows::set_clipboard(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(hWnd)) { ERR_FAIL_MSG("Unable to open clipboard.");