Skip to content

Commit 34978f9

Browse files
authored
Merge pull request #82 from kapilratnani/feature-55-change-lang-to-json
set langtype to json on parse success
2 parents 94d263d + ac854b0 commit 34978f9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

NppJSONViewer/JSONDialog.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ void JSONDialog::populateTreeUsingSax(HWND /*hWndDlg*/, HTREEITEM tree_root, cha
114114
::SendMessage(curScintilla, SCI_SETSEL, errPosition, errPosition + 1);
115115
}
116116

117+
::SendMessage(nppData._nppHandle, NPPM_SETCURRENTLANGTYPE, 0, LangType::L_JSON);
118+
117119
//sw.Stop();
118120
//long long elapsed = sw.ElapsedMilliseconds();
119121
//std::wstringstream s;

NppJSONViewer/PluginDefinition.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ void formatSelectedJSON()
276276
{
277277
const char* fJson = sb.GetString();
278278
::SendMessage(curScintilla, SCI_REPLACESEL, 0, (LPARAM)fJson);
279-
}
279+
::SendMessage(nppData._nppHandle, NPPM_SETCURRENTLANGTYPE, 0, LangType::L_JSON);
280+
}
280281
else
281282
{
282283
// Mark the error position

0 commit comments

Comments
 (0)