Fix a small regression in DebugInfo dialog

Remove "$COMMAND_LINE_PLACEHOLDER$ from the copied DebugInfo text.

Fix #11752, close #11753
This commit is contained in:
Shridhar Kumar 2022-05-31 17:00:54 -04:00 committed by Don Ho
parent a02a254ea1
commit b204be9012
2 changed files with 8 additions and 7 deletions

View File

@ -359,10 +359,10 @@ intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
if ((GetKeyState(VK_LBUTTON) & 0x100) != 0)
{
// Visual effect
::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, _debugInfoStr.length() - 1);
::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, _debugInfoDisplay.length() - 1);
// Copy to clipboard
str2Clipboard(_debugInfoStr, _hSelf);
str2Clipboard(_debugInfoDisplay, _hSelf);
}
return TRUE;
}
@ -394,17 +394,17 @@ void DebugInfoDlg::doDialog()
void DebugInfoDlg::refreshDebugInfo()
{
generic_string debugInfoDisplay { _debugInfoStr };
_debugInfoDisplay = _debugInfoStr;
size_t replacePos = debugInfoDisplay.find(_cmdLinePlaceHolder);
size_t replacePos = _debugInfoDisplay.find(_cmdLinePlaceHolder);
if (replacePos != std::string::npos)
{
debugInfoDisplay.replace(replacePos, _cmdLinePlaceHolder.length(), NppParameters::getInstance().getCmdLineString());
_debugInfoDisplay.replace(replacePos, _cmdLinePlaceHolder.length(), NppParameters::getInstance().getCmdLineString());
}
// Set Debug Info text and leave the text in selected state
::SetDlgItemText(_hSelf, IDC_DEBUGINFO_EDIT, debugInfoDisplay.c_str());
::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, debugInfoDisplay.length() - 1);
::SetDlgItemText(_hSelf, IDC_DEBUGINFO_EDIT, _debugInfoDisplay.c_str());
::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, _debugInfoDisplay.length() - 1);
::SetFocus(::GetDlgItem(_hSelf, IDC_DEBUGINFO_EDIT));
}

View File

@ -82,6 +82,7 @@ protected:
private:
typedef const CHAR * (__cdecl * PWINEGETVERSION)();
generic_string _debugInfoStr;
generic_string _debugInfoDisplay;
const generic_string _cmdLinePlaceHolder { L"$COMMAND_LINE_PLACEHOLDER$" };
bool _isAdmin = false;
generic_string _loadedPlugins;