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:
parent
653e4badeb
commit
520b4238fe
src/lib/platform
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue