diff options
| author | 2010-03-07 19:14:06 +0000 | |
|---|---|---|
| committer | 2010-03-07 19:14:06 +0000 | |
| commit | 651181863040466e733d06e0451a9ba8bb77c3c7 (patch) | |
| tree | ebb7bc7ad3affdf60db92b14736a5022dbf70f6d /src/modules/editor/scripteditor.cpp | |
| parent | compilation fix (diff) | |
| download | KVIrc-651181863040466e733d06e0451a9ba8bb77c3c7.tar.gz KVIrc-651181863040466e733d06e0451a9ba8bb77c3c7.tar.bz2 KVIrc-651181863040466e733d06e0451a9ba8bb77c3c7.zip | |
fixed editor highlightning
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@4109 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/editor/scripteditor.cpp')
| -rw-r--r-- | src/modules/editor/scripteditor.cpp | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/src/modules/editor/scripteditor.cpp b/src/modules/editor/scripteditor.cpp index 2291c0bec..1f56c214c 100644 --- a/src/modules/editor/scripteditor.cpp +++ b/src/modules/editor/scripteditor.cpp @@ -281,11 +281,11 @@ void KviScriptEditorWidget::updateOptions() setPalette(p); setFont(g_fntNormal); setTextColor(g_clrNormalText); - // this will rehighlight everything - setText(toPlainText()); // an "hack" to ensure Update all in the editor - if (!m_pSyntaxHighlighter) m_pSyntaxHighlighter = new KviScriptEditorSyntaxHighlighter(this); - else m_pSyntaxHighlighter->updateSyntaxtTextFormat(); - //(void)h; + // we currently delete and re-create the m_pSyntaxHighlighter + // as a trick to ensure proper re-highlightning to occur + if (m_pSyntaxHighlighter) delete m_pSyntaxHighlighter; + m_pSyntaxHighlighter = new KviScriptEditorSyntaxHighlighter(this); + p = ((KviScriptEditorImplementation*)m_pParent)->findLineEdit()->palette(); p.setColor(foregroundRole(),g_clrFind); ((KviScriptEditorImplementation*)m_pParent)->findLineEdit()->setPalette(p); @@ -604,27 +604,12 @@ KviScriptEditorSyntaxHighlighter::~KviScriptEditorSyntaxHighlighter() void KviScriptEditorSyntaxHighlighter::updateSyntaxtTextFormat() { punctuationFormat.setForeground(g_clrPunctuation); - punctuationFormat.setFont(g_fntNormal); - keywordFormat.setForeground(g_clrKeyword); - keywordFormat.setFont(g_fntNormal); - functionFormat.setForeground(g_clrFunction); - functionFormat.setFont(g_fntNormal); - - variableFormat.setForeground(g_clrVariable); - variableFormat.setFont(g_fntNormal); - - bracketFormat.setForeground(g_clrBracket); - bracketFormat.setFont(g_fntNormal); - - commentFormat.setFont(g_fntNormal); commentFormat.setForeground(g_clrComment); - findFormat.setForeground(g_clrFind); - findFormat.setFont(g_fntNormal); } void KviScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) |
