diff options
| author | nyamatongwe <devnull@localhost> | 2001-02-27 01:12:47 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2001-02-27 01:12:47 +0000 | 
| commit | 092d0572b39dea08d13c8a5c0f17fdbec2d99cd0 (patch) | |
| tree | 22b082b24bb31300a43cef5b26c824a7fcda3f32 | |
| parent | e25dda1fdca3e282f7aaf4bf5cd5068031aad57d (diff) | |
| download | scintilla-mirror-092d0572b39dea08d13c8a5c0f17fdbec2d99cd0.tar.gz | |
Patch from Philippe to regularise comments.
| -rw-r--r-- | src/DocumentAccessor.cxx | 26 | ||||
| -rw-r--r-- | src/KeyWords.cxx | 12 | ||||
| -rw-r--r-- | src/LexAVE.cxx | 48 | ||||
| -rw-r--r-- | src/LexCPP.cxx | 18 | ||||
| -rw-r--r-- | src/LexConf.cxx | 86 | ||||
| -rw-r--r-- | src/LexHTML.cxx | 4 | ||||
| -rw-r--r-- | src/LexLua.cxx | 8 | ||||
| -rw-r--r-- | src/LexOthers.cxx | 2 | ||||
| -rw-r--r-- | src/LexPascal.cxx | 37 | ||||
| -rw-r--r-- | src/LexPerl.cxx | 2 | ||||
| -rw-r--r-- | src/LexPython.cxx | 32 | ||||
| -rw-r--r-- | src/LexSQL.cxx | 14 | ||||
| -rw-r--r-- | src/LexVB.cxx | 14 | ||||
| -rw-r--r-- | win32/PlatWin.cxx | 40 | ||||
| -rw-r--r-- | win32/ScintillaWin.cxx | 68 | 
15 files changed, 208 insertions, 203 deletions
| diff --git a/src/DocumentAccessor.cxx b/src/DocumentAccessor.cxx index 9cce5d5b4..4cb90c3e4 100644 --- a/src/DocumentAccessor.cxx +++ b/src/DocumentAccessor.cxx @@ -1,4 +1,4 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file DocumentAccessor.cxx   ** Rapid easy access to contents of a Scintilla.   **/ @@ -7,7 +7,7 @@  #include <stdlib.h>  #include <string.h> -#include <ctype.h>  +#include <ctype.h>  #include <stdio.h>  #include "Platform.h" @@ -23,12 +23,12 @@  DocumentAccessor::~DocumentAccessor() {  } -#if PLAT_WIN  +#if PLAT_WIN  bool DocumentAccessor::InternalIsLeadByte(char ch) {  	if (SC_CP_UTF8 == codePage)  		// For lexing, all characters >= 0x80 are treated the  		// same so none is considered a lead byte. -		return false;	 +		return false;  	else  		return IsDBCSLeadByteEx(codePage, ch);  } @@ -38,7 +38,7 @@ bool DocumentAccessor::InternalIsLeadByte(char ch) {  bool DocumentAccessor::InternalIsLeadByte(char) {  	return false;  } -#endif  +#endif  void DocumentAccessor::Fill(int position) {  	if (lenDoc == -1) @@ -72,10 +72,10 @@ int DocumentAccessor::LevelAt(int line) {  	return pdoc->GetLevel(line);  } -int DocumentAccessor::Length() {  -	if (lenDoc == -1)  +int DocumentAccessor::Length() { +	if (lenDoc == -1)  		lenDoc = pdoc->Length(); -	return lenDoc;  +	return lenDoc;  }  int DocumentAccessor::GetLineState(int line) { @@ -134,12 +134,12 @@ void DocumentAccessor::Flush() {  int DocumentAccessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnIsCommentLeader) {  	int end = Length();  	int spaceFlags = 0; -	 -	// Determines the indentation level of the current line and also checks for consistent  + +	// Determines the indentation level of the current line and also checks for consistent  	// indentation compared to the previous line. -	// Indentation is judged consistent when the indentation whitespace of each line lines  +	// Indentation is judged consistent when the indentation whitespace of each line lines  	// the same or the indentation of one line is a prefix of the other. -	 +  	int pos = LineStart(line);  	char ch = (*this)[pos];  	int indent = 0; @@ -166,7 +166,7 @@ int DocumentAccessor::IndentAmount(int line, int *flags, PFNIsCommentLeader pfnI  		}  		ch = (*this)[++pos];  	} -	 +  	*flags = spaceFlags;  	indent += SC_FOLDLEVELBASE;  	// if completely empty line or the start of a comment... diff --git a/src/KeyWords.cxx b/src/KeyWords.cxx index 17c0277de..a275c1963 100644 --- a/src/KeyWords.cxx +++ b/src/KeyWords.cxx @@ -1,15 +1,15 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file KeyWords.cxx   ** Colourise for particular languages.   **/  // Copyright 1998-2001 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 <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h>  #include "Platform.h" diff --git a/src/LexAVE.cxx b/src/LexAVE.cxx index 8ef79c6a3..280ca6470 100644 --- a/src/LexAVE.cxx +++ b/src/LexAVE.cxx @@ -2,14 +2,14 @@  /** @file LexAVE.cxx   ** Lexer for Avenue.   **/ -// Copyright 1998-2000 by Neil Hodgson <neilh@scintilla.org> +// Copyright 1998-2001 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 <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h>  #include "Platform.h" @@ -19,13 +19,13 @@  #include "Scintilla.h"  #include "SciLexer.h" -static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],  +static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],  	Accessor &styler) { -	 +  	WordList &keywords = *keywordlists[0]; -	 +  	styler.StartAt(startPos); -	 +  	bool fold = styler.GetPropertyInt("fold");  	int lineCurrent = styler.GetLine(startPos);  	int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; @@ -82,7 +82,7 @@ static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, Wo  				state = SCE_AVE_STRING;  			} else if (ch == '#') {  				styler.ColourTo(i-1, state); -				state = SCE_AVE_ENUM;  +				state = SCE_AVE_ENUM;  			} else if (isoperator(ch) ) {  				styler.ColourTo(i-1, state);  				styler.ColourTo(i, SCE_AVE_OPERATOR); @@ -115,7 +115,7 @@ static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, Wo  				styler.ColourTo(i-1, SCE_AVE_STRINGEOL);  				state = SCE_AVE_STRINGEOL;  			} -		}  +		}  		if ((state == SCE_AVE_IDENTIFIER)) {  			if (!iswordchar(ch) || ch == '.' ) {  				char s[100]; @@ -131,39 +131,39 @@ static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, Wo  				if (isdigit(s[0]))  					chAttr = SCE_AVE_NUMBER;  				else { -					if ((strcmp(s, "for") == 0) || (strcmp(s, "if") == 0) || (strcmp(s, "while") == 0))	 +					if ((strcmp(s, "for") == 0) || (strcmp(s, "if") == 0) || (strcmp(s, "while") == 0))  					{  						levelCurrent +=1;  						chAttr = SCE_AVE_STATEMENT;  					} -					if (strcmp(s, "end") == 0)	 +					if (strcmp(s, "end") == 0)  					{  						levelCurrent -=1;  						chAttr = SCE_AVE_STATEMENT;  					} -						 +  					if ( (strcmp(s, "then") == 0) ||  (strcmp(s, "else") == 0)       || (strcmp(s, "break") == 0) || -						(strcmp(s, "each") == 0) ||  +						(strcmp(s, "each") == 0) ||  						(strcmp(s, "exit") == 0) ||  (strcmp(s, "continue") == 0) || (strcmp(s, "return") == 0) || -						(strcmp(s, "by") == 0)   ||  (strcmp(s, "in") == 0)          || (strcmp(s, "elseif") == 0))	 +						(strcmp(s, "by") == 0)   ||  (strcmp(s, "in") == 0)          || (strcmp(s, "elseif") == 0))  					{  						chAttr = SCE_AVE_STATEMENT;  					} -					if ((strcmp(s, "av") == 0) || (strcmp(s, "self") == 0))	 +					if ((strcmp(s, "av") == 0) || (strcmp(s, "self") == 0))  					{  						chAttr = SCE_AVE_KEYWORD;  					} -							 -					if (keywords.InList(s))  + +					if (keywords.InList(s))  					{ -						chAttr = SCE_AVE_WORD;						 +						chAttr = SCE_AVE_WORD;  					}  				}  				styler.ColourTo(end, chAttr);  				state = SCE_AVE_DEFAULT; -				 +  				if (ch == '\'') {  					state = SCE_AVE_COMMENT;  				} else if (ch == '\"') { @@ -172,7 +172,7 @@ static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, Wo  					styler.ColourTo(i, SCE_AVE_OPERATOR);  				}  			} -		}  +		}  	}  	styler.ColourTo(lengthDoc - 1, state); @@ -181,7 +181,7 @@ static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, Wo  	if (fold) {  		int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;  		styler.SetLevel(lineCurrent, levelPrev | flagsNext); -		 +  	}  } diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index aaa16d4e6..f150e71fa 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -1,4 +1,4 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file LexCPP.cxx   ** Lexer for C++, C, Java, and Javascript.   **/ @@ -32,7 +32,7 @@ static bool classifyWordCpp(unsigned int start, unsigned int end, WordList &keyw  	else {  		if (keywords.InList(s)) {  			chAttr = SCE_C_WORD; -			wordIsUUID = strcmp(s, "uuid") == 0;  +			wordIsUUID = strcmp(s, "uuid") == 0;  		}  	}  	styler.ColourTo(end, chAttr); @@ -43,13 +43,13 @@ static bool isOKBeforeRE(char ch) {  	return (ch == '(') || (ch == '=') || (ch == ',');  } -static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],  +static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],  	Accessor &styler) { -	 +  	WordList &keywords = *keywordlists[0]; -	 +  	styler.StartAt(startPos); -	 +  	bool fold = styler.GetPropertyInt("fold");  	bool foldComment = styler.GetPropertyInt("fold.comment");  	bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor"); @@ -198,7 +198,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo  			} else if (state == SCE_C_COMMENT) {  				if (ch == '/' && chPrev == '*') {  					if (((i > styler.GetStartSegment() + 2) || ( -						(initStyle == SCE_C_COMMENT) &&  +						(initStyle == SCE_C_COMMENT) &&  						(styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {  						styler.ColourTo(i, state);  						state = SCE_C_DEFAULT; @@ -209,7 +209,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo  			} else if (state == SCE_C_COMMENTDOC) {  				if (ch == '/' && chPrev == '*') {  					if (((i > styler.GetStartSegment() + 2) || ( -						(initStyle == SCE_C_COMMENTDOC) &&  +						(initStyle == SCE_C_COMMENTDOC) &&  						(styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {  						styler.ColourTo(i, state);  						state = SCE_C_DEFAULT; @@ -293,7 +293,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo  		int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;  		//styler.SetLevel(lineCurrent, levelCurrent | flagsNext);  		styler.SetLevel(lineCurrent, levelPrev | flagsNext); -		 +  	}  } diff --git a/src/LexConf.cxx b/src/LexConf.cxx index f3578428e..6ffcd1d71 100644 --- a/src/LexConf.cxx +++ b/src/LexConf.cxx @@ -1,21 +1,19 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control +/** @file LexConf.cxx + ** Lexer for Apache Configuration Files. + ** + ** First working version contributed by Ahmad Zawawi <zeus_go64@hotmail.com> on October 28, 2000. + ** i created this lexer because i needed something pretty when dealing + ** when Apache Configuration files... + **/  // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> -// -// NAME -// 	LexConf.cxx - lexer for Apache Configuration Files -// AUTHOR -// 	first working version contributed by Ahmad Zawawi <zeus_go64@hotmail.com> on October 28, 2000 -// DESCRIPTION -// 	i created this lexer because i needed something pretty when dealing -// when Apache Configuration files... -// - - -#include <stdlib.h>  -#include <string.h>  -#include <ctype.h>  -#include <stdio.h>  -#include <stdarg.h>  +// 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" @@ -25,27 +23,27 @@  #include "Scintilla.h"  #include "SciLexer.h" -static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)  +static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *keywordLists[], Accessor &styler)  {  	int state = SCE_CONF_DEFAULT;  	char chNext = styler[startPos];  	int lengthDoc = startPos + length;  	// create a buffer large enough to take the largest chunk... -	char *buffer = new char[length];  +	char *buffer = new char[length];  	int bufferCount = 0;  	// this assumes that we have 2 keyword list in conf.properties  	WordList &directives = *keywordLists[0];  	WordList ¶ms = *keywordLists[1]; -	 +  	// go through all provided text segment  	// using the hand-written state machine shown below -	styler.StartAt(startPos);	 -	styler.StartSegment(startPos);	 +	styler.StartAt(startPos); +	styler.StartSegment(startPos);  	for (int i = startPos; i < lengthDoc; i++) {  		char ch = chNext;  		chNext = styler.SafeGetCharAt(i + 1); -				 +  		if (styler.IsLeadByte(ch)) {  			chNext = styler.SafeGetCharAt(i + 2);  			i++; @@ -64,7 +62,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  				} else if( ch == '.' /*|| ch == '/'*/) {  					// signals the start of a file...  					state = SCE_CONF_EXTENSION; -					styler.ColourTo(i,SCE_CONF_EXTENSION);					 +					styler.ColourTo(i,SCE_CONF_EXTENSION);  				} else if( ch == '"') {  					state = SCE_CONF_STRING;  					styler.ColourTo(i,SCE_CONF_STRING); @@ -74,14 +72,14 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  					// simple case...  					styler.ColourTo(i,SCE_CONF_OPERATOR);  				} else if( isalpha(ch) ) { -					// signals the start of an identifier  +					// signals the start of an identifier  					bufferCount = 0;  					buffer[bufferCount++] = static_cast<char>(tolower(ch));  					state = SCE_CONF_IDENTIFIER;  				} else if( isdigit(ch) ) {  					// signals the start of a number  					bufferCount = 0; -					buffer[bufferCount++] = ch;					 +					buffer[bufferCount++] = ch;  					//styler.ColourTo(i,SCE_CONF_NUMBER);  					state = SCE_CONF_NUMBER;  				} else { @@ -89,7 +87,7 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  					styler.ColourTo(i,SCE_CONF_DEFAULT);  				}  				break; -			 +  			case SCE_CONF_COMMENT:  				// if we find a newline here,  				// we simply go to default state @@ -105,9 +103,9 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  				// if we find a non-alphanumeric char,  				// we simply go to default state  				// else we're still dealing with an extension... -				if( isalnum(ch) || (ch == '_') ||  -					(ch == '-') || (ch == '$') ||  -					(ch == '/') || (ch == '.') || (ch == '*') )  +				if( isalnum(ch) || (ch == '_') || +					(ch == '-') || (ch == '$') || +					(ch == '/') || (ch == '.') || (ch == '*') )  				{  					styler.ColourTo(i,SCE_CONF_EXTENSION);  				} else { @@ -115,16 +113,16 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  					chNext = styler[i--];  				}  				break; -			 +  			case SCE_CONF_STRING:  				// if we find the end of a string char, we simply go to default state  				// else we're still dealing with an string...  				if( (ch == '"' && styler.SafeGetCharAt(i-1)!='\\') || (ch == '\n') || (ch == '\r') ) {  					state = SCE_CONF_DEFAULT; -				}  -				styler.ColourTo(i,SCE_CONF_STRING);				 +				} +				styler.ColourTo(i,SCE_CONF_STRING);  				break; -				 +  			case SCE_CONF_IDENTIFIER:  				// stay  in CONF_IDENTIFIER state until we find a non-alphanumeric  				if( isalnum(ch) || (ch == '_') || (ch == '-') || (ch == '/') || (ch == '$') || (ch == '.') || (ch == '*')) { @@ -132,8 +130,8 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  				} else {  					state = SCE_CONF_DEFAULT;  					buffer[bufferCount] = '\0'; -					 -					// check if the buffer contains a keyword, and highlight it if it is a keyword...					 + +					// check if the buffer contains a keyword, and highlight it if it is a keyword...  					if(directives.InList(buffer)) {  						styler.ColourTo(i-1,SCE_CONF_DIRECTIVE );  					} else if(params.InList(buffer)) { @@ -143,21 +141,21 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  					} else {  						styler.ColourTo(i-1,SCE_CONF_DEFAULT);  					} -					 +  					// push back the faulty character  					chNext = styler[i--]; -					 +  				}  				break; -			 +  			case SCE_CONF_NUMBER:  				// stay  in CONF_NUMBER state until we find a non-numeric  				if( isdigit(ch) || ch == '.') {  					buffer[bufferCount++] = ch;  				} else {  					state = SCE_CONF_DEFAULT; -					buffer[bufferCount] = '\0';					 -					 +					buffer[bufferCount] = '\0'; +  					// Colourize here...  					if( strchr(buffer,'.') ) {  						// it is an IP address... @@ -166,13 +164,13 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k  						// normal number  						styler.ColourTo(i-1,SCE_CONF_NUMBER);  					} -					 +  					// push back a character  					chNext = styler[i--];  				}  				break; -				 -		}                + +		}  	}  } diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index 800e46fee..8925c51b6 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -1,4 +1,4 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file LexHTML.cxx   ** Lexer for HTML.   **/ @@ -449,7 +449,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty  			case SCE_H_SINGLESTRING:  			case SCE_HJ_COMMENT:  			case SCE_HJ_COMMENTDOC: -			// SCE_HJ_COMMENTLINE removed as this is a common thing done to hide  +			// SCE_HJ_COMMENTLINE removed as this is a common thing done to hide  			// the end of script marker from some JS interpreters.  			//case SCE_HJ_COMMENTLINE:  			case SCE_HJ_DOUBLESTRING: diff --git a/src/LexLua.cxx b/src/LexLua.cxx index 8eda566aa..86c690dcb 100644 --- a/src/LexLua.cxx +++ b/src/LexLua.cxx @@ -1,5 +1,9 @@ -// LexLua.cxx - lexer for Lua language -// Written by Paul Winwood +// Scintilla source code edit control +/** @file LexLua.cxx + ** Lexer for Lua language. + ** + ** Written by Paul Winwood. + **/  #include <stdlib.h>  #include <string.h> diff --git a/src/LexOthers.cxx b/src/LexOthers.cxx index 83657e019..f3acd2f9d 100644 --- a/src/LexOthers.cxx +++ b/src/LexOthers.cxx @@ -1,4 +1,4 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file LexOthers.cxx   ** Lexers for batch files, diff results, properties files, make files and error lists.   ** Also lexer for LaTeX documents. diff --git a/src/LexPascal.cxx b/src/LexPascal.cxx index 458640767..b8c814116 100644 --- a/src/LexPascal.cxx +++ b/src/LexPascal.cxx @@ -1,11 +1,14 @@ -// SciTE - Scintilla based Text Editor -// LexPascal.cxx - lexer for Pascal +// Scintilla source code edit control +/** @file LexPascal.cxx + ** Lexer for Pascal. + ** Written by Laurent le Tynevez + **/ -#include <stdlib.h>  -#include <string.h>  -#include <ctype.h>  -#include <stdio.h>  -#include <stdarg.h>  +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h>  #include "Platform.h" @@ -40,12 +43,12 @@ static int classifyWordPascal(unsigned int start, unsigned int end, WordList &ke  	return lev;  } -static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],  +static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],  	Accessor &styler) {  	WordList &keywords = *keywordlists[0]; -	 +  	styler.StartAt(startPos); -	 +  	bool fold = styler.GetPropertyInt("fold");  	int lineCurrent = styler.GetLine(startPos);  	int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; @@ -100,8 +103,8 @@ static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle,  			} else if (ch == '{' && chNext != '$' && chNext != '&') {  				styler.ColourTo(i-1, state);  				state = SCE_C_COMMENT; -			} else if (ch == '(' && chNext == '*'  -						&& styler.SafeGetCharAt(i + 2) != '$'  +			} else if (ch == '(' && chNext == '*' +						&& styler.SafeGetCharAt(i + 2) != '$'  						&& styler.SafeGetCharAt(i + 2) != '&') {  				styler.ColourTo(i-1, state);  				state = SCE_C_COMMENTDOC; @@ -120,7 +123,7 @@ static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle,  			} else if (isoperator(ch)) {  				styler.ColourTo(i-1, state);  				styler.ColourTo(i, SCE_C_OPERATOR); -			 +  			}  		} else if (state == SCE_C_IDENTIFIER) {  			if (!iswordchar(ch)) { @@ -129,8 +132,8 @@ static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle,  				chNext = styler.SafeGetCharAt(i + 1);  				if (ch == '{' && chNext != '$' && chNext != '&') {  					state = SCE_C_COMMENT; -				} else if (ch == '(' && chNext == '*'  -						&& styler.SafeGetCharAt(i + 2) != '$'  +				} else if (ch == '(' && chNext == '*' +						&& styler.SafeGetCharAt(i + 2) != '$'  						&& styler.SafeGetCharAt(i + 2) != '&') {  					styler.ColourTo(i-1, state);  					state = SCE_C_COMMENTDOC; @@ -164,7 +167,7 @@ static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle,  			} else if (state == SCE_C_COMMENTDOC) {  				if (ch == ')' && chPrev == '*') {  					if (((i > styler.GetStartSegment() + 2) || ( -						(initStyle == SCE_C_COMMENTDOC) &&  +						(initStyle == SCE_C_COMMENTDOC) &&  						(styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {  							styler.ColourTo(i, state);  							state = SCE_C_DEFAULT; @@ -214,7 +217,7 @@ static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle,  		int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;  		//styler.SetLevel(lineCurrent, levelCurrent | flagsNext);  		styler.SetLevel(lineCurrent, levelPrev | flagsNext); -		 +  	}  } diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx index 2dc539c0f..08c8d4e86 100644 --- a/src/LexPerl.cxx +++ b/src/LexPerl.cxx @@ -1,4 +1,4 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file LexPerl.cxx   ** Lexer for subset of Perl.   **/ diff --git a/src/LexPython.cxx b/src/LexPython.cxx index f14dbfe07..e10991b41 100644 --- a/src/LexPython.cxx +++ b/src/LexPython.cxx @@ -1,15 +1,15 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file LexPython.cxx   ** Lexer for Python.   **/  // Copyright 1998-2001 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 <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h>  #include "Platform.h" @@ -139,7 +139,7 @@ static int GetPyStringState(Accessor &styler, int i, int *nextIndex) {  	}  } -static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,  +static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,  						   WordList *keywordlists[], Accessor &styler) {  	int lengthDoc = startPos + length; @@ -152,16 +152,16 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,  			startPos = styler.LineStart(lineCurrent);  			if (startPos == 0)  				initStyle = SCE_P_DEFAULT; -			else  +			else  				initStyle = styler.StyleAt(startPos-1);  		}  	} -	 +  	// Python uses a different mask because bad indentation is marked by oring with 32  	styler.StartAt(startPos, 127); -	 +  	WordList &keywords = *keywordlists[0]; -	 +  	bool fold = styler.GetPropertyInt("fold");  	int whingeLevel = styler.GetPropertyInt("tab.timmy.whinge.level");  	char prevWord[200]; @@ -173,7 +173,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,  	int state = initStyle & 31;  	int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment); -	if ((state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE))  +	if ((state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE))  		indentCurrent |= SC_FOLDLEVELWHITEFLAG;  	int nextIndex = 0; @@ -183,7 +183,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,  	styler.StartSegment(startPos);  	bool atStartLine = true;  	for (int i = startPos; i < lengthDoc; i++) { -	 +  		if (atStartLine) {  			char chBad = static_cast<char>(64);  			char chGood = static_cast<char>(0); @@ -200,11 +200,11 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,  			styler.SetFlags(chFlags, static_cast<char>(state));  			atStartLine = false;  		} -		 +  		char ch = chNext;  		chNext = styler.SafeGetCharAt(i + 1);  		char chNext2 = styler.SafeGetCharAt(i + 2); -		 +  		if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc)) {  			if ((state == SCE_P_DEFAULT) || (state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE)) {  				// Perform colourisation of white space and triple quoted strings at end of each line to allow @@ -214,7 +214,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,  			int lev = indentCurrent;  			int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsPyComment); -			if ((state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE))  +			if ((state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE))  				indentNext |= SC_FOLDLEVELWHITEFLAG;  			if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {  				// Only non whitespace lines can be headers diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx index eab7d2f71..9db8b9ddd 100644 --- a/src/LexSQL.cxx +++ b/src/LexSQL.cxx @@ -1,15 +1,15 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file LexSQL.cxx   ** Lexer for SQL.   **/  // Copyright 1998-2001 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 <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h>  #include "Platform.h" @@ -40,7 +40,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,                              int initStyle, WordList *keywordlists[], Accessor &styler) {  	WordList &keywords = *keywordlists[0]; -	 +  	styler.StartAt(startPos);  	bool fold = styler.GetPropertyInt("fold"); diff --git a/src/LexVB.cxx b/src/LexVB.cxx index 3b8c434d6..8032a75ec 100644 --- a/src/LexVB.cxx +++ b/src/LexVB.cxx @@ -1,15 +1,15 @@ -// SciTE - Scintilla based Text Editor +// Scintilla source code edit control  /** @file LexVB.cxx   ** Lexer for Visual Basic and VBScript.   **/  // Copyright 1998-2001 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 <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <stdio.h> +#include <stdarg.h>  #include "Platform.h" @@ -49,7 +49,7 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,                             WordList *keywordlists[], Accessor &styler) {  	WordList &keywords = *keywordlists[0]; -	 +  	styler.StartAt(startPos);  	int visibleChars = 0; diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index e20e2be55..c2967d2a5 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -18,7 +18,7 @@  Point Point::FromLong(long lpoint) {  	return Point(static_cast<short>(LOWORD(lpoint)), static_cast<short>(HIWORD(lpoint)));  } -	 +  static RECT RectFromPRectangle(PRectangle prc) {  	RECT rc = {prc.left, prc.top, prc.right, prc.bottom};  	return rc; @@ -80,7 +80,7 @@ void Palette::WantFind(ColourPair &cp, bool want) {  			if (entries[i].desired == cp.desired)  				return;  		} -	 +  		if (used < numEntries) {  			entries[used].desired = cp.desired;  			entries[used].allocated = cp.desired; @@ -112,9 +112,9 @@ void Palette::Allocate(Window &) {  			logpal->palPalEntry[iPal].peRed   = static_cast<BYTE>(desired.GetRed());  			logpal->palPalEntry[iPal].peGreen = static_cast<BYTE>(desired.GetGreen());  			logpal->palPalEntry[iPal].peBlue  = static_cast<BYTE>(desired.GetBlue()); -			entries[iPal].allocated =  +			entries[iPal].allocated =  				PALETTERGB(desired.GetRed(), desired.GetGreen(), desired.GetBlue()); -			// PC_NOCOLLAPSE means exact colours allocated even when in background this means other windows  +			// PC_NOCOLLAPSE means exact colours allocated even when in background this means other windows  			// are less likely to get their colours and also flashes more when switching windows  			logpal->palPalEntry[iPal].peFlags = PC_NOCOLLAPSE;  			// 0 allows approximate colours when in background, yielding moe colours to other windows @@ -141,7 +141,7 @@ void SetLogFont(LOGFONT &lf, const char *faceName, int characterSet, int size, b   * same then they may still be different.   */  int HashFont(const char *faceName, int characterSet, int size, bool bold, bool italic) { -    return  +    return          size ^          (characterSet << 10) ^          (bold ? 0x10000000 : 0) ^ @@ -158,7 +158,7 @@ class FontCached : Font {  	~FontCached() {}  	bool SameAs(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_);  	virtual void Release(); -		 +  	static FontCached *first;  public:  	static FontID FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_); @@ -167,7 +167,7 @@ public:  FontCached *FontCached::first = 0; -FontCached::FontCached(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) :  +FontCached::FontCached(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) :      next(0), usage(0), hash(0) {      SetLogFont(lf, faceName_, characterSet_, size_, bold_, italic_);      hash = HashFont(faceName_, characterSet_, size_, bold_, italic_); @@ -176,7 +176,7 @@ FontCached::FontCached(const char *faceName_, int characterSet_, int size_, bool  }  bool FontCached::SameAs(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) { -	return  +	return          (lf.lfHeight == -(abs(size_))) &&  		(lf.lfWeight == (bold_ ? FW_BOLD : FW_NORMAL)) &&  		(lf.lfItalic == static_cast<BYTE>(italic_ ? 1 : 0)) && @@ -193,7 +193,7 @@ void FontCached::Release() {  FontID FontCached::FindOrCreate(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_) {      int hashFind = HashFont(faceName_, characterSet_, size_, bold_, italic_);  	for (FontCached *cur=first; cur; cur=cur->next) { -        if ((cur->hash == hashFind) &&  +        if ((cur->hash == hashFind) &&              cur->SameAs(faceName_, characterSet_, size_, bold_, italic_)) {  			cur->usage++;  			return cur->id; @@ -238,7 +238,7 @@ Font::~Font() {  void Font::Create(const char *faceName, int characterSet, int size, bool bold, bool italic) {  #ifndef FONTS_CACHED  	Release(); -	 +  	LOGFONT lf;      SetLogFont(lf, faceName, characterSet, size, bold, italic);      id = ::CreateFontIndirect(&lf); @@ -261,9 +261,9 @@ void Font::Release() {  Surface::Surface() :  	unicodeMode(false),  	hdc(0), 	hdcOwned(false), -	pen(0), 	penOld(0),  -	brush(0), brushOld(0),  -	font(0), 	fontOld(0),  +	pen(0), 	penOld(0), +	brush(0), brushOld(0), +	font(0), 	fontOld(0),  	bitmap(0), bitmapOld(0),  	paletteOld(0) {  } @@ -434,7 +434,7 @@ void Surface::Ellipse(PRectangle rc, Colour fore, Colour back) {  }  void Surface::Copy(PRectangle rc, Point from, Surface &surfaceSource) { -	::BitBlt(hdc, rc.left, rc.top, rc.Width(), rc.Height(),  +	::BitBlt(hdc, rc.left, rc.top, rc.Width(), rc.Height(),  		surfaceSource.hdc, from.x, from.y, SRCCOPY);  } @@ -498,7 +498,7 @@ void Surface::MeasureWidths(Font &font_, const char *s, int len, int *positions)  			// Likely to have failed because on Windows 9x where function not available  			// So measure the character widths by measuring each initial substring  			// Turns a linear operation into a qudratic but seems fast enough on test files -			for (int widthSS=0; widthSS < tlen; widthSS++) {  +			for (int widthSS=0; widthSS < tlen; widthSS++) {  				::GetTextExtentPoint32W(hdc, tbuf, widthSS+1, &sz);  				poses[widthSS] = sz.cx;  			} @@ -591,7 +591,7 @@ int Surface::SetPalette(Palette *pal, bool inBackGround) {  	}  	return changes;  } -		 +  void Surface::SetClip(PRectangle rc) {  	::IntersectClipRect(hdc, rc.left, rc.top, rc.right, rc.bottom);  } @@ -652,7 +652,7 @@ void Window::InvalidateRectangle(PRectangle rc) {  }  void Window::SetFont(Font &font) { -	SendMessage(WM_SETFONT,  +	SendMessage(WM_SETFONT,  		reinterpret_cast<WPARAM>(font.GetID()), 0);  } @@ -718,7 +718,7 @@ void ListBox::Create(Window &parent, int ctrlID) {  	id = ::CreateWindowEx(                  WS_EX_WINDOWEDGE, "listbox", "",         		WS_CHILD | WS_THICKFRAME | WS_VSCROLL | LBS_SORT | LBS_NOTIFY, -       		100,100, 150,80, parent.GetID(), reinterpret_cast<HMENU>(ctrlID),  +       		100,100, 150,80, parent.GetID(), reinterpret_cast<HMENU>(ctrlID),  		parent.GetInstance(), 0);  } @@ -776,7 +776,7 @@ int ListBox::GetSelection() {  }  int ListBox::Find(const char *prefix) { -	return SendMessage(LB_FINDSTRING, static_cast<WPARAM>(-1),  +	return SendMessage(LB_FINDSTRING, static_cast<WPARAM>(-1),          reinterpret_cast<LPARAM>(prefix));  } @@ -896,7 +896,7 @@ void Platform::Assert(const char *c, const char *file, int line) {  	char buffer[2000];  	sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line);  	if (assertionPopUps) { -		int idButton = ::MessageBox(0, buffer, "Assertion failure",  +		int idButton = ::MessageBox(0, buffer, "Assertion failure",  			MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL);  		if (idButton == IDRETRY) {  			::DebugBreak(); diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 80702fa41..522a038eb 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -117,7 +117,7 @@ class ScintillaWin :  	bool hasOKText;  	CLIPFORMAT cfColumnSelect; -	 +  	DropSource ds;  	DataObject dob;  	DropTarget dt; @@ -192,7 +192,7 @@ public:  	STDMETHODIMP GetData(FORMATETC *pFEIn, STGMEDIUM *pSTM);  	bool IsUnicodeMode() const; -	 +  	static void Register(HINSTANCE hInstance_);  	friend class DropSource;  	friend class DataObject; @@ -214,7 +214,7 @@ ScintillaWin::ScintillaWin(HWND hwnd) {  	// contains a rectangular selection, so copy Developer Studio.  	cfColumnSelect = static_cast<CLIPFORMAT>(  		::RegisterClipboardFormat("MSDEVColumnSelect")); -	 +  	wMain = hwnd;  	dob.sci = this; @@ -276,7 +276,7 @@ static int InputCodePage() {  	char sCodePage[10];  	int res = ::GetLocaleInfo(MAKELCID(inputLang, SORT_DEFAULT),  	  LOCALE_IDEFAULTANSICODEPAGE, sCodePage, sizeof(sCodePage)); -	if (!res)  +	if (!res)  		return 0;  	return atoi(sCodePage);  } @@ -313,14 +313,14 @@ LRESULT ScintillaWin::WndPaint(unsigned long wParam) {  	//LARGE_INTEGER performanceFreq;  	//QueryPerformanceFrequency(&performanceFreq);  	//QueryPerformanceCounter(&perfStart); -	 -	// Redirect assertions to debug output and save current state  + +	// Redirect assertions to debug output and save current state  	bool assertsPopup = Platform::ShowAssertionPopUps(false);  	paintState = painting;  	PAINTSTRUCT ps;  	PAINTSTRUCT* pps; -	bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains  +	bool IsOcxCtrl = (wParam != 0); // if wParam != 0, it contains  								   // a PAINSTRUCT* from the OCX  	if (IsOcxCtrl) {  		pps = reinterpret_cast<PAINTSTRUCT*>(wParam); @@ -349,9 +349,9 @@ LRESULT ScintillaWin::WndPaint(unsigned long wParam) {  	}  	paintState = notPainting; -	// Restore debug output state  +	// Restore debug output state  	Platform::ShowAssertionPopUps(assertsPopup); -	 +  	//QueryPerformanceCounter(&perfEnd);  	//__int64 start = perfStart.QuadPart;  	//__int64 end = perfEnd.QuadPart; @@ -451,11 +451,11 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam  		return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam);  	case WM_LBUTTONDOWN: -		//Platform::DebugPrintf("Buttdown %d %x %x %x %x %x\n",iMessage, wParam, lParam,  -		//	Platform::IsKeyDown(VK_SHIFT),  +		//Platform::DebugPrintf("Buttdown %d %x %x %x %x %x\n",iMessage, wParam, lParam, +		//	Platform::IsKeyDown(VK_SHIFT),  		//	Platform::IsKeyDown(VK_CONTROL),  		//	Platform::IsKeyDown(VK_MENU)); -		ButtonDown(Point::FromLong(lParam), GetTickCount(),  +		ButtonDown(Point::FromLong(lParam), GetTickCount(),  			wParam & MK_SHIFT, wParam & MK_CONTROL, Platform::IsKeyDown(VK_MENU));  		SetFocus(wMain.GetID());  		break; @@ -501,7 +501,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam  	case WM_KEYDOWN: {  		//Platform::DebugPrintf("S keydown %d %x %x %x %x\n",iMessage, wParam, lParam, ::IsKeyDown(VK_SHIFT), ::IsKeyDown(VK_CONTROL)); -			int ret = KeyDown(KeyTranslate(wParam),  +			int ret = KeyDown(KeyTranslate(wParam),  				Platform::IsKeyDown(VK_SHIFT),  		               	Platform::IsKeyDown(VK_CONTROL), false);  			if (!ret) @@ -560,7 +560,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam  	case WM_IME_ENDCOMPOSITION: 	// dbcs  		ImeEndComposition();  		return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam); -		 +  	case WM_IME_COMPOSITION:  		if (lParam & GCS_RESULTSTR) {  			Platform::DebugPrintf("Result\n"); @@ -597,12 +597,12 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam  		return ::DefWindowProc(wMain.GetID(), iMessage, wParam, lParam);  	case WM_ERASEBKGND: -        	return 1;   // Avoid any background erasure as whole window painted.  +        	return 1;   // Avoid any background erasure as whole window painted.      	case WM_CAPTURECHANGED:  		capturedMouse = false;  		return 0; -	 +          // These are not handled in Scintilla and its faster to dispatch them here.          // Also moves time out to here so profile doesn't count lots of empty message calls.      	case WM_MOVE: @@ -621,14 +621,14 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam  	case SCI_GETDIRECTFUNCTION:  		return reinterpret_cast<sptr_t>(DirectFunction); -	 +  	case SCI_GETDIRECTPOINTER:  		return reinterpret_cast<sptr_t>(this);  	case SCI_GRABFOCUS:  		::SetFocus(wMain.GetID());  		break; -	 +  	default:  	    return ScintillaBase::WndProc(iMessage, wParam, lParam);  	} @@ -671,7 +671,7 @@ bool ScintillaWin::HaveMouseCapture() {  void ScintillaWin::ScrollText(int linesToMove) {  	//Platform::DebugPrintf("ScintillaWin::ScrollText %d\n", linesToMove); -	::ScrollWindow(wMain.GetID(), 0,  +	::ScrollWindow(wMain.GetID(), 0,  		vs.lineHeight * linesToMove, 0, 0);  	::UpdateWindow(wMain.GetID());  } @@ -721,13 +721,13 @@ bool ScintillaWin::ModifyScrollBars(int nMax, int nPage) {  void ScintillaWin::NotifyChange() {  	::SendMessage(GetParent(wMain.GetID()), WM_COMMAND, -	        MAKELONG(wMain.GetDlgCtrlID(), SCEN_CHANGE),  +	        MAKELONG(wMain.GetDlgCtrlID(), SCEN_CHANGE),  		reinterpret_cast<LPARAM>(wMain.GetID()));  }  void ScintillaWin::NotifyFocus(bool focus) {  	::SendMessage(GetParent(wMain.GetID()), WM_COMMAND, -	        MAKELONG(wMain.GetDlgCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS),  +	        MAKELONG(wMain.GetDlgCtrlID(), focus ? SCEN_SETFOCUS : SCEN_KILLFOCUS),  		reinterpret_cast<LPARAM>(wMain.GetID()));  } @@ -987,7 +987,7 @@ STDMETHODIMP DataObject_GetDataHere(DataObject *, FORMATETC *, STGMEDIUM *) {  }  STDMETHODIMP DataObject_QueryGetData(DataObject *pd, FORMATETC *pFE) { -	if (pd->sci->DragIsRectangularOK(pFE->cfFormat) &&  +	if (pd->sci->DragIsRectangularOK(pFE->cfFormat) &&  	    pFE->ptd == 0 &&  	    (pFE->dwAspect & DVASPECT_CONTENT) != 0 &&  	    pFE->lindex == -1 && @@ -995,9 +995,9 @@ STDMETHODIMP DataObject_QueryGetData(DataObject *pd, FORMATETC *pFE) {  	) {  		return S_OK;  	} -	 -	bool formatOK = (pFE->cfFormat == CF_TEXT) ||  -		((pFE->cfFormat == CF_UNICODETEXT) && pd->sci->IsUnicodeMode()) ||  + +	bool formatOK = (pFE->cfFormat == CF_TEXT) || +		((pFE->cfFormat == CF_UNICODETEXT) && pd->sci->IsUnicodeMode()) ||  		(pFE->cfFormat == CF_HDROP);  	if (!formatOK ||  	    pFE->ptd != 0 || @@ -1205,10 +1205,10 @@ void ScintillaWin::GetIntelliMouseParameters() {  void ScintillaWin::CopySelTextToClipboard() {  	int bytes = SelectionRangeLength();  	char *selChars = CopySelectionRange(); -	if (!selChars)  +	if (!selChars)  		return; -	HGLOBAL hand = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,  +	HGLOBAL hand = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,  		bytes + 1);  	if (hand) {  		char *ptr = static_cast<char *>(::GlobalLock(hand)); @@ -1220,7 +1220,7 @@ void ScintillaWin::CopySelTextToClipboard() {  	if (IsUnicodeMode()) {  		int uchars = UCS2Length(selChars, bytes); -		HGLOBAL uhand = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,  +		HGLOBAL uhand = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT,  			2 * (uchars + 1));  		if (uhand) {  			wchar_t *uptr = static_cast<wchar_t *>(::GlobalLock(uhand)); @@ -1372,7 +1372,7 @@ STDMETHODIMP ScintillaWin::DragEnter(LPDATAOBJECT pIDataSource, DWORD grfKeyStat  		*pdwEffect = DROPEFFECT_NONE;          return S_OK;      } -  +  	if (inDragDrop)	// Internal defaults to move  		*pdwEffect = DROPEFFECT_MOVE;  	else @@ -1464,7 +1464,7 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,  	FORMATETC fmtr = {cfColumnSelect, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};  	HRESULT hrRectangular = pIDataSource->QueryGetData(&fmtr); -	 +  	POINT rpt = {pt.x, pt.y};  	::ScreenToClient(wMain.GetID(), &rpt);  	int movePos = PositionFromLocation(Point(rpt.x, rpt.y)); @@ -1479,7 +1479,7 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,      else      	::GlobalFree(medium.hGlobal); -	if (udata)  +	if (udata)  		delete []data;  	return S_OK; @@ -1487,8 +1487,8 @@ STDMETHODIMP ScintillaWin::Drop(LPDATAOBJECT pIDataSource, DWORD grfKeyState,  /// Implement important part of IDataObject  STDMETHODIMP ScintillaWin::GetData(FORMATETC *pFEIn, STGMEDIUM *pSTM) { -	bool formatOK = (pFEIn->cfFormat == CF_TEXT) ||  -		((pFEIn->cfFormat == CF_UNICODETEXT) && IsUnicodeMode()) ||  +	bool formatOK = (pFEIn->cfFormat == CF_TEXT) || +		((pFEIn->cfFormat == CF_UNICODETEXT) && IsUnicodeMode()) ||  		(pFEIn->cfFormat == CF_HDROP);  	if (!formatOK ||  	    pFEIn->ptd != 0 || @@ -1647,7 +1647,7 @@ sptr_t ScintillaWin::DirectFunction(      ScintillaWin *sci, UINT iMessage, uptr_t wParam, sptr_t lParam) {  	return sci->WndProc(iMessage, wParam, lParam);  } -	     +  sptr_t PASCAL ScintillaWin::SWndProc(      HWND hWnd, UINT iMessage, WPARAM wParam, sptr_t lParam) {  	//Platform::DebugPrintf("S W:%x M:%x WP:%x L:%x\n", hWnd, iMessage, wParam, lParam); | 
