Merge pull request #40534 from zaevi/fix_clipboard_crlf_3.2

[3.2] fix crlf for clipboard
This commit is contained in:
Rémi Verschelde 2020-07-21 16:06:53 +02:00 committed by GitHub
commit b3520ecd1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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