From f68e1d1fd326e26e7f31ff3fc0b4f53b35e1875c Mon Sep 17 00:00:00 2001 From: Don Ho Date: Wed, 24 Sep 2025 14:54:43 +0200 Subject: [PATCH] Fix a logic error Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/16889#issuecomment-3328064735 --- PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index 1d215111e..f95795aef 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -4863,11 +4863,15 @@ bool ScintillaEditView::pasteToMultiSelection() const vector clipboardStrings; - wstring eol = L"\r\n"; - if (clipboardStr.find(L"\n") != std::wstring::npos) + wstring eol; + if (clipboardStr.find(L"\r\n") != std::wstring::npos) + eol = L"\r\n"; + else if (clipboardStr.find(L"\n") != std::wstring::npos) eol = L"\n"; else if (clipboardStr.find(L"\r") != std::wstring::npos) eol = L"\r"; + else + eol = getEOLString(); stringSplit(clipboardStr, eol, clipboardStrings); clipboardStrings.erase(clipboardStrings.cend() - 1); // remove the last empty string