aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/KeyWords.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-03-30 11:41:02 +0000
committernyamatongwe <devnull@localhost>2000-03-30 11:41:02 +0000
commit75f7cfc96a7cc20ba1886c45b5be9022be85b75b (patch)
treecce59a9b4ab9bc790bae4c92dd8d76f3fc70dce1 /src/KeyWords.cxx
parent327c5b3dcd851eaf45cc232f64d665fae509e027 (diff)
downloadscintilla-mirror-75f7cfc96a7cc20ba1886c45b5be9022be85b75b.tar.gz
Fixed bugs in handling undo history.
Fixed bugs with null fonts.
Diffstat (limited to 'src/KeyWords.cxx')
-rw-r--r--src/KeyWords.cxx88
1 files changed, 45 insertions, 43 deletions
diff --git a/src/KeyWords.cxx b/src/KeyWords.cxx
index bc7882367..91ce04433 100644
--- a/src/KeyWords.cxx
+++ b/src/KeyWords.cxx
@@ -1,43 +1,45 @@
-// SciTE - Scintilla based Text Editor
-// KeyWords.cxx - colourise for particular languages
-// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
-// The License.txt file describes the conditions under which this software may be distributed.
-
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "Platform.h"
-
-#include "PropSet.h"
-#include "Accessor.h"
-#include "KeyWords.h"
-#include "Scintilla.h"
-#include "SciLexer.h"
-
-LexerModule *LexerModule::base = 0;
-
-LexerModule::LexerModule(int language_, LexerFunction fn_) :
- language(language_), fn(fn_) {
- next = base;
- base = this;
-}
-
-void LexerModule::Colourise(unsigned int startPos, int lengthDoc, int initStyle,
- int language, WordList *keywordlists[], StylingContext &styler) {
- LexerModule *lm = base;
- while (lm) {
- if (lm->language == language) {
- lm->fn(startPos, lengthDoc, initStyle, keywordlists, styler);
- return;
- }
- lm = lm->next;
- }
- // Unknown language
- // Null language means all style bytes are 0 so just mark the end - no need to fill in.
- styler.StartAt(startPos + lengthDoc - 1);
- styler.StartSegment(startPos + lengthDoc - 1);
- styler.ColourTo(startPos + lengthDoc - 1, 0);
-}
+// SciTE - Scintilla based Text Editor
+// KeyWords.cxx - colourise for particular languages
+// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#include "Platform.h"
+
+#include "PropSet.h"
+#include "Accessor.h"
+#include "KeyWords.h"
+#include "Scintilla.h"
+#include "SciLexer.h"
+
+LexerModule *LexerModule::base = 0;
+
+LexerModule::LexerModule(int language_, LexerFunction fn_) :
+ language(language_), fn(fn_) {
+ next = base;
+ base = this;
+}
+
+void LexerModule::Colourise(unsigned int startPos, int lengthDoc, int initStyle,
+ int language, WordList *keywordlists[], StylingContext &styler) {
+ LexerModule *lm = base;
+ while (lm) {
+ if (lm->language == language) {
+ lm->fn(startPos, lengthDoc, initStyle, keywordlists, styler);
+ return;
+ }
+ lm = lm->next;
+ }
+ // Unknown language
+ // Null language means all style bytes are 0 so just mark the end - no need to fill in.
+ if (lengthDoc > 0) {
+ styler.StartAt(startPos + lengthDoc - 1);
+ styler.StartSegment(startPos + lengthDoc - 1);
+ styler.ColourTo(startPos + lengthDoc - 1, 0);
+ }
+}