diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index b85da958..bdcca277 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -3040,6 +3040,13 @@ void ScintillaEditView::setTabSettings(Lang *lang) { if (lang && lang->_tabSize != -1 && lang->_tabSize != 0) { + if (lang->_langID == L_JAVASCRIPT) + { + Lang *ljs = _pParameter->getLangFromID(L_JS); + execute(SCI_SETTABWIDTH, ljs->_tabSize); + execute(SCI_SETUSETABS, !ljs->_isTabReplacedBySpace); + return; + } execute(SCI_SETTABWIDTH, lang->_tabSize); execute(SCI_SETUSETABS, !lang->_isTabReplacedBySpace); } diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 070ce59b..1f757971 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -1811,6 +1811,17 @@ INT_PTR CALLBACK TabSettings::run_dlgProc(UINT Message, WPARAM wParam, LPARAM/* { Lang *lang = pNppParam->getLangFromIndex(index - 1); if (!lang) return FALSE; + if (lang->_langID == L_JS) + { + Lang *ljs = pNppParam->getLangFromID(L_JAVASCRIPT); + ljs->_tabSize = size; + } + else if (lang->_langID == L_JAVASCRIPT) + { + Lang *ljavascript = pNppParam->getLangFromID(L_JS); + ljavascript->_tabSize = size; + } + lang->_tabSize = size; // write in langs.xml @@ -1836,6 +1847,18 @@ INT_PTR CALLBACK TabSettings::run_dlgProc(UINT Message, WPARAM wParam, LPARAM/* if (!lang) return FALSE; if (!lang->_tabSize || lang->_tabSize == -1) lang->_tabSize = nppGUI._tabSize; + + if (lang->_langID == L_JS) + { + Lang *ljs = pNppParam->getLangFromID(L_JAVASCRIPT); + ljs->_isTabReplacedBySpace = isTabReplacedBySpace; + } + else if (lang->_langID == L_JAVASCRIPT) + { + Lang *ljavascript = pNppParam->getLangFromID(L_JS); + ljavascript->_isTabReplacedBySpace = isTabReplacedBySpace; + } + lang->_isTabReplacedBySpace = isTabReplacedBySpace; // write in langs.xml