From 263cece0ce202cf4c6b67e4d0ca156bcd36f5afd Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Thu, 8 Dec 2022 10:46:39 +0800 Subject: [PATCH] import makefile highlighter --- NEWS.md | 1 + .../qsynedit/highlighter/makefilehighlighter.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/NEWS.md b/NEWS.md index 4200c217..763d3829 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ Red Panda C++ Version 2.6 - enhancement: Highlighter for makefiles + - fix: QSortFilterProxyModel not correctly cleared when exiting and project closed. (ASSERT fails in DEBUG mode.) Red Panda C++ Version 2.5 diff --git a/libs/qsynedit/qsynedit/highlighter/makefilehighlighter.cpp b/libs/qsynedit/qsynedit/highlighter/makefilehighlighter.cpp index ef54516c..58771b4e 100644 --- a/libs/qsynedit/qsynedit/highlighter/makefilehighlighter.cpp +++ b/libs/qsynedit/qsynedit/highlighter/makefilehighlighter.cpp @@ -511,6 +511,12 @@ void MakefileHighlighter::next() case '#': procComment(); break; + case '-': + if (mState == RangeState::Command) + procSymbol(); + else + procIdentifier(); + break; default: if (mLine[mRun]>='0' && mLine[mRun]<='9') { procNumber(); @@ -606,6 +612,10 @@ void MakefileHighlighter::next() if (mLine[mRun+1]=='=') { mRun++; procAssignment(); + } else if (mLine[mRun+1]==':') { + mRun+=2; + mTokenID = TokenId::Target; + mState = RangeState::Prequisitions; } else { mRun++; mTokenID = TokenId::Target;