Skip to content

Commit

Permalink
upgrade scintilla to 6102:5e819dc26052.
Browse files Browse the repository at this point in the history
sync notepad2-mod to a8257d7b7a098a29520a30ce59f7bae695cab008.
  • Loading branch information
zufuliu committed Jan 8, 2017
1 parent b27830c commit 5aee7f8
Show file tree
Hide file tree
Showing 50 changed files with 724 additions and 252 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/bin
/build/.vs
/build/bin
bin
build/.vs
build/bin
*.suo
*.sdf
*.user
Expand Down
Binary file renamed doc/Notepad2.ini → Notepad2.ini
Binary file not shown.
5 changes: 5 additions & 0 deletions build/makefile.deps.mak
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ $(SCI_SRC_OBJDIR)\XPM.obj: \
#######################
## scintilla\win32 ##
#######################
$(SCI_WIN_OBJDIR)\HanjaDic.obj: \
$(SCI_WIN)\HanjaDic.cxx \
$(SCI_WIN)\HanjaDic.h \
$(SCI_SRC)\UniConversion.h

$(SCI_WIN_OBJDIR)\PlatWin.obj: \
$(SCI_WIN)\PlatWin.cxx \
$(SCI_INC)\Platform.h \
Expand Down
1 change: 1 addition & 0 deletions build/makefile.objs.mak
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ SCI_SRC_OBJ = \
$(SCI_SRC_OBJDIR)\XPM.obj

SCI_WIN_OBJ = \
$(SCI_WIN_OBJDIR)\HanjaDic.obj \
$(SCI_WIN_OBJDIR)\PlatWin.obj \
$(SCI_WIN_OBJDIR)\ScintillaWin.obj

Expand Down
2 changes: 1 addition & 1 deletion doc/License.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Notepad2 Copyright � 2004-2011 Florian Balmer
Notepad2-mod Copyright � 2010-2013 All contributors, see Readme-mod.txt
Notepad2-mod Copyright � 2010-2014 All contributors, see Readme-mod.txt
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions doc/Readme-mod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Notable changes:
* Option to mark all occurrences of a word
* Word auto-completion
* Syntax highlighting support for AutoHotkey, AutoIt3, AviSynth, Bash,
CMake, Inno Setup, LaTeX, Lua, Markdown, NSIS, Ruby, Tcl and YAML scripts
CMake, CoffeeScript, Inno Setup, LaTeX, Lua, Markdown, NSIS, Ruby, Tcl, YAML and VHDL scripts
* Improved support for NFO ANSI art
* Support for replacing Windows Notepad using a clean, unintrusive registry-based method
* Other various minor changes and tweaks

Supported Operating Systems:
* XP (SP3, SP2 might or might not work), Vista, 7, 8 and 8.1 both 32-bit and 64-bit
* XP (SP3, SP2 might or might not work), Vista, 7, 8, 8.1 and 10 both 32-bit and 64-bit

Contributors:
* Kai Liu
Expand Down
86 changes: 43 additions & 43 deletions res/Notepad2.exe.manifest
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="Notepad2"
processorArchitecture="*"
version="4.2.25.955"
type="win32"
/>
<description>Notepad2</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="Notepad2"
processorArchitecture="*"
version="4.2.25.990"
type="win32"
/>
<description>Notepad2</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>false</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
2 changes: 1 addition & 1 deletion res/Notepad2.exe.manifest.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
</compatibility>
<asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
<dpiAware>false</dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
2 changes: 1 addition & 1 deletion scintilla/include/Platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class Surface {
virtual void DrawTextTransparent(const PRectangle &rc, const Font &font_, XYPOSITION ybase, const char *s, int len, const ColourDesired &fore)=0;
virtual void MeasureWidths(const Font &font_, const char *s, int len, XYPOSITION *positions)=0;
virtual XYPOSITION WidthText(const Font &font_, const char *s, int len)=0;
virtual XYPOSITION WidthChar(const Font &font_, char ch)=0;
virtual XYPOSITION WidthChar(const Font &font_, int ch)=0;
virtual XYPOSITION Ascent(const Font &font_)=0;
virtual XYPOSITION Descent(const Font &font_)=0;
virtual XYPOSITION InternalLeading(const Font &font_)=0;
Expand Down
10 changes: 10 additions & 0 deletions scintilla/include/Scintilla.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define STYLE_CONTROLCHAR 36
#define STYLE_INDENTGUIDE 37
#define STYLE_CALLTIP 38
#define STYLE_FOLDDISPLAYTEXT 39
#define STYLE_LASTPREDEFINED 39
#define STYLE_MAX 255
#define SC_CHARSET_ANSI 0
Expand Down Expand Up @@ -487,6 +488,11 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETFOLDEXPANDED 2229
#define SCI_GETFOLDEXPANDED 2230
#define SCI_TOGGLEFOLD 2231
#define SCI_TOGGLEFOLDSHOWTEXT 2700
#define SC_FOLDDISPLAYTEXT_HIDDEN 0
#define SC_FOLDDISPLAYTEXT_STANDARD 1
#define SC_FOLDDISPLAYTEXT_BOXED 2
#define SCI_FOLDDISPLAYTEXTSETSTYLE 2701
#define SC_FOLDACTION_CONTRACT 0
#define SC_FOLDACTION_EXPAND 1
#define SC_FOLDACTION_TOGGLE 2
Expand Down Expand Up @@ -675,6 +681,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SEARCHNEXT 2367
#define SCI_SEARCHPREV 2368
#define SCI_LINESONSCREEN 2370
#define SC_POPUP_NEVER 0
#define SC_POPUP_ALL 1
#define SC_POPUP_TEXT 2
#define SCI_USEPOPUP 2371
#define SCI_SELECTIONISRECTANGLE 2372
#define SCI_SETZOOM 2373
Expand Down Expand Up @@ -1087,6 +1096,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCN_FOCUSIN 2028
#define SCN_FOCUSOUT 2029
#define SCN_AUTOCCOMPLETED 2030
#define SCN_MARGINRIGHTCLICK 2031
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */

/* These structures are defined to be exactly the same shape as the Win32
Expand Down
22 changes: 20 additions & 2 deletions scintilla/include/Scintilla.iface
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ val STYLE_BRACEBAD=35
val STYLE_CONTROLCHAR=36
val STYLE_INDENTGUIDE=37
val STYLE_CALLTIP=38
val STYLE_FOLDDISPLAYTEXT=39
val STYLE_LASTPREDEFINED=39
val STYLE_MAX=255

Expand Down Expand Up @@ -1217,6 +1218,17 @@ get bool GetFoldExpanded=2230(int line,)
# Switch a header line between expanded and contracted.
fun void ToggleFold=2231(int line,)

# Switch a header line between expanded and contracted and show some text after the line.
fun void ToggleFoldShowText=2700(int line, string text)

enu foldDisplayTextStyle=SC_FOLDDISPLAYTEXTSTYLE_
val SC_FOLDDISPLAYTEXT_HIDDEN=0
val SC_FOLDDISPLAYTEXT_STANDARD=1
val SC_FOLDDISPLAYTEXT_BOXED=2

# Set the style of fold display text
set void FoldDisplayTextSetStyle=2701(int style,)

enu FoldAction=SC_FOLDACTION_
val SC_FOLDACTION_CONTRACT=0
val SC_FOLDACTION_EXPAND=1
Expand Down Expand Up @@ -1741,9 +1753,14 @@ fun int SearchPrev=2368(int searchFlags, string text)
# Retrieves the number of lines completely visible.
get int LinesOnScreen=2370(,)

enu PopUp=SC_POPUP_
val SC_POPUP_NEVER=0
val SC_POPUP_ALL=1
val SC_POPUP_TEXT=2

# Set whether a pop up menu is displayed automatically when the user presses
# the wrong mouse button.
fun void UsePopUp=2371(bool allowPopUp,)
# the wrong mouse button on certain areas.
fun void UsePopUp=2371(int popUpMode,)

# Is the selection rectangular? The alternative is the more common stream selection.
get bool SelectionIsRectangle=2372(,)
Expand Down Expand Up @@ -2811,6 +2828,7 @@ evt void HotSpotReleaseClick=2027(int modifiers, int position)
evt void FocusIn=2028(void)
evt void FocusOut=2029(void)
evt void AutoCCompleted=2030(string text, int position, int ch, CompletionMethods listCompletionMethod)
evt void MarginRightClick=2031(int modifiers, int position, int margin)

# There are no provisional features currently

Expand Down
8 changes: 4 additions & 4 deletions scintilla/lexers/LexAsm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ static inline bool IsAsmOperator(int ch) {
}
static inline bool IsAsmNumber(int ch, int chPrev) {
return (ch < 0x80) && (isxdigit(ch) //|| (isdigit(ch) && chPrev == '.')
|| ((ch == 'x' || ch == 'X') && chPrev < 0x80 && chPrev == '0')
|| ((ch == 'x' || ch == 'X') && chPrev == '0')
|| ((ch == 'H' || ch == 'h') && ch < 0x80 && isxdigit(chPrev))
|| ((ch == '+' || ch == '-') && chPrev < 0x80 && (chPrev == 'E' || chPrev == 'e'))
|| ((ch == 'Q' || ch == 'q') && chPrev < 0x80 && (chPrev >= '0' && chPrev <= '7'))
|| ((ch == '+' || ch == '-') && (chPrev == 'E' || chPrev == 'e'))
|| ((ch == 'Q' || ch == 'q') && (chPrev >= '0' && chPrev <= '7'))
);
}

Expand Down Expand Up @@ -251,7 +251,7 @@ static void ColouriseAsmDoc(Sci_PositionU startPos, Sci_Position length, int ini
sc.SetState(SCE_ASM_COMMENT);
sc.Forward();
} else if (sc.ch == '@') {
if (sc.chNext < 0x80 && sc.chNext >= '0' && sc.chNext <= '7'
if (sc.chNext >= '0' && sc.chNext <= '7'
&& (IsAsmOperator(sc.chPrev) || isspace(sc.chPrev))) { // Freescale Octal
sc.SetState(SCE_ASM_NUMBER);
} else if (isspace(sc.chNext)) {
Expand Down
4 changes: 2 additions & 2 deletions scintilla/lexers/LexAutoIt3.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void ColouriseAU3Doc(Sci_PositionU startPos, Sci_Position length, int ini
// save the total current word for eof processing
if (IsAu3WordChar(sc.ch) || sc.ch == '}') {
strcpy(s_save, s);
int tp = strlen(s_save);
size_t tp = strlen(s_save);
if (tp < 127) {
s_save[tp] = static_cast<char>(tolower(sc.ch));
s_save[tp + 1] = '\0';
Expand Down Expand Up @@ -358,7 +358,7 @@ static void ColouriseAU3Doc(Sci_PositionU startPos, Sci_Position length, int ini
if (sc.atLineEnd) {
si = 0;
// at line end and not found a continuation char then reset to default
Sci_Position lineCurrent = styler.GetLine(sc.currentPos);
lineCurrent = styler.GetLine(sc.currentPos);
if (!IsContinuationLine(lineCurrent, styler)) {
sc.SetState(SCE_AU3_DEFAULT);
break;
Expand Down
4 changes: 3 additions & 1 deletion scintilla/lexers/LexCMake.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using namespace Scintilla;
}*/

static inline bool IsCmakeOperator(char ch) {
return ch == '(' || ch == ')' || ch == '=' || ch == ':';
return ch == '(' || ch == ')' || ch == '=' || ch == ':' || ch == ';';
}

static void ColouriseCmakeDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordLists[], Accessor &styler) {
Expand Down Expand Up @@ -117,6 +117,8 @@ static void ColouriseCmakeDoc(Sci_PositionU startPos, Sci_Position length, int i
varStyle = SCE_CMAKE_DEFAULT;
if (sc.ch == '#') {
sc.SetState(SCE_CMAKE_COMMENT);
} else if (sc.ch == '/' && sc.chNext == '/') { // CMakeCache.txt
sc.SetState(SCE_CMAKE_COMMENT);
} else if (sc.ch == '\"') {
sc.SetState(SCE_CMAKE_STRINGDQ);
} else if (sc.ch == '\'') {
Expand Down
6 changes: 3 additions & 3 deletions scintilla/lexers/LexCPP.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ static void ColouriseCppDoc(Sci_PositionU startPos, Sci_Position length, int ini
} else if (iswordchar(s[0]) && (IsASpace(sc.ch) || sc.ch == '[' || sc.ch == ')' || sc.ch == '>'
|| sc.ch == '*' || sc.ch == '&' || sc.ch == ':')) {
bool is_class = false;
Sci_Position pos = sc.currentPos;
Sci_PositionU pos = sc.currentPos;
int next_char = IsASpace(sc.ch)? nextChar : sc.ch;

if (sc.ch == ':' && sc.chNext == ':') { // C++, Java, PHP
Expand All @@ -393,7 +393,7 @@ static void ColouriseCppDoc(Sci_PositionU startPos, Sci_Position length, int ini
const bool next_is_word = iswordstart(ch);
if (next_char == ')' || next_char == '>') {
if (next_is_word || (ch == '(')) {
pos = sc.currentPos - strlen(s) -1;
pos = sc.currentPos - (uint32_t)strlen(s) -1;
while (IsASpace(styler.SafeGetCharAt(pos, '\0'))) pos--;
ch = styler.SafeGetCharAt(pos, '\0');
if (next_char == '>' && (ch == '<' || ch == ',')) {
Expand All @@ -416,7 +416,7 @@ static void ColouriseCppDoc(Sci_PositionU startPos, Sci_Position length, int ini
if (ch == '=') {
is_class = true;
} else if (ch == ',' || ch == ';') {
pos = sc.currentPos - strlen(s) -1;
pos = sc.currentPos - (uint32_t)strlen(s) -1;
while (IsASpace(styler.SafeGetCharAt(pos, '\0'))) pos--;
ch = styler.SafeGetCharAt(pos, '\0');
if (iswordchar(ch) || ch == ';' || ch == '{') {
Expand Down
4 changes: 2 additions & 2 deletions scintilla/lexers/LexVHDL.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static void FoldVHDLDoc(Sci_PositionU startPos, Sci_Position length, int /*initS
}
}
}
for(j = j+strlen(prevWord); j<endPos; j++) {
for(j = j + (Sci_PositionU)strlen(prevWord); j < endPos; j++) {
char ch = styler.SafeGetCharAt(j);
int style = styler.StyleAt(j);
if ((!IsCommentStyle(style)) && (style != SCE_VHDL_STRING))
Expand All @@ -217,7 +217,7 @@ static void FoldVHDLDoc(Sci_PositionU startPos, Sci_Position length, int /*initS
ch = chNext;
chNext = styler.SafeGetCharAt(i + 1);
char chNextNonBlank = chNext;
Sci_PositionU j = i + 1;
j = i + 1;
while(isspacechar(chNextNonBlank) && j<endPos) {
j ++ ;
chNextNonBlank = styler.SafeGetCharAt(j);
Expand Down
2 changes: 1 addition & 1 deletion scintilla/lexlib/CharacterCategory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {

const int catRanges[] = {
//++Autogenerated -- start of section automatically generated
// Created with Python 3.6.0b2, Unicode 9.0.0
// Created with Python 3.6.0, Unicode 9.0.0
25,
1046,
1073,
Expand Down
2 changes: 1 addition & 1 deletion scintilla/src/CellBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ class CellBuffer {
int Length() const;
void Allocate(int newSize);
int GetLineEndTypes() const { return utf8LineEnds; }
bool ContainsLineEnd(const char *s, int length) const;
void SetLineEndTypes(int utf8LineEnds_);
bool ContainsLineEnd(const char *s, int length) const;
void SetPerLine(PerLine *pl);
int Lines() const;
int LineStart(int line) const;
Expand Down
6 changes: 3 additions & 3 deletions scintilla/src/CharClassify.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ CharClassify::CharClassify() {

void CharClassify::SetDefaultCharClasses(bool includeWordClass) {
// Initialize all char classes to default values
for (int ch = 0; ch < maxChar; ch++) {
for (int ch = 0; ch < 256; ch++) {
if (ch == '\r' || ch == '\n')
charClass[ch] = ccNewLine;
else if (ch < 0x20 || ch == ' ')
charClass[ch] = ccSpace;
else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'/* || ch == '-'*/)) // hyphen
charClass[ch] = (ch >= 0x80) ? ccUniWord : ccWord;
else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'))
charClass[ch] = ccWord;
else
charClass[ch] = ccPunctuation;
}
Expand Down
Loading

0 comments on commit 5aee7f8

Please sign in to comment.