MCPcopy Create free account
hub / github.com/NPP-JSONViewer/JSON-Viewer / ReportError

Method ReportError

src/NppJsonViewer/JsonViewDlg.cpp:869–880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867}
868
869void JsonViewDlg::ReportError(const Result& result)
870{
871 // Mark the error position
872 size_t start = m_pEditor->GetSelectionStart() + result.error_pos;
873 size_t end = m_pEditor->GetSelectionEnd();
874 m_pEditor->MakeSelection(start, end);
875
876 // Intimate user
877 std::string err = std::format("\n\nError: ({} : {})", result.error_code, result.error_str);
878
879 ShowMessage(JSON_ERROR_TITLE, (JSON_ERR_VALIDATE + StringHelper::ToWstring(err)).c_str(), MB_OK | MB_ICONERROR);
880}
881
882void JsonViewDlg::ToggleMenuItemState(bool bVisible)
883{

Callers

nothing calls this directly

Calls 3

GetSelectionStartMethod · 0.80
GetSelectionEndMethod · 0.80
MakeSelectionMethod · 0.80

Tested by

no test coverage detected