diff --git a/NppJSONViewer/NppJsonViewer/Define.h b/NppJSONViewer/NppJsonViewer/Define.h index cb99f32..c3f20d6 100644 --- a/NppJSONViewer/NppJsonViewer/Define.h +++ b/NppJSONViewer/NppJsonViewer/Define.h @@ -100,9 +100,9 @@ struct Indent struct ParseOptions { - bool bIgnoreComment = true; - bool bIgnoreTraillingComma = true; - bool bReplaceUndefined = false; + bool bIgnoreComment = true; + bool bIgnoreTrailingComma = true; + bool bReplaceUndefined = false; }; struct Setting diff --git a/NppJSONViewer/NppJsonViewer/JsonHandler.h b/NppJSONViewer/NppJsonViewer/JsonHandler.h index c2bf55d..6194bf0 100644 --- a/NppJSONViewer/NppJsonViewer/JsonHandler.h +++ b/NppJSONViewer/NppJsonViewer/JsonHandler.h @@ -56,22 +56,22 @@ inline auto JsonHandler::ParseJson(const std::string &jsonText, rj::StringBuffer constexpr auto flgBase_comma = flgBase | rj::kParseTrailingCommasFlag; constexpr auto flgBase_Both = flgBase_comma | flgBase_commemt; - if (m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTraillingComma) + if (m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTrailingComma) { success = reader.Parse(ss, handler) && sb.GetString(); } - else if (!m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTraillingComma) + else if (!m_parseOptions.bIgnoreComment && m_parseOptions.bIgnoreTrailingComma) { success = reader.Parse(ss, handler) && sb.GetString(); } - else if (m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTraillingComma) + else if (m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTrailingComma) { success = reader.Parse(ss, handler) && sb.GetString(); } - else if (!m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTraillingComma) + else if (!m_parseOptions.bIgnoreComment && !m_parseOptions.bIgnoreTrailingComma) { success = reader.Parse(ss, handler) && sb.GetString(); } diff --git a/NppJSONViewer/NppJsonViewer/Profile.cpp b/NppJSONViewer/NppJsonViewer/Profile.cpp index ef67bb4..67da32c 100644 --- a/NppJSONViewer/NppJsonViewer/Profile.cpp +++ b/NppJSONViewer/NppJsonViewer/Profile.cpp @@ -106,9 +106,9 @@ bool ProfileSetting::GetSettings(Setting &info) const if (bRetVal) info.parseOptions.bIgnoreComment = static_cast(nVal); - bRetVal &= ReadValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, nVal, info.parseOptions.bIgnoreTraillingComma); + bRetVal &= ReadValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, nVal, info.parseOptions.bIgnoreTrailingComma); if (bRetVal) - info.parseOptions.bIgnoreTraillingComma = static_cast(nVal); + info.parseOptions.bIgnoreTrailingComma = static_cast(nVal); bRetVal &= ReadValue(STR_INI_OTHER_SEC, STR_INI_OTHER_REPLACE_UNDEFINED, nVal, info.parseOptions.bReplaceUndefined); if (bRetVal) @@ -130,7 +130,7 @@ bool ProfileSetting::SetSettings(const Setting &info) const bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_AUTO_FORMAT, info.bAutoFormat); bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_USE_HIGHLIGHT, info.bUseJsonHighlight); bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMENT, info.parseOptions.bIgnoreComment); - bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, info.parseOptions.bIgnoreTraillingComma); + bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_IGNORE_COMMA, info.parseOptions.bIgnoreTrailingComma); bRetVal &= WriteValue(STR_INI_OTHER_SEC, STR_INI_OTHER_REPLACE_UNDEFINED, info.parseOptions.bReplaceUndefined); return bRetVal; diff --git a/NppJSONViewer/NppJsonViewer/SettingsDlg.cpp b/NppJSONViewer/NppJsonViewer/SettingsDlg.cpp index 655d033..f15a5a2 100644 --- a/NppJSONViewer/NppJsonViewer/SettingsDlg.cpp +++ b/NppJSONViewer/NppJsonViewer/SettingsDlg.cpp @@ -125,7 +125,7 @@ bool SettingsDlg::Apply() m_pSetting->bFollowCurrentTab = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FOLLOW_CURRENT_DOC)); m_pSetting->bAutoFormat = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FORMAT_ON_OPEN)); m_pSetting->bUseJsonHighlight = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_JSON_HIGHLIGHT)); - m_pSetting->parseOptions.bIgnoreTraillingComma = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA)); + m_pSetting->parseOptions.bIgnoreTrailingComma = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA)); m_pSetting->parseOptions.bIgnoreComment = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMENT)); m_pSetting->parseOptions.bReplaceUndefined = CUtility::GetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_REPLACE_UNDEFINED)); @@ -207,7 +207,7 @@ void SettingsDlg::InitDlg() CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FOLLOW_CURRENT_DOC), m_pSetting->bFollowCurrentTab); CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_FORMAT_ON_OPEN), m_pSetting->bAutoFormat); CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_JSON_HIGHLIGHT), m_pSetting->bUseJsonHighlight); - CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA), m_pSetting->parseOptions.bIgnoreTraillingComma); + CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMA), m_pSetting->parseOptions.bIgnoreTrailingComma); CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_IGNORE_COMMENT), m_pSetting->parseOptions.bIgnoreComment); CUtility::SetCheckboxStatus(::GetDlgItem(_hSelf, IDC_CHK_REPLACE_UNDEFINED), m_pSetting->parseOptions.bReplaceUndefined); }