Make JSON auto-indent for brace

Fix #9499, close #9504
This commit is contained in:
Vince 2021-02-12 10:35:33 -05:00 committed by Don HO
parent f576559eaa
commit 69e6eb26a3
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

@ -3024,7 +3024,7 @@ void Notepad_plus::maintainIndentation(TCHAR ch)
return;
if (type == L_C || type == L_CPP || type == L_JAVA || type == L_CS || type == L_OBJC ||
type == L_PHP || type == L_JS || type == L_JAVASCRIPT || type == L_JSP || type == L_CSS || type == L_PERL || type == L_RUST || type == L_POWERSHELL)
type == L_PHP || type == L_JS || type == L_JAVASCRIPT || type == L_JSP || type == L_CSS || type == L_PERL || type == L_RUST || type == L_POWERSHELL || type == L_JSON)
{
if (((eolMode == SC_EOL_CRLF || eolMode == SC_EOL_LF) && ch == '\n') ||
(eolMode == SC_EOL_CR && ch == '\r'))
@ -3067,7 +3067,7 @@ void Notepad_plus::maintainIndentation(TCHAR ch)
_pEditView->setLineIndent(curLine, indentAmountPrevLine);
}
// These languages do no support single line control structures without braces.
else if (type == L_PERL || type == L_RUST || type == L_POWERSHELL)
else if (type == L_PERL || type == L_RUST || type == L_POWERSHELL || type == L_JSON)
{
_pEditView->setLineIndent(curLine, indentAmountPrevLine);
}