forked from qt-creator/qt-creator
Terminal: Fix multi-line copy&paste
Previously all lines would be copied into one without lines breaks. Change-Id: Id87dbde84a19ccbc5f53438a305173d1b070eaba Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -360,7 +360,12 @@ void TerminalWidget::copyToClipboard() const
|
||||
Internal::CellIterator end = m_surface->iteratorAt(m_selection->end);
|
||||
|
||||
std::u32string s;
|
||||
std::copy(it, end, std::back_inserter(s));
|
||||
for (; it != end; ++it) {
|
||||
if (it.gridPos().x() == 0 && !s.empty())
|
||||
s += U'\n';
|
||||
if (*it != 0)
|
||||
s += *it;
|
||||
}
|
||||
|
||||
const QString text = QString::fromUcs4(s.data(), static_cast<int>(s.size()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user