Skip to content

Commit 8cec2bc

Browse files
authored
Set language type properly (#148)
#fixes #147 #closes #147
1 parent e1a26ac commit 8cec2bc

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

NppJSONViewer/NppJsonViewer/JsonViewDlg.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,10 @@ void JsonViewDlg::PopulateTreeUsingSax(HTREEITEM tree_root, const std::string &j
181181
ShowMessage(JSON_ERROR_TITLE, (JSON_ERR_VALIDATE + StringHelper::ToWstring(err)).c_str(), MB_OK | MB_ICONERROR);
182182
}
183183
}
184-
185-
m_Editor->SetLangAsJson();
184+
else
185+
{
186+
m_Editor->SetLangAsJson();
187+
}
186188
}
187189

188190
HTREEITEM JsonViewDlg::InsertToTree(HTREEITEM parent, const std::string &text)

NppJSONViewer/NppJsonViewer/ScintillaEditor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ std::string ScintillaEditor::GetJsonText()
3939

4040
void ScintillaEditor::SetLangAsJson() const
4141
{
42-
::SendMessage(m_hScintilla, NPPM_SETCURRENTLANGTYPE, 0, LangType::L_JSON);
42+
::SendMessage(m_NppData._nppHandle, NPPM_SETCURRENTLANGTYPE, 0, LangType::L_JSON);
4343
}
4444

4545
bool ScintillaEditor::IsJsonFile() const

0 commit comments

Comments
 (0)