Check Carriage Return from unix

In my environment(Ubuntu 20.04)
when I copy multi lines at gnome terminal, all lines are added an additional newline.

I think it's because of the carriage return from Unix.
It's a solution that ignores the carriage return.
This commit is contained in:
Joey Shin 2022-08-19 19:06:10 +09:00 committed by GitHub
parent 653e4badeb
commit 520b4238fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ std::string MSWindowsClipboardAnyTextConverter::convertLinefeedToWin32(const std
// copy string, converting newlines
n = (UInt32)src.size();
for (const char* scan = src.c_str(); n > 0; ++scan, --n) {
if (scan[0] == '\n') {
if (scan[0] == '\n' && dst.back() != '\r') {
dst += '\r';
}
dst += scan[0];