* @brief Reload options. */
| 3420 | * @brief Reload options. |
| 3421 | */ |
| 3422 | void CMergeEditView::RefreshOptions() |
| 3423 | { |
| 3424 | RENDERING_MODE nRenderingMode = static_cast<RENDERING_MODE>(GetOptionsMgr()->GetInt(OPT_RENDERING_MODE)); |
| 3425 | SetRenderingMode(nRenderingMode); |
| 3426 | |
| 3427 | if (GetOptionsMgr()->GetInt(OPT_TAB_TYPE) == 0) |
| 3428 | SetInsertTabs(true); |
| 3429 | else |
| 3430 | SetInsertTabs(false); |
| 3431 | |
| 3432 | SetSelectionMargin(GetOptionsMgr()->GetBool(OPT_VIEW_FILEMARGIN)); |
| 3433 | SetTopMargin(GetOptionsMgr()->GetBool( |
| 3434 | GetDocument()->m_ptBuf[m_nThisPane]->GetTableEditing() ? OPT_VIEW_TOPMARGIN_TABLE : OPT_VIEW_TOPMARGIN)); |
| 3435 | SetLineUsedAsHeaders(GetOptionsMgr()->GetInt(OPT_LINE_NUMBER_USED_AS_HEADERS)); |
| 3436 | |
| 3437 | if (!GetOptionsMgr()->GetBool(OPT_SYNTAX_HIGHLIGHT)) |
| 3438 | SetTextType(CrystalLineParser::SRC_PLAIN); |
| 3439 | else if (!GetDocument()->GetChangedSchemeManually()) |
| 3440 | { |
| 3441 | // The syntax highlighting scheme should only be applied if it has not been manually changed. |
| 3442 | String fileName = GetDocument()->m_ptBuf[m_nThisPane]->GetTempFileName(); |
| 3443 | String sExt; |
| 3444 | paths::SplitFilename(fileName, nullptr, nullptr, &sExt); |
| 3445 | CrystalLineParser::TextDefinition* def = CrystalLineParser::GetTextType(sExt.c_str()); |
| 3446 | if (def != nullptr) |
| 3447 | SetTextType(def->type); |
| 3448 | else |
| 3449 | SetTextType(CrystalLineParser::SRC_PLAIN); |
| 3450 | SetDisableBSAtSOL(false); |
| 3451 | } |
| 3452 | |
| 3453 | SetWordWrapping(GetOptionsMgr()->GetBool( |
| 3454 | GetDocument()->m_ptBuf[0]->GetTableEditing() ? OPT_WORDWRAP_TABLE : OPT_WORDWRAP)); |
| 3455 | SetViewLineNumbers(GetOptionsMgr()->GetBool(OPT_VIEW_LINENUMBERS)); |
| 3456 | |
| 3457 | SetViewTabs(GetOptionsMgr()->GetBool(OPT_VIEW_WHITESPACE)); |
| 3458 | SetViewEols(GetOptionsMgr()->GetBool(OPT_VIEW_EOL), |
| 3459 | GetOptionsMgr()->GetBool(OPT_ALLOW_MIXED_EOL) || |
| 3460 | GetDocument()->IsMixedEOL(m_nThisPane)); |
| 3461 | |
| 3462 | Options::DiffColors::Load(GetOptionsMgr(), m_cachedColors); |
| 3463 | } |
| 3464 | |
| 3465 | void CMergeEditView::OnScripts(UINT nID) |
| 3466 | { |
no test coverage detected