Skip to content

Commit

Permalink
- Enable/disable the TLM Editor syntax highlighting.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25760 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Apr 27, 2015
1 parent fd5af15 commit 8dea18b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions OMEdit/OMEditGUI/Editors/TLMEditor.cpp
Expand Up @@ -201,6 +201,10 @@ void TLMHighlighter::highlightMultiLine(const QString &text)
//! Reimplementation of QSyntaxHighlighter::highlightBlock
void TLMHighlighter::highlightBlock(const QString &text)
{
/* Only highlight the text if user has enabled the syntax highlighting */
if (!mpTLMEditorPage->getSyntaxHighlightingCheckbox()->isChecked()) {
return;
}
setCurrentBlockState(0);
setFormat(0, text.length(), mpTLMEditorPage->getTextRuleColor());
foreach (const HighlightingRule &rule, mHighlightingRules)
Expand Down
3 changes: 1 addition & 2 deletions OMEdit/OMEditGUI/Options/OptionsDialog.cpp
Expand Up @@ -79,7 +79,7 @@ void OptionsDialog::readSettings()
readModelicaTextSettings();
emit modelicaTextSettingsChanged();
readTLMSettings();
emit TLMSettingsChanged();
emit TLMSettingsChanged();
readGraphicalViewsSettings();
readSimulationSettings();
readMessagesSettings();
Expand Down Expand Up @@ -2154,7 +2154,6 @@ TLMEditorPage::TLMEditorPage(OptionsDialog *pOptionsDialog)
"\t</Connections>\n"
"</Model>\n");
mpPreviewPlainTextBox->setPlainText(previewText);

// highlight preview textbox
TLMHighlighter *pTLMHighlighter = new TLMHighlighter(this, mpPreviewPlainTextBox);
connect(this, SIGNAL(updatePreview()), pTLMHighlighter, SLOT(settingsChanged()));
Expand Down

0 comments on commit 8dea18b

Please sign in to comment.