summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scintilla/doc/ScintillaDoc.html6
-rw-r--r--scintilla/doc/ScintillaDownload.html10
-rw-r--r--scintilla/doc/ScintillaHistory.html78
-rw-r--r--scintilla/doc/index.html7
-rw-r--r--scintilla/include/SciLexer.h19
-rw-r--r--scintilla/include/Scintilla.h1
-rw-r--r--scintilla/include/Scintilla.iface30
-rw-r--r--scintilla/lexers/LexCoffeeScript.cxx19
-rw-r--r--scintilla/lexers/LexErrorList.cxx93
-rw-r--r--scintilla/lexers/LexMySQL.cxx9
-rw-r--r--scintilla/lexers/LexVHDL.cxx3
-rw-r--r--scintilla/scripts/HeaderOrder.txt1
-rw-r--r--scintilla/scripts/ScintillaData.py36
-rw-r--r--scintilla/src/Document.cxx2
-rw-r--r--scintilla/src/Editor.cxx24
-rw-r--r--scintilla/src/Editor.h2
-rw-r--r--scintilla/version.txt2
-rw-r--r--scintilla/win32/ScintillaWin.cxx173
18 files changed, 430 insertions, 85 deletions
diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html
index c24f52d..263628f 100644
--- a/scintilla/doc/ScintillaDoc.html
+++ b/scintilla/doc/ScintillaDoc.html
@@ -2694,7 +2694,7 @@ struct Sci_TextToFind {
<code>SC_CHARSET_TURKISH</code>, and <code>SC_CHARSET_VIETNAMESE</code>.</p>
<p>The character sets supported on GTK+ are:<br />
- <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_CYRILLIC</code> (code page 1251),
+ <code>SC_CHARSET_ANSI</code>, <code>SC_CHARSET_OEM866</code> (code page 866), <code>SC_CHARSET_CYRILLIC</code> (code page 1251),
<code>SC_CHARSET_EASTEUROPE</code>,
<code>SC_CHARSET_GB2312</code>, <code>SC_CHARSET_HANGUL</code>,
<code>SC_CHARSET_RUSSIAN</code> (KOI8-R), <code>SC_CHARSET_SHIFTJIS</code>, and
@@ -7678,8 +7678,8 @@ EM_SETTARGETDEVICE
<p>To build Scintilla or SciTE, see the README file present in both the Scintilla and SciTE
directories. For Windows, GCC 4.7 or Microsoft Visual C++ 2010 can be used
- for building. For GTK+, GCC 4.1 or newer should be used. GTK+ 2.8+ and 3.x are
- supported. The version of GTK+ installed should be detected automatically.
+ for building. For GTK+, GCC 4.4 or newer should be used. GTK+ 2.18+ and 3.x are
+ supported with glib 2.22+. The version of GTK+ installed should be detected automatically.
When both GTK+ 2 and GTK+ 3 are present, building for GTK+ 3.x requires defining GTK3
on the command line.</p>
diff --git a/scintilla/doc/ScintillaDownload.html b/scintilla/doc/ScintillaDownload.html
index 5fb96d9..c3d3f44 100644
--- a/scintilla/doc/ScintillaDownload.html
+++ b/scintilla/doc/ScintillaDownload.html
@@ -25,9 +25,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
- <font size="4"> <a href="http://www.scintilla.org/scintilla360.zip">
+ <font size="4"> <a href="http://www.scintilla.org/scintilla361.zip">
Windows</a>&nbsp;&nbsp;
- <a href="http://www.scintilla.org/scintilla360.tgz">
+ <a href="http://www.scintilla.org/scintilla361.tgz">
GTK+/Linux</a>&nbsp;&nbsp;
</font>
</td>
@@ -41,7 +41,7 @@
containing very few restrictions.
</p>
<h3>
- Release 3.6.0
+ Release 3.6.1
</h3>
<h4>
Source Code
@@ -49,8 +49,8 @@
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
- <li><a href="http://www.scintilla.org/scintilla360.zip">zip format</a> (1500K) commonly used on Windows</li>
- <li><a href="http://www.scintilla.org/scintilla360.tgz">tgz format</a> (1400K) commonly used on Linux and compatible operating systems</li>
+ <li><a href="http://www.scintilla.org/scintilla361.zip">zip format</a> (1500K) commonly used on Windows</li>
+ <li><a href="http://www.scintilla.org/scintilla361.tgz">tgz format</a> (1400K) commonly used on Linux and compatible operating systems</li>
</ul>
Instructions for building on both Windows and Linux are included in the readme file.
<h4>
diff --git a/scintilla/doc/ScintillaHistory.html b/scintilla/doc/ScintillaHistory.html
index e74ffe3..456fbb7 100644
--- a/scintilla/doc/ScintillaHistory.html
+++ b/scintilla/doc/ScintillaHistory.html
@@ -473,6 +473,8 @@
</tr><tr>
<td>Jiří Techet</td>
<td>Jonathan Hunt</td>
+ <td>Serg Stetsuk</td>
+ <td>Jordan Jueckstock</td>
</tr>
</table>
<p>
@@ -485,6 +487,82 @@
</li>
</ul>
<h3>
+ <a href="http://prdownloads.sourceforge.net/scintilla/scite361.zip?download">Release 3.6.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 15 September 2015.
+ </li>
+ <li>
+ The oldest version of GTK+ supported now is 2.18 and for glib it is 2.22.
+ </li>
+ <li>
+ On GTK+, SC_CHARSET_OEM866 added to allow editing Russian files encoded in code page 866.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1019/">Feature #1019.</a>
+ </li>
+ <li>
+ On Windows, reconversion is performed when requested by the IME.
+ </li>
+ <li>
+ CoffeeScript lexer adds lexical class for instance properties and fixes some cases of regex highlighting.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1749/">Bug #1749</a>.
+ </li>
+ <li>
+ The errorlist lexer understands some ANSI escape sequences to change foreground colour and intensity.
+ This is sufficient to colour diagnotic output from gcc and clang when -fdiagnostics-color set.
+ </li>
+ <li>
+ The errorlist lexer allows the line number to be 0 in GCC errors as some tools report whole file
+ errors as line 0.
+ </li>
+ <li>
+ MySql lexer fixes empty comments /**/ so the comment state does not continue.
+ </li>
+ <li>
+ VHDL folder supports "protected" keyword.
+ </li>
+ <li>
+ Treat CRLF line end as two characters in SCI_COUNTCHARACTERS.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1757/">Bug #1757</a>.
+ </li>
+ <li>
+ On GTK+ 3.x, fix height of lines in autocompletion lists to match the font.
+ Switch from deprecated style calls to CSS styling.
+ Removed setting list colours on GTK+ 3.16+ as no longer appears needed.
+ </li>
+ <li>
+ On GTK+, avoid "Invalid rectangle passed" warning messages by never reporting the client
+ rectangle with a negative width or height.
+ </li>
+ <li>
+ On Cocoa, copy Sci_Position.h into the framework so clients can build.
+ </li>
+ <li>
+ On Cocoa fix bug with drag and drop that could lead to crashes.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1751/">Bug #1751</a>.
+ </li>
+ <li>
+ Fix SciTE disk exhaustion bug by reporting failures when writing files.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1760/">Bug #1760</a>.
+ </li>
+ <li>
+ Fix find strip in SciTE on Windows XP to be visible.
+ </li>
+ <li>
+ SciTE on Windows changes the way it detects that a tool has finished executing to ensure all output data
+ from the process is read.
+ </li>
+ <li>
+ SciTE on Windows improves the time taken to read output from tools that produce a large amount
+ of output by a factor of around 10.
+ </li>
+ <li>
+ On GTK+ the keyboard command for View | End of Line was changed to Ctrl+Shift+N
+ to avoid clash with Search | Selection Add Next.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1750/">Bug #1750</a>.
+ </li>
+ </ul>
+ <h3>
<a href="http://prdownloads.sourceforge.net/scintilla/scite360.zip?download">Release 3.6.0</a>
</h3>
<ul>
diff --git a/scintilla/doc/index.html b/scintilla/doc/index.html
index 90eb1c6..a77930f 100644
--- a/scintilla/doc/index.html
+++ b/scintilla/doc/index.html
@@ -9,7 +9,7 @@
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
- <meta name="Date.Modified" content="20150803" />
+ <meta name="Date.Modified" content="20150915" />
<style type="text/css">
#versionlist {
margin: 0;
@@ -55,8 +55,8 @@
GTK+, and OS X</font>
</td>
<td width="40%" align="right">
- <font color="#FFCC99" size="3"> Release version 3.6.0<br />
- Site last modified August 3 2015</font>
+ <font color="#FFCC99" size="3"> Release version 3.6.1<br />
+ Site last modified September 15 2015</font>
</td>
<td width="20%">
&nbsp;
@@ -71,6 +71,7 @@
</tr>
</table>
<ul id="versionlist">
+ <li>Version 3.6.1 adds minor features and fixes bugs.</li>
<li>Version 3.6.0 implements more multiple selection operations.
Type definitions Sci_Position, Sci_PositionU, and Sci_PositionCR allow client
code to prepare for a future change allowing larger than 2 GB documents.</li>
diff --git a/scintilla/include/SciLexer.h b/scintilla/include/SciLexer.h
index 233c507..adf45ec 100644
--- a/scintilla/include/SciLexer.h
+++ b/scintilla/include/SciLexer.h
@@ -499,6 +499,24 @@
#define SCE_ERR_JAVA_STACK 20
#define SCE_ERR_VALUE 21
#define SCE_ERR_GCC_INCLUDED_FROM 22
+#define SCE_ERR_ESCSEQ 23
+#define SCE_ERR_ESCSEQ_UNKNOWN 24
+#define SCE_ERR_ES_BLACK 40
+#define SCE_ERR_ES_RED 41
+#define SCE_ERR_ES_GREEN 42
+#define SCE_ERR_ES_BROWN 43
+#define SCE_ERR_ES_BLUE 44
+#define SCE_ERR_ES_MAGENTA 45
+#define SCE_ERR_ES_CYAN 46
+#define SCE_ERR_ES_GRAY 47
+#define SCE_ERR_ES_DARK_GRAY 48
+#define SCE_ERR_ES_BRIGHT_RED 49
+#define SCE_ERR_ES_BRIGHT_GREEN 50
+#define SCE_ERR_ES_YELLOW 51
+#define SCE_ERR_ES_BRIGHT_BLUE 52
+#define SCE_ERR_ES_BRIGHT_MAGENTA 53
+#define SCE_ERR_ES_BRIGHT_CYAN 54
+#define SCE_ERR_ES_WHITE 55
#define SCE_BAT_DEFAULT 0
#define SCE_BAT_COMMENT 1
#define SCE_BAT_WORD 2
@@ -1589,6 +1607,7 @@
#define SCE_COFFEESCRIPT_COMMENTBLOCK 22
#define SCE_COFFEESCRIPT_VERBOSE_REGEX 23
#define SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT 24
+#define SCE_COFFEESCRIPT_INSTANCEPROPERTY 25
#define SCE_AVS_DEFAULT 0
#define SCE_AVS_COMMENTBLOCK 1
#define SCE_AVS_COMMENTBLOCKN 2
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h
index cc8dfa2..432c3bc 100644
--- a/scintilla/include/Scintilla.h
+++ b/scintilla/include/Scintilla.h
@@ -196,6 +196,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_CHARSET_MAC 77
#define SC_CHARSET_OEM 255
#define SC_CHARSET_RUSSIAN 204
+#define SC_CHARSET_OEM866 866
#define SC_CHARSET_CYRILLIC 1251
#define SC_CHARSET_SHIFTJIS 128
#define SC_CHARSET_SYMBOL 2
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index 9b004e6..ec8d0bd 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -417,6 +417,7 @@ val SC_CHARSET_HANGUL=129
val SC_CHARSET_MAC=77
val SC_CHARSET_OEM=255
val SC_CHARSET_RUSSIAN=204
+val SC_CHARSET_OEM866=866
val SC_CHARSET_CYRILLIC=1251
val SC_CHARSET_SHIFTJIS=128
val SC_CHARSET_SYMBOL=2
@@ -2811,9 +2812,12 @@ val SCE_P_COMMENTBLOCK=12
val SCE_P_STRINGEOL=13
val SCE_P_WORD2=14
val SCE_P_DECORATOR=15
-# Lexical states for SCLEX_CPP
+# Lexical states for SCLEX_CPP, SCLEX_BULLANT, SCLEX_COBOL, SCLEX_TACL, SCLEX_TAL
lex Cpp=SCLEX_CPP SCE_C_
lex BullAnt=SCLEX_BULLANT SCE_C_
+lex COBOL=SCLEX_COBOL SCE_C_
+lex TACL=SCLEX_TACL SCE_C_
+lex TAL=SCLEX_TAL SCE_C_
val SCE_C_DEFAULT=0
val SCE_C_COMMENT=1
val SCE_C_COMMENTLINE=2
@@ -3100,10 +3104,13 @@ val SCE_RB_STDIN=30
val SCE_RB_STDOUT=31
val SCE_RB_STDERR=40
val SCE_RB_UPPER_BOUND=41
-# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC
+# Lexical states for SCLEX_VB, SCLEX_VBSCRIPT, SCLEX_POWERBASIC, SCLEX_BLITZBASIC, SCLEX_PUREBASIC, SCLEX_FREEBASIC
lex VB=SCLEX_VB SCE_B_
lex VBScript=SCLEX_VBSCRIPT SCE_B_
lex PowerBasic=SCLEX_POWERBASIC SCE_B_
+lex BlitzBasic=SCLEX_BLITZBASIC SCE_B_
+lex PureBasic=SCLEX_PUREBASIC SCE_B_
+lex FreeBasic=SCLEX_FREEBASIC SCE_B_
val SCE_B_DEFAULT=0
val SCE_B_COMMENT=1
val SCE_B_NUMBER=2
@@ -3198,6 +3205,24 @@ val SCE_ERR_TIDY=19
val SCE_ERR_JAVA_STACK=20
val SCE_ERR_VALUE=21
val SCE_ERR_GCC_INCLUDED_FROM=22
+val SCE_ERR_ESCSEQ=23
+val SCE_ERR_ESCSEQ_UNKNOWN=24
+val SCE_ERR_ES_BLACK=40
+val SCE_ERR_ES_RED=41
+val SCE_ERR_ES_GREEN=42
+val SCE_ERR_ES_BROWN=43
+val SCE_ERR_ES_BLUE=44
+val SCE_ERR_ES_MAGENTA=45
+val SCE_ERR_ES_CYAN=46
+val SCE_ERR_ES_GRAY=47
+val SCE_ERR_ES_DARK_GRAY=48
+val SCE_ERR_ES_BRIGHT_RED=49
+val SCE_ERR_ES_BRIGHT_GREEN=50
+val SCE_ERR_ES_YELLOW=51
+val SCE_ERR_ES_BRIGHT_BLUE=52
+val SCE_ERR_ES_BRIGHT_MAGENTA=53
+val SCE_ERR_ES_BRIGHT_CYAN=54
+val SCE_ERR_ES_WHITE=55
# Lexical states for SCLEX_BATCH
lex Batch=SCLEX_BATCH SCE_BAT_
val SCE_BAT_DEFAULT=0
@@ -4437,6 +4462,7 @@ val SCE_COFFEESCRIPT_TRIPLEVERBATIM=21
val SCE_COFFEESCRIPT_COMMENTBLOCK=22
val SCE_COFFEESCRIPT_VERBOSE_REGEX=23
val SCE_COFFEESCRIPT_VERBOSE_REGEX_COMMENT=24
+val SCE_COFFEESCRIPT_INSTANCEPROPERTY=25
# Lexical states for SCLEX_AVS
lex AVS=SCLEX_AVS SCE_AVS_
val SCE_AVS_DEFAULT=0
diff --git a/scintilla/lexers/LexCoffeeScript.cxx b/scintilla/lexers/LexCoffeeScript.cxx
index 0c80250..7e64b85 100644
--- a/scintilla/lexers/LexCoffeeScript.cxx
+++ b/scintilla/lexers/LexCoffeeScript.cxx
@@ -58,8 +58,7 @@ static bool FollowsPostfixOperator(StyleContext &sc, Accessor &styler) {
return false;
}
-static bool followsReturnKeyword(StyleContext &sc, Accessor &styler) {
- // Don't look at styles, so no need to flush.
+static bool followsKeyword(StyleContext &sc, Accessor &styler) {
Sci_Position pos = (Sci_Position) sc.currentPos;
Sci_Position currentLine = styler.GetLine(pos);
Sci_Position lineStartPos = styler.LineStart(currentLine);
@@ -69,15 +68,8 @@ static bool followsReturnKeyword(StyleContext &sc, Accessor &styler) {
break;
}
}
- const char *retBack = "nruter";
- const char *s = retBack;
- while (*s
- && pos >= lineStartPos
- && styler.SafeGetCharAt(pos) == *s) {
- s++;
- pos--;
- }
- return !*s;
+ styler.Flush();
+ return styler.StyleAt(pos) == SCE_COFFEESCRIPT_WORD;
}
static void ColouriseCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[],
@@ -146,6 +138,8 @@ static void ColouriseCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length
sc.ChangeState(SCE_COFFEESCRIPT_WORD2);
} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_COFFEESCRIPT_GLOBALCLASS);
+ } else if (sc.LengthCurrent() > 0 && s[0] == '@') {
+ sc.ChangeState(SCE_COFFEESCRIPT_INSTANCEPROPERTY);
}
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
@@ -153,6 +147,7 @@ static void ColouriseCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length
case SCE_COFFEESCRIPT_WORD:
case SCE_COFFEESCRIPT_WORD2:
case SCE_COFFEESCRIPT_GLOBALCLASS:
+ case SCE_COFFEESCRIPT_INSTANCEPROPERTY:
if (!setWord.Contains(sc.ch)) {
sc.SetState(SCE_COFFEESCRIPT_DEFAULT);
}
@@ -239,7 +234,7 @@ static void ColouriseCoffeeScriptDoc(Sci_PositionU startPos, Sci_Position length
sc.Forward();
} else if (sc.ch == '/'
&& (setOKBeforeRE.Contains(chPrevNonWhite)
- || followsReturnKeyword(sc, styler))
+ || followsKeyword(sc, styler))
&& (!setCouldBePostOp.Contains(chPrevNonWhite)
|| !FollowsPostfixOperator(sc, styler))) {
sc.SetState(SCE_COFFEESCRIPT_REGEX); // JavaScript's RegEx
diff --git a/scintilla/lexers/LexErrorList.cxx b/scintilla/lexers/LexErrorList.cxx
index be85cdc..f3d68f2 100644
--- a/scintilla/lexers/LexErrorList.cxx
+++ b/scintilla/lexers/LexErrorList.cxx
@@ -172,7 +172,7 @@ static int RecogniseErrorListLine(const char *lineBuffer, Sci_PositionU lengthLi
canBeCtags = false;
}
} else if (state == stGccStart) { // <filename>:
- state = Is1To9(ch) ? stGccDigit : stUnrecognized;
+ state = Is0To9(ch) ? stGccDigit : stUnrecognized;
} else if (state == stGccDigit) { // <filename>:<line>
if (ch == ':') {
state = stGccColumn; // :9.*: is GCC
@@ -259,19 +259,91 @@ static int RecogniseErrorListLine(const char *lineBuffer, Sci_PositionU lengthLi
}
}
+#define CSI "\033["
+
+namespace {
+
+bool SequenceEnd(int ch) {
+ return (ch == 0) || ((ch >= '@') && (ch <= '~'));
+}
+
+int StyleFromSequence(const char *seq) {
+ int bold = 0;
+ int colour = 0;
+ while (!SequenceEnd(*seq)) {
+ if (Is0To9(*seq)) {
+ int base = *seq - '0';
+ if (Is0To9(seq[1])) {
+ base = base * 10;
+ base += seq[1] - '0';
+ seq++;
+ }
+ if (base == 0) {
+ colour = 0;
+ bold = 0;
+ }
+ else if (base == 1) {
+ bold = 1;
+ }
+ else if (base >= 30 && base <= 37) {
+ colour = base - 30;
+ }
+ }
+ seq++;
+ }
+ return SCE_ERR_ES_BLACK + bold * 8 + colour;
+}
+
+}
+
static void ColouriseErrorListLine(
char *lineBuffer,
Sci_PositionU lengthLine,
Sci_PositionU endPos,
Accessor &styler,
- bool valueSeparate) {
+ bool valueSeparate,
+ bool escapeSequences) {
Sci_Position startValue = -1;
int style = RecogniseErrorListLine(lineBuffer, lengthLine, startValue);
- if (valueSeparate && (startValue >= 0)) {
- styler.ColourTo(endPos - (lengthLine - startValue), style);
- styler.ColourTo(endPos, SCE_ERR_VALUE);
+ if (escapeSequences && strstr(lineBuffer, CSI)) {
+ const int startPos = endPos - lengthLine;
+ const char *linePortion = lineBuffer;
+ int startPortion = startPos;
+ int portionStyle = style;
+ while (const char *startSeq = strstr(linePortion, CSI)) {
+ if (startSeq > linePortion) {
+ styler.ColourTo(startPortion + (startSeq - linePortion), portionStyle);
+ }
+ const char *endSeq = startSeq + 2;
+ while (!SequenceEnd(*endSeq))
+ endSeq++;
+ const int endSeqPosition = startPortion + (endSeq - linePortion) + 1;
+ switch (*endSeq) {
+ case 0:
+ styler.ColourTo(endPos, SCE_ERR_ESCSEQ_UNKNOWN);
+ return;
+ case 'm': // Colour command
+ styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ);
+ portionStyle = StyleFromSequence(startSeq+2);
+ break;
+ case 'K': // Erase to end of line -> ignore
+ styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ);
+ break;
+ default:
+ styler.ColourTo(endSeqPosition, SCE_ERR_ESCSEQ_UNKNOWN);
+ portionStyle = style;
+ }
+ startPortion = endSeqPosition;
+ linePortion = endSeq + 1;
+ }
+ styler.ColourTo(endPos, portionStyle);
} else {
- styler.ColourTo(endPos, style);
+ if (valueSeparate && (startValue >= 0)) {
+ styler.ColourTo(endPos - (lengthLine - startValue), style);
+ styler.ColourTo(endPos, SCE_ERR_VALUE);
+ } else {
+ styler.ColourTo(endPos, style);
+ }
}
}
@@ -287,17 +359,22 @@ static void ColouriseErrorListDoc(Sci_PositionU startPos, Sci_Position length, i
// line with style 21 used for the rest of the line.
// This allows matched text to be more easily distinguished from its location.
bool valueSeparate = styler.GetPropertyInt("lexer.errorlist.value.separate", 0) != 0;
+
+ // property lexer.errorlist.escape.sequences
+ // Set to 1 to interpret escape sequences.
+ const bool escapeSequences = styler.GetPropertyInt("lexer.errorlist.escape.sequences") != 0;
+
for (Sci_PositionU i = startPos; i < startPos + length; i++) {
lineBuffer[linePos++] = styler[i];
if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1)) {
// End of line (or of line buffer) met, colourise it
lineBuffer[linePos] = '\0';
- ColouriseErrorListLine(lineBuffer, linePos, i, styler, valueSeparate);
+ ColouriseErrorListLine(lineBuffer, linePos, i, styler, valueSeparate, escapeSequences);
linePos = 0;
}
}
if (linePos > 0) { // Last line does not have ending characters
- ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate);
+ ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate, escapeSequences);
}
}
diff --git a/scintilla/lexers/LexMySQL.cxx b/scintilla/lexers/LexMySQL.cxx
index c289ed5..87f537f 100644
--- a/scintilla/lexers/LexMySQL.cxx
+++ b/scintilla/lexers/LexMySQL.cxx
@@ -267,10 +267,13 @@ static void ColouriseMySQLDoc(Sci_PositionU startPos, Sci_Position length, int i
{
sc.SetState(SCE_MYSQL_COMMENT | activeState);
- // Skip comment introducer and check for hidden command.
- sc.Forward(2);
- if (sc.ch == '!')
+ // Skip first char of comment introducer and check for hidden command.
+ // The second char is skipped by the outer loop.
+ sc.Forward();
+ if (sc.GetRelativeCharacter(1) == '!')
{
+ // Version comment found. Skip * now.
+ sc.Forward();
activeState = HIDDENCOMMAND_STATE;
sc.ChangeState(SCE_MYSQL_HIDDENCOMMAND);
}
diff --git a/scintilla/lexers/LexVHDL.cxx b/scintilla/lexers/LexVHDL.cxx
index 5d89a8f..e30e261 100644
--- a/scintilla/lexers/LexVHDL.cxx
+++ b/scintilla/lexers/LexVHDL.cxx
@@ -216,7 +216,7 @@ static void FoldNoBoxVHDLDoc(
// don't check if the style for the keywords that I use to adjust the levels.
char words[] =
"architecture begin block case component else elsif end entity generate loop package process record then "
- "procedure function when units";
+ "procedure protected function when units";
WordList keywords;
keywords.Set(words);
@@ -381,6 +381,7 @@ static void FoldNoBoxVHDLDoc(
strcmp(s, "loop") == 0 ||
strcmp(s, "package") ==0 ||
strcmp(s, "process") == 0 ||
+ strcmp(s, "protected") == 0 ||
strcmp(s, "record") == 0 ||
strcmp(s, "then") == 0 ||
strcmp(s, "units") == 0)
diff --git a/scintilla/scripts/HeaderOrder.txt b/scintilla/scripts/HeaderOrder.txt
index eb00e16..ff92bac 100644
--- a/scintilla/scripts/HeaderOrder.txt
+++ b/scintilla/scripts/HeaderOrder.txt
@@ -33,6 +33,7 @@
#include <algorithm>
#include <memory>
#include <regex>
+#include <sstream>
// GTK+ headers
#include <glib.h>
diff --git a/scintilla/scripts/ScintillaData.py b/scintilla/scripts/ScintillaData.py
index f9c7718..a5f2695 100644
--- a/scintilla/scripts/ScintillaData.py
+++ b/scintilla/scripts/ScintillaData.py
@@ -24,9 +24,13 @@
# sorted list of lexer properties
# propertyDocuments
# dictionary of property documentation { name: document string }
+# sclexFromName
+# dictionary of SCLEX_* IDs { name: SCLEX_ID }
+# fileFromSclex
+# dictionary of file names { SCLEX_ID: file name }
# This file can be run to see the data it provides.
-# Requires Python 2.5 or later
+# Requires Python 2.7 or later
from __future__ import with_statement
@@ -36,11 +40,21 @@ import FileGenerator
def FindModules(lexFile):
modules = []
+ partLine = ""
with open(lexFile) as f:
for l in f.readlines():
- if l.startswith("LexerModule"):
- l = l.replace("(", " ")
- modules.append(l.split()[1])
+ l = l.rstrip()
+ if partLine or l.startswith("LexerModule"):
+ if ")" in l:
+ l = partLine + l
+ l = l.replace("(", " ")
+ l = l.replace(")", " ")
+ l = l.replace(",", " ")
+ parts = l.split()
+ modules.append([parts[1], parts[2], parts[4][1:-1]])
+ partLine = ""
+ else:
+ partLine = partLine + l
return modules
# Properties that start with lexer. or fold. are automatically found but there are some
@@ -185,8 +199,14 @@ class ScintillaData:
self.lexerModules = []
lexerProperties = set()
self.propertyDocuments = {}
+ self.sclexFromName = {}
+ self.fileFromSclex = {}
for lexFile in lexFilePaths:
- self.lexerModules.extend(FindModules(lexFile))
+ modules = FindModules(lexFile)
+ for module in modules:
+ self.sclexFromName[module[2]] = module[1]
+ self.fileFromSclex[module[1]] = lexFile
+ self.lexerModules.append(module[0])
for k in FindProperties(lexFile).keys():
lexerProperties.add(k)
documents = FindPropertyDocumentation(lexFile)
@@ -209,6 +229,12 @@ if __name__=="__main__":
sci.dateModified, sci.yearModified, sci.mdyModified, sci.dmyModified, sci.myModified))
printWrapped(str(len(sci.lexFiles)) + " lexer files: " + ", ".join(sci.lexFiles))
printWrapped(str(len(sci.lexerModules)) + " lexer modules: " + ", ".join(sci.lexerModules))
+ print("Lexer name to ID:")
+ lexNames = sorted(sci.sclexFromName.keys())
+ for lexName in lexNames:
+ sclex = sci.sclexFromName[lexName]
+ fileName = os.path.basename(sci.fileFromSclex[sclex])
+ print(" " + lexName + " -> " + sclex + " in " + fileName)
printWrapped("Lexer properties: " + ", ".join(sci.lexerProperties))
print("Lexer property documentation:")
documentProperties = list(sci.propertyDocuments.keys())
diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx
index 31ef548..b955be1 100644
--- a/scintilla/src/Document.cxx
+++ b/scintilla/src/Document.cxx
@@ -1325,8 +1325,6 @@ int Document::CountCharacters(int startPos, int endPos) const {
int i = startPos;
while (i < endPos) {
count++;
- if (IsCrLf(i))
- i++;
i = NextPosition(i, 1);
}
return count;
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index a7de643..5479ac5 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -1948,11 +1948,25 @@ void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
}
}
-void Editor::FillVirtualSpace() {
- const bool tmpOverstrike = inOverstrike;
- inOverstrike = false; // not allow to be deleted twice.
- AddCharUTF("", 0);
- inOverstrike = tmpOverstrike;
+void Editor::ClearBeforeTentativeStart() {
+ // Make positions for the first composition string.
+ for (size_t r = 0; r<sel.Count(); r++) {
+ if (!RangeContainsProtected(sel.Range(r).Start().Position(),
+ sel.Range(r).End().Position())) {
+ int positionInsert = sel.Range(r).Start().Position();
+ if (!sel.Range(r).Empty()) {
+ if (sel.Range(r).Length()) {
+ pdoc->DeleteChars(positionInsert, sel.Range(r).Length());
+ sel.Range(r).ClearVirtualSpace();
+ } else {
+ // Range is all virtual so collapse to start of virtual space
+ sel.Range(r).MinimizeVirtualSpace();
+ }
+ }
+ InsertSpace(positionInsert, sel.Range(r).caret.VirtualSpace());
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
}
void Editor::InsertPaste(const char *text, int len) {
diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h
index a83062f..aae574a 100644
--- a/scintilla/src/Editor.h
+++ b/scintilla/src/Editor.h
@@ -392,7 +392,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
int InsertSpace(int position, unsigned int spaces);
void AddChar(char ch);
virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false);
- void FillVirtualSpace();
+ void ClearBeforeTentativeStart();
void InsertPaste(const char *text, int len);
enum PasteShape { pasteStream=0, pasteRectangular = 1, pasteLine = 2 };
void InsertPasteShape(const char *text, int len, PasteShape shape);
diff --git a/scintilla/version.txt b/scintilla/version.txt
index 0f1ef13..2f5742f 100644
--- a/scintilla/version.txt
+++ b/scintilla/version.txt
@@ -1 +1 @@
-360
+361
diff --git a/scintilla/win32/ScintillaWin.cxx b/scintilla/win32/ScintillaWin.cxx
index 38b576e..dfa71f2 100644
--- a/scintilla/win32/ScintillaWin.cxx
+++ b/scintilla/win32/ScintillaWin.cxx
@@ -111,6 +111,12 @@
#define SC_INDICATOR_CONVERTED INDIC_IME+2
#define SC_INDICATOR_UNKNOWN INDIC_IME_MAX
+#ifndef SCS_CAP_SETRECONVERTSTRING
+#define SCS_CAP_SETRECONVERTSTRING 0x00000004
+#define SCS_QUERYRECONVERTSTRING 0x00020000
+#define SCS_SETRECONVERTSTRING 0x00010000
+#endif
+
typedef BOOL (WINAPI *TrackMouseEventSig)(LPTRACKMOUSEEVENT);
typedef UINT_PTR (WINAPI *SetCoalescableTimerSig)(HWND hwnd, UINT_PTR nIDEvent,
UINT uElapse, TIMERPROC lpTimerFunc, ULONG uToleranceDelay);
@@ -183,6 +189,23 @@ public:
DropTarget();
};
+namespace {
+
+class IMContext {
+ HWND hwnd;
+public:
+ HIMC hIMC;
+ IMContext(HWND hwnd_) :
+ hwnd(hwnd_), hIMC(::ImmGetContext(hwnd_)) {
+ }
+ ~IMContext() {
+ if (hIMC)
+ ::ImmReleaseContext(hwnd, hIMC);
+ }
+};
+
+}
+
/**
*/
class ScintillaWin :
@@ -296,6 +319,7 @@ class ScintillaWin :
// DBCS
void ImeStartComposition();
void ImeEndComposition();
+ LRESULT ImeOnReconvert(LPARAM lParam);
void GetIntelliMouseParameters();
virtual void CopyToClipboard(const SelectionText &selectedText);
@@ -777,10 +801,10 @@ sptr_t ScintillaWin::WndPaint(uptr_t wParam) {
sptr_t ScintillaWin::HandleCompositionWindowed(uptr_t wParam, sptr_t lParam) {
if (lParam & GCS_RESULTSTR) {
- HIMC hIMC = ::ImmGetContext(MainHWND());
- if (hIMC) {
+ IMContext imc(MainHWND());
+ if (imc.hIMC) {
wchar_t wcs[maxLenInputIME];
- LONG bytes = ::ImmGetCompositionStringW(hIMC,
+ LONG bytes = ::ImmGetCompositionStringW(imc.hIMC,
GCS_RESULTSTR, wcs, (maxLenInputIME-1)*2);
int wides = bytes / 2;
if (IsUnicodeMode()) {
@@ -803,8 +827,7 @@ sptr_t ScintillaWin::HandleCompositionWindowed(uptr_t wParam, sptr_t lParam) {
CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos.x = static_cast<int>(pos.x);
CompForm.ptCurrentPos.y = static_cast<int>(pos.y);
- ::ImmSetCompositionWindow(hIMC, &CompForm);
- ::ImmReleaseContext(MainHWND(), hIMC);
+ ::ImmSetCompositionWindow(imc.hIMC, &CompForm);
}
return 0;
}
@@ -841,16 +864,15 @@ void ScintillaWin::DrawImeIndicator(int indicator, int len) {
}
void ScintillaWin::SetCandidateWindowPos() {
- HIMC hIMC = ::ImmGetContext(MainHWND());
- if (hIMC) {
+ IMContext imc(MainHWND());
+ if (imc.hIMC) {
Point pos = PointMainCaret();
CANDIDATEFORM CandForm;
CandForm.dwIndex = 0;
CandForm.dwStyle = CFS_CANDIDATEPOS;
CandForm.ptCurrentPos.x = static_cast<int>(pos.x);
CandForm.ptCurrentPos.y = static_cast<int>(pos.y + vs.lineHeight);
- ::ImmSetCandidateWindow(hIMC, &CandForm);
- ::ImmReleaseContext(MainHWND(), hIMC);
+ ::ImmSetCandidateWindow(imc.hIMC, &CandForm);
}
}
@@ -922,15 +944,14 @@ void ScintillaWin::EscapeHanja() {
std::wstring uniChar = StringDecode(oneChar, CodePageOfDocument());
- HIMC hIMC=ImmGetContext(MainHWND());
- if (hIMC) {
+ IMContext imc(MainHWND());
+ if (imc.hIMC) {
// Set the candidate box position since IME may show it.
SetCandidateWindowPos();
// IME_ESC_HANJA_MODE appears to receive the first character only.
- if (ImmEscapeW(GetKeyboardLayout(0), hIMC, IME_ESC_HANJA_MODE, &uniChar[0])) {
+ if (ImmEscapeW(GetKeyboardLayout(0), imc.hIMC, IME_ESC_HANJA_MODE, &uniChar[0])) {
SetSelection (currentPos, currentPos + oneCharLen);
}
- ::ImmReleaseContext(MainHWND(), hIMC);
}
}
@@ -952,8 +973,8 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
// Copy & paste by johnsonj with a lot of helps of Neil.
// Great thanks for my foreruners, jiniya and BLUEnLIVE.
- HIMC hIMC = ::ImmGetContext(MainHWND());
- if (!hIMC) {
+ IMContext imc(MainHWND());
+ if (!imc.hIMC) {
return 0;
}
@@ -962,7 +983,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
} else {
// No tentative undo means start of this composition so
// fill in any virtual spaces.
- FillVirtualSpace();
+ ClearBeforeTentativeStart();
}
view.imeCaretBlockOverride = false;
@@ -970,12 +991,11 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
if (lParam & GCS_COMPSTR) {
wchar_t wcs[maxLenInputIME] = { 0 };
long bytes = ::ImmGetCompositionStringW
- (hIMC, GCS_COMPSTR, wcs, maxLenInputIME);
+ (imc.hIMC, GCS_COMPSTR, wcs, maxLenInputIME);
unsigned int wcsLen = bytes / 2;
if ((wcsLen == 0) || (wcsLen >= maxLenInputIME)) {
ShowCaretAtCurrentPosition();
- ::ImmReleaseContext(MainHWND(), hIMC);
return 0;
}
@@ -986,10 +1006,10 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
unsigned int imeCursorPos = 0;
if (lParam & GCS_COMPATTR) {
- ImmGetCompositionStringW(hIMC, GCS_COMPATTR, compAttr, sizeof(compAttr));
+ ImmGetCompositionStringW(imc.hIMC, GCS_COMPATTR, compAttr, sizeof(compAttr));
}
if (lParam & GCS_CURSORPOS) {
- imeCursorPos = ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, NULL, 0);
+ imeCursorPos = ImmGetCompositionStringW(imc.hIMC, GCS_CURSORPOS, NULL, 0);
}
// Display character by character.
@@ -1018,7 +1038,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
// Record compstr character positions for moving IME carets.
numBytes += oneCharLen;
- imeCharPos[i + 1] = numBytes;
+ imeCharPos[i + ucWidth] = numBytes;
// Draw an indicator on the character.
int indicator = SC_INDICATOR_UNKNOWN;
@@ -1047,7 +1067,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
} else if (lParam & GCS_RESULTSTR) {
wchar_t wcs[maxLenInputIME] = { 0 };
long bytes = ::ImmGetCompositionStringW
- (hIMC, GCS_RESULTSTR, wcs, maxLenInputIME);
+ (imc.hIMC, GCS_RESULTSTR, wcs, maxLenInputIME);
unsigned int wcsLen = bytes / 2;
for (size_t i = 0; i < wcsLen;) {
@@ -1071,7 +1091,6 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
EnsureCaretVisible();
SetCandidateWindowPos();
ShowCaretAtCurrentPosition();
- ::ImmReleaseContext(MainHWND(), hIMC);
return 0;
}
@@ -1319,9 +1338,8 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
case WM_LBUTTONDOWN: {
// For IME, set the composition string as the result string.
- HIMC hIMC = ::ImmGetContext(MainHWND());
- ::ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
- ::ImmReleaseContext(MainHWND(), hIMC);
+ IMContext imc(MainHWND());
+ ::ImmNotifyIME(imc.hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
//
//Platform::DebugPrintf("Buttdown %d %x %x %x %x %x\n",iMessage, wParam, lParam,
// Platform::IsKeyDown(VK_SHIFT),
@@ -1454,6 +1472,13 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
}
+ case WM_IME_REQUEST: {
+ if (wParam == IMR_RECONVERTSTRING) {
+ return ImeOnReconvert(lParam);
+ }
+ return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
+ }
+
case WM_KEYUP:
//Platform::DebugPrintf("S keyup %d %x %x\n",iMessage, wParam, lParam);
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
@@ -1478,10 +1503,9 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
DestroySystemCaret();
}
// Explicitly complete any IME composition
- HIMC hIMC = ImmGetContext(MainHWND());
- if (hIMC) {
- ::ImmNotifyIME(hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
- ::ImmReleaseContext(MainHWND(), hIMC);
+ IMContext imc(MainHWND());
+ if (imc.hIMC) {
+ ::ImmNotifyIME(imc.hIMC, NI_COMPOSITIONSTR, CPS_COMPLETE, 0);
}
}
break;
@@ -2571,14 +2595,14 @@ DropTarget::DropTarget() {
void ScintillaWin::ImeStartComposition() {
if (caret.active) {
// Move IME Window to current caret position
- HIMC hIMC = ::ImmGetContext(MainHWND());
+ IMContext imc(MainHWND());
Point pos = PointMainCaret();
COMPOSITIONFORM CompForm;
CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos.x = static_cast<int>(pos.x);
CompForm.ptCurrentPos.y = static_cast<int>(pos.y);
- ::ImmSetCompositionWindow(hIMC, &CompForm);
+ ::ImmSetCompositionWindow(imc.hIMC, &CompForm);
// Set font of IME window to same as surrounded text.
if (stylesValid) {
@@ -2605,9 +2629,8 @@ void ScintillaWin::ImeStartComposition() {
UTF16FromUTF8(fontName, strlen(fontName)+1, lf.lfFaceName, LF_FACESIZE);
}
- ::ImmSetCompositionFontW(hIMC, &lf);
+ ::ImmSetCompositionFontW(imc.hIMC, &lf);
}
- ::ImmReleaseContext(MainHWND(), hIMC);
// Caret is displayed in IME window. So, caret in Scintilla is useless.
DropCaret();
}
@@ -2618,6 +2641,88 @@ void ScintillaWin::ImeEndComposition() {
ShowCaretAtCurrentPosition();
}
+LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) {
+ // Reconversion on windows limits within one line without eol.
+ // Look around: baseStart <-- (|mainStart| -- mainEnd) --> baseEnd.
+ const int mainStart = sel.RangeMain().Start().Position();
+ const int mainEnd = sel.RangeMain().End().Position();
+ const int curLine = pdoc->LineFromPosition(mainStart);
+ if (curLine != pdoc->LineFromPosition(mainEnd))
+ return 0;
+ const int baseStart = pdoc->LineStart(curLine);
+ const int baseEnd = pdoc->LineEnd(curLine);
+ if ((baseStart == baseEnd) || (mainEnd > baseEnd))
+ return 0;
+
+ const int codePage = CodePageOfDocument();
+ const std::wstring rcFeed = StringDecode(RangeText(baseStart, baseEnd), codePage);
+ const int rcFeedLen = static_cast<int>(rcFeed.length()) * sizeof(wchar_t);
+ const int rcSize = sizeof(RECONVERTSTRING) + rcFeedLen + sizeof(wchar_t);
+
+ RECONVERTSTRING *rc = (RECONVERTSTRING *)lParam;
+ if (!rc)
+ return rcSize; // Immediately be back with rcSize of memory block.
+
+ wchar_t *rcFeedStart = (wchar_t*)(rc + 1);
+ memcpy(rcFeedStart, &rcFeed[0], rcFeedLen);
+
+ std::string rcCompString = RangeText(mainStart, mainEnd);
+ std::wstring rcCompWstring = StringDecode(rcCompString, codePage);
+ std::string rcCompStart = RangeText(baseStart, mainStart);
+ std::wstring rcCompWstart = StringDecode(rcCompStart, codePage);
+
+ // Map selection to dwCompStr.
+ // No selection assumes current caret as rcCompString without length.
+ rc->dwVersion = 0; // It should be absolutely 0.
+ rc->dwStrLen = (DWORD)static_cast<int>(rcFeed.length());
+ rc->dwStrOffset = sizeof(RECONVERTSTRING);
+ rc->dwCompStrLen = (DWORD)static_cast<int>(rcCompWstring.length());
+ rc->dwCompStrOffset = (DWORD)static_cast<int>(rcCompWstart.length()) * sizeof(wchar_t);
+ rc->dwTargetStrLen = rc->dwCompStrLen;
+ rc->dwTargetStrOffset =rc->dwCompStrOffset;
+
+ IMContext imc(MainHWND());
+ if (!imc.hIMC)
+ return 0;
+
+ if (!::ImmSetCompositionStringW(imc.hIMC, SCS_QUERYRECONVERTSTRING, rc, rcSize, NULL, 0))
+ return 0;
+
+ // No selection asks IME to fill target fields with its own value.
+ int tgWlen = rc->dwTargetStrLen;
+ int tgWstart = rc->dwTargetStrOffset / sizeof(wchar_t);
+
+ std::string tgCompStart = StringEncode(rcFeed.substr(0, tgWstart), codePage);
+ std::string tgComp = StringEncode(rcFeed.substr(tgWstart, tgWlen), codePage);
+
+ // No selection needs to adjust reconvert start position for IME set.
+ int adjust = static_cast<int>(tgCompStart.length() - rcCompStart.length());
+ int docCompLen = static_cast<int>(tgComp.length());
+
+ // Make place for next composition string to sit in.
+ for (size_t r=0; r<sel.Count(); r++) {
+ int rBase = sel.Range(r).Start().Position();
+ int docCompStart = rBase + adjust;
+
+ if (inOverstrike) { // the docCompLen of bytes will be overstriked.
+ sel.Range(r).caret.SetPosition(docCompStart);
+ sel.Range(r).anchor.SetPosition(docCompStart);
+ } else {
+ // Ensure docCompStart+docCompLen be not beyond lineEnd.
+ // since docCompLen by byte might break eol.
+ int lineEnd = pdoc->LineEnd(pdoc->LineFromPosition(rBase));
+ int overflow = (docCompStart + docCompLen) - lineEnd;
+ if (overflow > 0) {
+ pdoc->DeleteChars(docCompStart, docCompLen - overflow);
+ } else {
+ pdoc->DeleteChars(docCompStart, docCompLen);
+ }
+ }
+ }
+ // Immediately Target Input or candidate box choice with GCS_COMPSTR.
+ return rcSize;
+}
+
void ScintillaWin::GetIntelliMouseParameters() {
// This retrieves the number of lines per scroll as configured inthe Mouse Properties sheet in Control Panel
::SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &linesPerScroll, 0);