summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2021-09-27 22:08:28 +1000
committer Vas Crabb <vas@vastheman.com>2021-09-27 22:08:28 +1000
commit839d2e69e9584575cd06e7648f9050b9a769d5bd (patch)
tree0211a636b885f095cb6f2f0e8e8f616d75d590e2
parent55d43402ab25104a60b657b3938496c113a51c4f (diff)
debugger/qt, debugger/win: Fixed suppressing trailing whitespace in copied text on completely blank lnes (most noticeable for the console view).
-rw-r--r--src/osd/modules/debugger/qt/debuggerview.cpp4
-rw-r--r--src/osd/modules/debugger/win/debugviewinfo.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/osd/modules/debugger/qt/debuggerview.cpp b/src/osd/modules/debugger/qt/debuggerview.cpp
index 263fcfe1e73..f8ffda536b1 100644
--- a/src/osd/modules/debugger/qt/debuggerview.cpp
+++ b/src/osd/modules/debugger/qt/debuggerview.cpp
@@ -331,8 +331,8 @@ void DebuggerView::copyVisibleSlot()
for (uint32_t col = 0; col < visarea.x; ++col)
text += wchar_t(viewdata[col].byte);
std::string::size_type const nonblank = text.find_last_not_of("\t\n\v\r ");
- if ((nonblank != std::string::npos) && (nonblank >= start))
- text.resize(nonblank + 1);
+ if (nonblank != std::string::npos)
+ text.resize((std::max)(nonblank + 1, start));
text += "\n";
}
diff --git a/src/osd/modules/debugger/win/debugviewinfo.cpp b/src/osd/modules/debugger/win/debugviewinfo.cpp
index d6e94c1ba3e..6965d032dfa 100644
--- a/src/osd/modules/debugger/win/debugviewinfo.cpp
+++ b/src/osd/modules/debugger/win/debugviewinfo.cpp
@@ -320,8 +320,8 @@ void debugview_info::handle_context_menu(unsigned command)
for (uint32_t col = 0; col < visarea.x; ++col)
text += wchar_t(viewdata[col].byte);
std::wstring::size_type const nonblank = text.find_last_not_of(L"\t\n\v\r ");
- if ((nonblank != std::wstring::npos) && (nonblank >= start))
- text.resize(nonblank + 1);
+ if (nonblank != std::wstring::npos)
+ text.resize((std::max)(start, nonblank + 1));
text += L"\r\n";
}