diff --git a/apps/opencs/view/world/scriptedit.cpp b/apps/opencs/view/world/scriptedit.cpp index 8cb4494bb..1105404b3 100644 --- a/apps/opencs/view/world/scriptedit.cpp +++ b/apps/opencs/view/world/scriptedit.cpp @@ -52,7 +52,6 @@ CSVWorld::ScriptEdit::ScriptEdit( mMonoFont(QFont("Monospace")), mTabCharCount(4), mMarkOccurrences(true), - mMarkOccurrencesRunning(false), mDocument(document), mWhiteListQoutes("^[a-z|_]{1}[a-z|0-9|_]{0,}$", Qt::CaseInsensitive) { @@ -90,7 +89,7 @@ CSVWorld::ScriptEdit::ScriptEdit( <setMarkedWord(word.toStdString()); mHighlighter->rehighlight(); - - mMarkOccurrencesRunning = false; } } diff --git a/apps/opencs/view/world/scriptedit.hpp b/apps/opencs/view/world/scriptedit.hpp index b1e70a4c8..b0a4b0577 100644 --- a/apps/opencs/view/world/scriptedit.hpp +++ b/apps/opencs/view/world/scriptedit.hpp @@ -56,7 +56,6 @@ namespace CSVWorld QFont mMonoFont; int mTabCharCount; bool mMarkOccurrences; - bool mMarkOccurrencesRunning; QAction *mCommentAction; QAction *mUncommentAction; diff --git a/apps/opencs/view/world/scripthighlighter.cpp b/apps/opencs/view/world/scripthighlighter.cpp index 7e6ea5844..6aba66053 100644 --- a/apps/opencs/view/world/scripthighlighter.cpp +++ b/apps/opencs/view/world/scripthighlighter.cpp @@ -73,7 +73,7 @@ void CSVWorld::ScriptHighlighter::highlight (const Compiler::TokenLoc& loc, Type index -= length; QTextCharFormat scheme = mScheme[type]; - if (mMarkOccurrences && loc.mLiteral == mMarkedWord) + if (mMarkOccurrences && type == Type_Name && loc.mLiteral == mMarkedWord) scheme.merge(mScheme[Type_Highlight]); setFormat (index, length, scheme);