Fix some "Go to settings" in Style Configurator go to wrong section

Fix #14882, close #14903
pull/14905/head
Don Ho 2024-03-24 13:44:00 +01:00
parent 52fa5a3b8a
commit 12c6777bc1
1 changed files with 40 additions and 16 deletions

View File

@ -905,81 +905,105 @@ void WordStyleDlg::setStyleListFromLexer(int index)
std::pair<intptr_t, intptr_t> WordStyleDlg::goToPreferencesSettings()
{
std::pair<intptr_t, intptr_t> result;
result.first = -1;
result.second = -1;
result.first = -1; // Page
result.second = -1; // Control
enum preferencesSectionPage {
general = 0,
edit1,
edit2,
darkMode,
margins,
newDocument,
defaultDirectory,
recentFileHistory,
fileAssociation,
language,
highlighting,
print,
searching,
backup,
autoCompletion,
multiInstance,
delimiter,
performance,
cloudAndLink,
searchEngine,
misc
};
Style& style = getCurrentStyler();
// Global override style
if (style._styleDesc == TEXT("Current line background colour"))
{
result.first = 1;
result.first = edit1;
result.second = IDC_RADIO_CLM_HILITE;
}
else if (style._styleDesc == TEXT("Caret colour"))
{
result.first = 1;
result.first = edit1;
result.second = IDC_WIDTH_COMBO;
}
else if (style._styleDesc == TEXT("Edge colour"))
{
result.first = 3;
result.first = margins;
result.second = IDC_COLUMNPOS_EDIT;
}
else if (style._styleDesc == TEXT("Line number margin"))
{
result.first = 3;
result.first = margins;
result.second = IDC_CHECK_LINENUMBERMARGE;
}
else if (style._styleDesc == TEXT("Bookmark margin"))
{
result.first = 3;
result.first = margins;
result.second = IDC_CHECK_BOOKMARKMARGE;
}
else if (style._styleDesc == TEXT("Change History margin"))
{
result.first = 3;
result.first = margins;
result.second = IDC_CHECK_CHANGHISTORYMARGIN;
}
else if (style._styleDesc == TEXT("Fold") || style._styleDesc == TEXT("Fold active") || style._styleDesc == TEXT("Fold margin"))
{
result.first = 3;
result.first = margins;
result.second = IDC_RADIO_BOX;
}
else if (style._styleDesc == TEXT("Smart Highlighting"))
{
result.first = 9;
result.first = highlighting;
result.second = IDC_CHECK_ENABLSMARTHILITE;
}
else if (style._styleDesc == TEXT("Tags match highlighting"))
{
result.first = 9;
result.first = highlighting;
result.second = IDC_CHECK_ENABLTAGSMATCHHILITE;
}
else if (style._styleDesc == TEXT("Tags attribute"))
{
result.first = 9;
result.first = highlighting;
result.second = IDC_CHECK_ENABLTAGATTRHILITE;
}
else if (style._styleDesc == TEXT("Mark Style 1") || style._styleDesc == TEXT("Mark Style 2") || style._styleDesc == TEXT("Mark Style 3")
|| style._styleDesc == TEXT("Mark Style 4") || style._styleDesc == TEXT("Mark Style 5"))
{
result.first = 9;
result.first = highlighting;
result.second = IDC_CHECK_MARKALLCASESENSITIVE;
}
else if (style._styleDesc == TEXT("URL hovered"))
{
result.first = 17;
result.first = cloudAndLink;
result.second = IDC_CHECK_CLICKABLELINK_ENABLE;
}
else if (style._styleDesc == TEXT("EOL custom color"))
{
result.first = 2;
result.first = edit2;
result.second = IDC_CHECK_WITHCUSTOMCOLOR_CRLF;
}
else if (style._styleDesc == g_npcStyleName)
{
result.first = 2;
result.first = edit2;
result.second = IDC_CHECK_NPC_COLOR;
}