Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /lexers/LexLua.cxx [9c28a4] .. [5a1754] Maximize Restore

  Switch to side-by-side view

--- a/lexers/LexLua.cxx
+++ b/lexers/LexLua.cxx
@@ -132,39 +132,22 @@
 		if (sc.state == SCE_LUA_OPERATOR) {
 			if (sc.ch == ':' && sc.chPrev == ':') {	// :: <label> :: forward scan
 				sc.Forward();
-				int ln = 0, maxln = startPos + length - sc.currentPos;
-				int c;
-				while (ln < maxln) {		// determine line extent
-					c = sc.GetRelative(ln);
-					if (c == '\r' || c == '\n')
-						break;
+				int ln = 0;
+				while (IsASpaceOrTab(sc.GetRelative(ln)))	// skip over spaces/tabs
 					ln++;
-				}
-				maxln = ln; ln = 0;
-				while (ln < maxln) {		// skip over spaces/tabs
-					if (!IsASpaceOrTab(sc.GetRelative(ln)))
-						break;
-					ln++;
-				}
 				int ws1 = ln;
 				if (setWordStart.Contains(sc.GetRelative(ln))) {
-					int i = 0;
+					int c, i = 0;
 					char s[100];
-					while (ln < maxln) {	// get potential label
-						c = sc.GetRelative(ln);
-						if (!setWord.Contains(c))
-							break;
+					while (setWord.Contains(c = sc.GetRelative(ln))) {	// get potential label
 						if (i < 90)
 							s[i++] = c;
 						ln++;
 					}
 					s[i] = '\0'; int lbl = ln;
 					if (!keywords.InList(s)) {
-						while (ln < maxln) {		// skip over spaces/tabs
-							if (!IsASpaceOrTab(sc.GetRelative(ln)))
-								break;
+						while (IsASpaceOrTab(sc.GetRelative(ln)))	// skip over spaces/tabs
 							ln++;
-						}
 						int ws2 = ln - lbl;
 						if (sc.GetRelative(ln) == ':' && sc.GetRelative(ln + 1) == ':') {
 							// final :: found, complete valid label construct