diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 80 | ||||
| -rw-r--r-- | src/Editor.h | 1 | ||||
| -rw-r--r-- | src/LexHTML.cxx | 141 | 
3 files changed, 11 insertions, 211 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index d1aba6885..89e1ce69d 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -12,9 +12,6 @@  #include "Platform.h" -#ifndef PLAT_QT -#define INCLUDE_DEPRECATED_FEATURES -#endif  #include "Scintilla.h"  #include "SplitVector.h" @@ -818,7 +815,6 @@ int Editor::MovePositionTo(int newPos, selTypes sel, bool ensureVisible) {  	if (ensureVisible) {  		EnsureCaretVisible();  	} -	NotifyMove(newPos);  	return 0;  } @@ -3074,66 +3070,26 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {  				ll->RestoreBracesHighlight(rangeLine, braces);  				bool expanded = cs.GetExpanded(lineDoc); -#ifdef INCLUDE_DEPRECATED_FEATURES -				if ((foldFlags & SC_FOLDFLAG_BOX) == 0) { -#endif -					// Paint the line above the fold -					if ((expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_EXPANDED)) -					        || -					        (!expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_CONTRACTED))) { -						if (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELHEADERFLAG) { -							PRectangle rcFoldLine = rcLine; -							rcFoldLine.bottom = rcFoldLine.top + 1; -							surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated); -						} -					} -					// Paint the line below the fold -					if ((expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_EXPANDED)) -					        || -					        (!expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_CONTRACTED))) { -						if (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELHEADERFLAG) { -							PRectangle rcFoldLine = rcLine; -							rcFoldLine.top = rcFoldLine.bottom - 1; -							surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated); -						} -					} -#ifdef INCLUDE_DEPRECATED_FEATURES -				} else { -					int FoldLevelCurr = (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE; -					int FoldLevelPrev = (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELNUMBERMASK) - SC_FOLDLEVELBASE; -					int FoldLevelFlags = (pdoc->GetLevel(lineDoc) & ~SC_FOLDLEVELNUMBERMASK) & ~(0xFFF0000); -					int indentationStep = pdoc->IndentSize(); -					// Draw line above fold -					if ((FoldLevelPrev < FoldLevelCurr) -					        || -					        (FoldLevelFlags & SC_FOLDLEVELBOXHEADERFLAG -					         && -					         (pdoc->GetLevel(lineDoc - 1) & SC_FOLDLEVELBOXFOOTERFLAG) == 0)) { +				// Paint the line above the fold +				if ((expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_EXPANDED)) +					|| +					(!expanded && (foldFlags & SC_FOLDFLAG_LINEBEFORE_CONTRACTED))) { +					if (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELHEADERFLAG) {  						PRectangle rcFoldLine = rcLine;  						rcFoldLine.bottom = rcFoldLine.top + 1; -						rcFoldLine.left += xStart + FoldLevelCurr * vs.spaceWidth * indentationStep - 1;  						surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated);  					} - -					// Line below the fold (or below a contracted fold) -					if (FoldLevelFlags & SC_FOLDLEVELBOXFOOTERFLAG -					        || -					        (!expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_CONTRACTED))) { +				} +				// Paint the line below the fold +				if ((expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_EXPANDED)) +					|| +					(!expanded && (foldFlags & SC_FOLDFLAG_LINEAFTER_CONTRACTED))) { +					if (pdoc->GetLevel(lineDoc) & SC_FOLDLEVELHEADERFLAG) {  						PRectangle rcFoldLine = rcLine;  						rcFoldLine.top = rcFoldLine.bottom - 1; -						rcFoldLine.left += xStart + (FoldLevelCurr) * vs.spaceWidth * indentationStep - 1;  						surface->FillRectangle(rcFoldLine, vs.styles[STYLE_DEFAULT].fore.allocated);  					} - -					PRectangle rcBoxLine = rcLine; -					// Draw vertical line for every fold level -					for (int i = 0; i <= FoldLevelCurr; i++) { -						rcBoxLine.left = xStart + i * vs.spaceWidth * indentationStep - 1; -						rcBoxLine.right = rcBoxLine.left + 1; -						surface->FillRectangle(rcBoxLine, vs.styles[STYLE_DEFAULT].fore.allocated); -					}  				} -#endif  				// Draw the Caret  				if (lineDoc == lineCaret) { @@ -3918,13 +3874,6 @@ void Editor::NotifyModifyAttempt(Document*, void *) {  	NotifyModifyAttempt();  } -void Editor::NotifyMove(int position) { -	SCNotification scn = {0}; -	scn.nmhdr.code = SCN_POSCHANGED; -	scn.position = position; -	NotifyParent(scn); -} -  void Editor::NotifySavePoint(Document*, void *, bool atSavePoint) {  	//Platform::DebugPrintf("** Save Point %s\n", atSavePoint ? "On" : "Off");  	NotifySavePoint(atSavePoint); @@ -7275,13 +7224,6 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {  	case SCI_SEARCHPREV:  		return SearchText(iMessage, wParam, lParam); -#ifdef INCLUDE_DEPRECATED_FEATURES -	case SCI_SETCARETPOLICY:  	// Deprecated -		caretXPolicy = caretYPolicy = wParam; -		caretXSlop = caretYSlop = lParam; -		break; -#endif -  	case SCI_SETXCARETPOLICY:  		caretXPolicy = wParam;  		caretXSlop = lParam; diff --git a/src/Editor.h b/src/Editor.h index d37606d5a..1c50e7390 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -362,7 +362,6 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	virtual void NotifyParent(SCNotification scn) = 0;  	virtual void NotifyStyleToNeeded(int endStyleNeeded);  	void NotifyChar(int ch); -	void NotifyMove(int position);  	void NotifySavePoint(bool isSavePoint);  	void NotifyModifyAttempt();  	virtual void NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt); diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index 99afa2309..3a28a01f8 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -2052,144 +2052,6 @@ static void ColouriseHTMLPiece(StyleContext &sc, WordList *keywordlists[]) {  	}  } -static void ColouriseASPPiece(StyleContext &sc, WordList *keywordlists[]) { -	// Possibly exit current state to either SCE_H_DEFAULT or SCE_HBA_DEFAULT -	if ((sc.state == SCE_H_ASPAT || isASPScript(sc.state)) && sc.Match('%', '>')) { -		sc.SetState(SCE_H_ASP); -		sc.Forward(); -		sc.ForwardSetState(SCE_H_DEFAULT); -	} - -	// Handle some ASP script -	if (sc.state >= SCE_HBA_START && sc.state <= SCE_HBA_STRINGEOL) { -		ColouriseHBAPiece(sc, keywordlists); -	} else if (sc.state >= SCE_H_DEFAULT && sc.state <= SCE_H_SGML_BLOCK_DEFAULT) { -		ColouriseHTMLPiece(sc, keywordlists); -	} - -	// Enter new sc.state -	if ((sc.state == SCE_H_DEFAULT) || (sc.state == SCE_H_TAGUNKNOWN)) { -		if (sc.Match('<', '%')) { -			if (sc.state == SCE_H_TAGUNKNOWN) -				sc.ChangeState(SCE_H_ASP); -			else -				sc.SetState(SCE_H_ASP); -			sc.Forward(); -			sc.Forward(); -			if (sc.ch == '@') { -				sc.ForwardSetState(SCE_H_ASPAT); -			} else { -				if (sc.ch == '=') { -					sc.Forward(); -				} -				sc.SetState(SCE_HBA_DEFAULT); -			} -		} -	} -} - -static void ColouriseASPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], -                                  Accessor &styler) { -	// Lexer for HTML requires more lexical states (8 bits worth) than most lexers -	StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX)); -	for (; sc.More(); sc.Forward()) { -		ColouriseASPPiece(sc, keywordlists); -	} -	sc.Complete(); -} - -static void ColourisePHPPiece(StyleContext &sc, WordList *keywordlists[]) { -	// Possibly exit current state to either SCE_H_DEFAULT or SCE_HBA_DEFAULT -	if (sc.state >= SCE_HPHP_DEFAULT && sc.state <= SCE_HPHP_OPERATOR) { -		if (!isPHPStringState(sc.state) && -			(sc.state != SCE_HPHP_COMMENT) && -			(sc.Match('?', '>'))) { -			sc.SetState(SCE_H_QUESTION); -			sc.Forward(); -			sc.ForwardSetState(SCE_H_DEFAULT); -		} -	} - -	if (sc.state >= SCE_H_DEFAULT && sc.state <= SCE_H_SGML_BLOCK_DEFAULT) { -		ColouriseHTMLPiece(sc, keywordlists); -	} - -	// Handle some PHP script -	if (sc.state == SCE_HPHP_WORD) { -		if (!IsPhpWordChar(static_cast<char>(sc.ch))) { -			sc.SetState(SCE_HPHP_DEFAULT); -		} -	} else if (sc.state == SCE_HPHP_COMMENTLINE) { -		if (sc.ch == '\r' || sc.ch == '\n') { -			sc.SetState(SCE_HPHP_DEFAULT); -		} -	} else if (sc.state == SCE_HPHP_COMMENT) { -		if (sc.Match('*', '/')) { -			sc.Forward(); -			sc.Forward(); -			sc.SetState(SCE_HPHP_DEFAULT); -		} -	} else if (sc.state == SCE_HPHP_HSTRING) { -		if (sc.ch == '\"') { -			sc.ForwardSetState(SCE_HPHP_DEFAULT); -		} -	} else if (sc.state == SCE_HPHP_SIMPLESTRING) { -		if (sc.ch == '\'') { -			sc.ForwardSetState(SCE_HPHP_DEFAULT); -		} -	} else if (sc.state == SCE_HPHP_VARIABLE) { -		if (!IsPhpWordChar(static_cast<char>(sc.ch))) { -			sc.SetState(SCE_HPHP_DEFAULT); -		} -	} else if (sc.state == SCE_HPHP_OPERATOR) { -		sc.SetState(SCE_HPHP_DEFAULT); -	} - -	// Enter new sc.state -	if ((sc.state == SCE_H_DEFAULT) || (sc.state == SCE_H_TAGUNKNOWN)) { -		if (sc.Match("<?php")) { -			sc.SetState(SCE_H_QUESTION); -			sc.Forward(); -			sc.Forward(); -			sc.Forward(); -			sc.Forward(); -			sc.Forward(); -			sc.SetState(SCE_HPHP_DEFAULT); -		} -	} -	if (sc.state == SCE_HPHP_DEFAULT) { -		if (IsPhpWordStart(static_cast<char>(sc.ch))) { -			sc.SetState(SCE_HPHP_WORD); -		} else if (sc.ch == '#') { -			sc.SetState(SCE_HPHP_COMMENTLINE); -		} else if (sc.Match("<!--")) { -			sc.SetState(SCE_HPHP_COMMENTLINE); -		} else if (sc.Match('/', '/')) { -			sc.SetState(SCE_HPHP_COMMENTLINE); -		} else if (sc.Match('/', '*')) { -			sc.SetState(SCE_HPHP_COMMENT); -		} else if (sc.ch == '\"') { -			sc.SetState(SCE_HPHP_HSTRING); -		} else if (sc.ch == '\'') { -			sc.SetState(SCE_HPHP_SIMPLESTRING); -		} else if (sc.ch == '$' && IsPhpWordStart(static_cast<char>(sc.chNext))) { -			sc.SetState(SCE_HPHP_VARIABLE); -		} else if (IsOperator(static_cast<char>(sc.ch))) { -			sc.SetState(SCE_HPHP_OPERATOR); -		} -	} -} - -static void ColourisePHPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], -                                  Accessor &styler) { -	// Lexer for HTML requires more lexical states (8 bits worth) than most lexers -	StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX)); -	for (; sc.More(); sc.Forward()) { -		ColourisePHPPiece(sc, keywordlists); -	} -	sc.Complete(); -} -  static void ColourisePHPScriptDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],          Accessor &styler) {  	if (startPos == 0) @@ -2219,7 +2081,4 @@ static const char * const phpscriptWordListDesc[] = {  LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8);  LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8); -// SCLEX_ASP and SCLEX_PHP should not be used in new code: use SCLEX_HTML instead. -LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 8); -LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 8);  LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8); | 
