소스 검색

Merge pull request #40534 from zaevi/fix_clipboard_crlf_3.2

[3.2] fix crlf for clipboard
Rémi Verschelde 5 년 전
부모
커밋
b3520ecd1c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      platform/windows/os_windows.cpp

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