Skip to content

Commit

Permalink
added Linebreak after Strings copied into Clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
daddel80 committed Jan 25, 2024
1 parent 272581f commit 70f4ac0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/MultiReplacePanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2713,6 +2713,7 @@ void MultiReplace::handleCopyMarkedTextToClipboardButton()

std::string markedText;
std::string styleText;
std::string eol = getEOLStyle();

for (int style : textStyles)
{
Expand All @@ -2739,7 +2740,7 @@ void MultiReplace::handleCopyMarkedTextToClipboardButton()
styleText += ch;
}

markedText += styleText;
markedText += styleText + eol; // Append marked text and EOL;
styleText.clear();
}
else
Expand All @@ -2752,6 +2753,11 @@ void MultiReplace::handleCopyMarkedTextToClipboardButton()
}
}

// Remove the last EOL if necessary
if (!markedText.empty() && markedText.length() >= eol.length()) {
markedText.erase(markedText.length() - eol.length());
}

// Convert encoding to wide string
std::wstring wstr = stringToWString(markedText);

Expand Down

0 comments on commit 70f4ac0

Please sign in to comment.