[3.2] fix crlf for clipboard

This commit is contained in:
Zae 2020-07-20 15:42:32 +08:00
parent 89f57ae122
commit 6f2be6b05c
1 changed files with 1 additions and 1 deletions

View File

@ -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.");