aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-08-30 11:07:33 +0000
committernyamatongwe <unknown>2005-08-30 11:07:33 +0000
commit4f8c51ef2e37f152640afa8565716435b256172c (patch)
tree1f359ea0977818f6efbafb8d5c5d2fbfa7bdd473 /src
parent203b397eb52cbdd7355e00006adb489780378307 (diff)
downloadscintilla-mirror-4f8c51ef2e37f152640afa8565716435b256172c.tar.gz
Added StyleBitsNeeded property and implemented to return 5 for all lexers
except HTML, XML, ... (7) and Ruby (6).
Diffstat (limited to 'src')
-rw-r--r--src/KeyWords.cxx18
-rw-r--r--src/LexHTML.cxx10
-rw-r--r--src/LexRuby.cxx2
-rw-r--r--src/ScintillaBase.cxx3
4 files changed, 21 insertions, 12 deletions
diff --git a/src/KeyWords.cxx b/src/KeyWords.cxx
index d1b9614e5..f932b877e 100644
--- a/src/KeyWords.cxx
+++ b/src/KeyWords.cxx
@@ -22,14 +22,18 @@
const LexerModule *LexerModule::base = 0;
int LexerModule::nextLanguage = SCLEX_AUTOMATIC+1;
-LexerModule::LexerModule(int language_, LexerFunction fnLexer_,
- const char *languageName_, LexerFunction fnFolder_,
- const char * const wordListDescriptions_[]) :
+LexerModule::LexerModule(int language_,
+ LexerFunction fnLexer_,
+ const char *languageName_,
+ LexerFunction fnFolder_,
+ const char * const wordListDescriptions_[],
+ int styleBits_) :
language(language_),
fnLexer(fnLexer_),
fnFolder(fnFolder_),
wordListDescriptions(wordListDescriptions_),
- languageName(languageName_) {
+ languageName(languageName_),
+ styleBits(styleBits_) {
next = base;
base = this;
if (language == SCLEX_AUTOMATIC) {
@@ -52,7 +56,7 @@ int LexerModule::GetNumWordLists() const {
}
}
-const char * LexerModule::GetWordListDescription(int index) const {
+const char *LexerModule::GetWordListDescription(int index) const {
static const char *emptyStr = "";
PLATFORM_ASSERT(index < GetNumWordLists());
@@ -63,6 +67,10 @@ const char * LexerModule::GetWordListDescription(int index) const {
}
}
+int LexerModule::GetStyleBitsNeeded() const {
+ return styleBits;
+}
+
const LexerModule *LexerModule::Find(int language) {
const LexerModule *lm = base;
while (lm) {
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx
index 036bf1a8f..616b3acfd 100644
--- a/src/LexHTML.cxx
+++ b/src/LexHTML.cxx
@@ -1993,9 +1993,9 @@ static const char * const phpscriptWordListDesc[] = {
0,
};
-LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext", 0, htmlWordListDesc);
-LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml", 0, htmlWordListDesc);
+LexerModule lmHTML(SCLEX_HTML, ColouriseHyperTextDoc, "hypertext", 0, htmlWordListDesc, 7);
+LexerModule lmXML(SCLEX_XML, ColouriseHyperTextDoc, "xml", 0, htmlWordListDesc, 7);
// SCLEX_ASP and SCLEX_PHP should not be used in new code: use SCLEX_HTML instead.
-LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc);
-LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc);
-LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc);
+LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 7);
+LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 7);
+LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 7);
diff --git a/src/LexRuby.cxx b/src/LexRuby.cxx
index 878071a53..e8a4d2917 100644
--- a/src/LexRuby.cxx
+++ b/src/LexRuby.cxx
@@ -1253,4 +1253,4 @@ static const char * const rubyWordListDesc[] = {
0
};
-LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc);
+LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc, 6);
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index b650d19c5..9c88af0d6 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -689,7 +689,6 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
case SCI_GETPROPERTYINT:
return props.GetInt(reinterpret_cast<const char *>(wParam), lParam);
-
case SCI_SETKEYWORDS:
if (wParam < numWordLists) {
keyWordLists[wParam]->Clear();
@@ -701,6 +700,8 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
SetLexerLanguage(reinterpret_cast<const char *>(lParam));
break;
+ case SCI_GETSTYLEBITSNEEDED:
+ return lexCurrent ? lexCurrent->GetStyleBitsNeeded() : 5;
#endif
default: