summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2016-01-26 21:30:28 +0200
committerXhmikosR <xhmikosr@gmail.com>2016-01-26 21:30:28 +0200
commitb46520698a0913e1d97148398b0b99ea0491ef6d (patch)
tree4ddaf35c990c567751f2734b433c2cba443ce28f
parentc8b14b4821a3197d26b6bd2d65b0fca490bc1d09 (diff)
downloadnotepad2-mod-b46520698a0913e1d97148398b0b99ea0491ef6d.zip
notepad2-mod-b46520698a0913e1d97148398b0b99ea0491ef6d.tar.gz
notepad2-mod-b46520698a0913e1d97148398b0b99ea0491ef6d.tar.bz2
Update Scintilla to v3.6.3 HG (25eaad4).4.2.25.970
-rw-r--r--scintilla/cppcheck.suppress3
-rw-r--r--scintilla/doc/Design.html18
-rw-r--r--scintilla/doc/Icons.html6
-rw-r--r--scintilla/doc/Lexer.txt18
-rw-r--r--scintilla/doc/Privacy.html2
-rw-r--r--scintilla/doc/SciCoding.html2
-rw-r--r--scintilla/doc/ScintillaDoc.html48
-rw-r--r--scintilla/doc/ScintillaDownload.html12
-rw-r--r--scintilla/doc/ScintillaHistory.html135
-rw-r--r--scintilla/doc/ScintillaRelated.html108
-rw-r--r--scintilla/doc/ScintillaToDo.html2
-rw-r--r--scintilla/doc/ScintillaUsage.html16
-rw-r--r--scintilla/doc/index.html13
-rw-r--r--scintilla/include/Platform.h2
-rw-r--r--scintilla/include/Scintilla.h6
-rw-r--r--scintilla/include/Scintilla.iface20
-rw-r--r--scintilla/include/ScintillaWidget.h27
-rw-r--r--scintilla/lexers/LexA68k.cxx178
-rw-r--r--scintilla/lexers/LexAVS.cxx2
-rw-r--r--scintilla/lexers/LexBash.cxx82
-rw-r--r--scintilla/lexers/LexCPP.cxx6
-rw-r--r--scintilla/lexers/LexECL.cxx10
-rw-r--r--scintilla/lexers/LexErrorList.cxx5
-rw-r--r--scintilla/lexers/LexHTML.cxx2
-rw-r--r--scintilla/lexers/LexKVIrc.cxx2
-rw-r--r--scintilla/lexers/LexLaTeX.cxx10
-rw-r--r--scintilla/lexers/LexLua.cxx2
-rw-r--r--scintilla/lexers/LexMatlab.cxx10
-rw-r--r--scintilla/lexers/LexMySQL.cxx14
-rw-r--r--scintilla/lexers/LexOScript.cxx4
-rw-r--r--scintilla/lexers/LexPO.cxx32
-rw-r--r--scintilla/lexers/LexPerl.cxx134
-rw-r--r--scintilla/lexers/LexRust.cxx6
-rw-r--r--scintilla/lexers/LexSQL.cxx10
-rw-r--r--scintilla/lexers/LexTCMD.cxx4
-rw-r--r--scintilla/lexers/LexVisualProlog.cxx17
-rw-r--r--scintilla/scripts/Face.py34
-rw-r--r--scintilla/scripts/FileGenerator.py4
-rw-r--r--scintilla/scripts/GenerateCaseConvert.py20
-rw-r--r--scintilla/scripts/LexGen.py6
-rw-r--r--scintilla/scripts/ScintillaData.py4
-rw-r--r--scintilla/src/CellBuffer.cxx19
-rw-r--r--scintilla/src/CellBuffer.h1
-rw-r--r--scintilla/src/Document.cxx42
-rw-r--r--scintilla/src/Document.h8
-rw-r--r--scintilla/src/EditModel.h2
-rw-r--r--scintilla/src/EditView.cxx21
-rw-r--r--scintilla/src/Editor.cxx158
-rw-r--r--scintilla/src/Editor.h8
-rw-r--r--scintilla/src/Indicator.cxx2
-rw-r--r--scintilla/src/PerLine.cxx3
-rw-r--r--scintilla/src/ScintillaBase.cxx4
-rw-r--r--scintilla/src/UniConversion.cxx4
-rw-r--r--scintilla/src/UniConversion.h4
-rw-r--r--scintilla/version.txt2
-rw-r--r--scintilla/win32/PlatWin.cxx19
-rw-r--r--scintilla/win32/ScintillaWin.cxx192
57 files changed, 987 insertions, 538 deletions
diff --git a/scintilla/cppcheck.suppress b/scintilla/cppcheck.suppress
index edbff28..b13cc7d 100644
--- a/scintilla/cppcheck.suppress
+++ b/scintilla/cppcheck.suppress
@@ -15,7 +15,7 @@ unusedPrivateFunction:scintilla/win32/PlatWin.cxx
// Suppress most lexer warnings since the lexers are maintained by others
useInitializationList:scintilla/lexers/LexAsm.cxx
useInitializationList:scintilla/lexers/LexBasic.cxx
-noCopyConstructor:scintilla/lexers/LexBash.cxx
+uninitMemberVar:scintilla/lexers/LexBash.cxx
variableScope:scintilla/lexers/LexBash.cxx
variableScope:scintilla/lexers/LexBatch.cxx
variableScope:scintilla/lexers/LexCmake.cxx
@@ -31,7 +31,6 @@ variableScope:scintilla/lexers/LexNimrod.cxx
variableScope:scintilla/lexers/LexNsis.cxx
variableScope:scintilla/lexers/LexOpal.cxx
variableScope:scintilla/lexers/LexPB.cxx
-noCopyConstructor:scintilla/lexers/LexPerl.cxx
variableScope:scintilla/lexers/LexRuby.cxx
uninitMemberVar:scintilla/lexers/LexRuby.cxx
variableScope:scintilla/lexers/LexSpecman.cxx
diff --git a/scintilla/doc/Design.html b/scintilla/doc/Design.html
index 1becd98..9b204b9 100644
--- a/scintilla/doc/Design.html
+++ b/scintilla/doc/Design.html
@@ -6,7 +6,7 @@
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Scintilla and SciTE
</title>
@@ -49,7 +49,7 @@
library and with limited use of templates.
</p>
<p>
- The currently supported platforms, Windows, GTK+/Linux and wxWindows are fairly similar in
+ The currently supported platforms, Windows, GTK+/Linux and wxWindows are fairly similar in
many ways.
Each has windows, menus and bitmaps. These features generally work in similar ways so each
has a way to move a window or draw a red line. Sometimes one platform requires a sequence of
@@ -100,7 +100,7 @@
have to use the limited set of already available colours.
</p>
A Palette object holds a set of colour pairs and can make the appropriate calls to ask to
- allocate these colours and to see what the platform has decided will be allowed.
+ allocate these colours and to see what the platform has decided will be allowed.
<h4>
Font
</h4>
@@ -164,7 +164,7 @@
</h3>
<p>
The bulk of Scintilla's code is platform independent. This is made up of the CellBuffer,
- ContractionState, Document, Editor, Indicator, LineMarker, Style, ViewStyle, KeyMap,
+ ContractionState, Document, Editor, Indicator, LineMarker, Style, ViewStyle, KeyMap,
ScintillaBase, CallTip,
and AutoComplete primary classes.
</p>
@@ -204,14 +204,14 @@
</h4>
<p>
The Editor object is central to Scintilla. It is responsible for displaying a document and
- responding to user actions and requests from the container. It uses ContractionState, Indicator,
- LineMarker, Style, and ViewStyle objects to display the document and a KeyMap class to
- map key presses to functions.
- The visibility of each line is kept in the ContractionState which is also responsible for mapping
+ responding to user actions and requests from the container. It uses ContractionState, Indicator,
+ LineMarker, Style, and ViewStyle objects to display the document and a KeyMap class to
+ map key presses to functions.
+ The visibility of each line is kept in the ContractionState which is also responsible for mapping
from display lines to documents lines and vice versa.
</p>
<p>
- There may be multiple Editor objects attached to one Document object. Changes to a
+ There may be multiple Editor objects attached to one Document object. Changes to a
document are broadcast to the editors through the DocWatcher mechanism.
</p>
<h4>
diff --git a/scintilla/doc/Icons.html b/scintilla/doc/Icons.html
index b27de52..e8aae1c 100644
--- a/scintilla/doc/Icons.html
+++ b/scintilla/doc/Icons.html
@@ -6,7 +6,7 @@
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Scintilla icons
</title>
@@ -27,10 +27,10 @@
Icons
</h2>
<p>
- These images may be used under the same license as Scintilla.
+ These images may be used under the same license as Scintilla.
</p>
<p>
- Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson.
+ Drawn by Iago Rubio, Philippe Lhoste, and Neil Hodgson.
</p>
<p>
<a href="http://prdownloads.sourceforge.net/scintilla/icons1.zip?download">zip format</a> (70K)
diff --git a/scintilla/doc/Lexer.txt b/scintilla/doc/Lexer.txt
index a9b75a2..5c20d36 100644
--- a/scintilla/doc/Lexer.txt
+++ b/scintilla/doc/Lexer.txt
@@ -47,7 +47,7 @@ The task of a lexer can be summarized briefly: for each range r of
characters that are to be colored the same, the lexer should call
styler.ColourTo(i, state)
-
+
where i is the position of the last character of the range r. The lexer
should set the state variable to the coloring state of the character at
position i and continue until the entire text has been colored.
@@ -139,8 +139,8 @@ characters in ASCII for operators, comment markers, etc.
Special case: Folding
-Folding may be performed in the lexer function. It is better to use a
-separate folder function as that avoids some troublesome interaction
+Folding may be performed in the lexer function. It is better to use a
+separate folder function as that avoids some troublesome interaction
between styling and folding. The folder function will be run after the
lexer function if folding is enabled. The rest of this section explains
how to perform folding within the lexer function.
@@ -148,15 +148,15 @@ how to perform folding within the lexer function.
During initialization, lexers that support folding set
bool fold = styler.GetPropertyInt("fold");
-
+
If folding is enabled in the editor, fold will be TRUE and the lexer
should call:
styler.SetLevel(line, level);
-
+
at the end of each line and just before exiting.
-The line parameter is simply the count of the number of newlines seen.
+The line parameter is simply the count of the number of newlines seen.
It's initial value is styler.GetLine(startPos) and it is incremented
(after calling styler.SetLevel) whenever a newline is seen.
@@ -169,7 +169,7 @@ comments, of course).
The following flag bits, defined in Scintilla.h, may be set or cleared
in the flags parameter. The SC_FOLDLEVELWHITEFLAG flag is set if the
lexer considers that the line contains nothing but whitespace. The
-SC_FOLDLEVELHEADERFLAG flag indicates that the line is a fold point.
+SC_FOLDLEVELHEADERFLAG flag indicates that the line is a fold point.
This normally means that the next line has a greater level than present
line. However, the lexer may have some other basis for determining a
fold point. For example, a lexer might create a header line for the
@@ -193,7 +193,7 @@ seen:
if ((levelCurrent > levelPrev) && (visChars > 0))
lev |= SC_FOLDLEVELHEADERFLAG;
styler.SetLevel(lineCurrent, lev);
-
+
// reinitialize the folding vars describing the present line.
lineCurrent++;
visChars = 0; // Number of non-whitespace characters on the line.
@@ -210,7 +210,7 @@ The following code appears in the C++ lexer just before exit:
flagsNext &= ~SC_FOLDLEVELNUMBERMASK;
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
}
-
+
Don't worry about performance
diff --git a/scintilla/doc/Privacy.html b/scintilla/doc/Privacy.html
index 34eda60..85cb801 100644
--- a/scintilla/doc/Privacy.html
+++ b/scintilla/doc/Privacy.html
@@ -5,7 +5,7 @@
<head>
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Privacy Policy
</title>
diff --git a/scintilla/doc/SciCoding.html b/scintilla/doc/SciCoding.html
index c18bfdd..f2c2624 100644
--- a/scintilla/doc/SciCoding.html
+++ b/scintilla/doc/SciCoding.html
@@ -5,7 +5,7 @@
<head>
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Scintilla and SciTE Code Style Preferences
</title>
diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html
index e77c064..b1b550f 100644
--- a/scintilla/doc/ScintillaDoc.html
+++ b/scintilla/doc/ScintillaDoc.html
@@ -82,7 +82,7 @@
<h1>Scintilla Documentation</h1>
- <p>Last edited 31 July 2015 NH</p>
+ <p>Last edited 6 January 2016 NH</p>
<p>There is <a class="jump" href="Design.html">an overview of the internal design of
Scintilla</a>.<br />
@@ -1501,6 +1501,7 @@ struct Sci_TextToFind {
<p><b id="SCI_POSITIONRELATIVE">SCI_POSITIONRELATIVE(int position, int relative)</b><br />
Count a number of whole characters before or after the argument position and return that position.
The minimum position returned is 0 and the maximum is the last position in the document.
+ If the position goes past the document end then 0 is returned.
</p>
<p><b id="SCI_COUNTCHARACTERS">SCI_COUNTCHARACTERS(int startPos, int endPos)</b><br />
@@ -2391,6 +2392,8 @@ struct Sci_TextToFind {
<a class="message" href="#SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</a><br />
<a class="message" href="#SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char
*styles)</a><br />
+ <a class="message" href="#SCI_SETIDLESTYLING">SCI_SETIDLESTYLING(int idleStyling)</a><br />
+ <a class="message" href="#SCI_GETIDLESTYLING">SCI_GETIDLESTYLING</a><br />
<a class="message" href="#SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</a><br />
<a class="message" href="#SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</a><br />
<a class="message" href="#SCI_GETMAXLINESTATE">SCI_GETMAXLINESTATE</a><br />
@@ -2426,6 +2429,23 @@ struct Sci_TextToFind {
<code>SCI_STARTSTYLING</code> should be called before the first call to this.
</p>
+ <p><b id="SCI_SETIDLESTYLING">SCI_SETIDLESTYLING(int idleStyling)</b><br />
+ <b id="SCI_GETIDLESTYLING">SCI_GETIDLESTYLING</b><br />
+ By default, <code>SC_IDLESTYLING_NONE</code> (0),
+ syntax styling is performed for all the currently visible text before displaying it.
+ On very large files, this may make scrolling down slow.
+ With <code>SC_IDLESTYLING_TOVISIBLE</code> (1),
+ a small amount of styling is performed before display and then
+ further styling is performed incrementally in the background as an idle-time task.
+ This may result in the text initially appearing uncoloured and then, some time later, it is coloured.
+ Text after the currently visible portion may be styled in the background with <code>SC_IDLESTYLING_AFTERVISIBLE</code> (2).
+ To style both before and after the visible text in the background use <code>SC_IDLESTYLING_ALL</code> (3).
+ </p>
+ <p>
+ Since wrapping also needs to perform styling and also uses idle time, this setting has no effect when
+ the document is displayed wrapped.
+ </p>
+
<p><b id="SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</b><br />
<b id="SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</b><br />
As well as the 8 bits of lexical state stored for each character there is also an integer
@@ -2711,7 +2731,7 @@ struct Sci_TextToFind {
<p><b id="SCI_STYLESETCASE">SCI_STYLESETCASE(int styleNumber, int caseMode)</b><br />
<b id="SCI_STYLEGETCASE">SCI_STYLEGETCASE(int styleNumber)</b><br />
The value of caseMode determines how text is displayed. You can set upper case
- (<code>SC_CASE_UPPER</code>, 1) or lower case (<code>SC_CASE_LOWER</code>, 2) or camel case (<code>SC_CASE_CAMEL</code>, 3)
+ (<code>SC_CASE_UPPER</code>, 1) or lower case (<code>SC_CASE_LOWER</code>, 2) or camel case (<code>SC_CASE_CAMEL</code>, 3)
or display normally (<code>SC_CASE_MIXED</code>, 0). This does not change the stored text, only how it is
displayed.</p>
@@ -4237,9 +4257,9 @@ struct Sci_TextToFind {
<b id="SCI_INDICSETHOVERFORE">SCI_INDICSETHOVERFORE(int indicatorNumber, int <a class="jump" href="#colour">colour</a>)</b><br />
<b id="SCI_INDICGETHOVERFORE">SCI_INDICGETHOVERFORE(int indicatorNumber)</b><br />
These messages set and get the colour and style used to draw indicators when the mouse is over them or the caret moved into them.
- The mouse cursor also changes when an indicator is drawn in hover style.
+ The mouse cursor also changes when an indicator is drawn in hover style.
The default is for the hover appearance to be the same as the normal appearance and calling
- <a class="message" href="#SCI_INDICSETFORE">SCI_INDICSETFORE</a> or
+ <a class="message" href="#SCI_INDICSETFORE">SCI_INDICSETFORE</a> or
<a class="message" href="#SCI_INDICSETSTYLE">SCI_INDICSETSTYLE</a> will
also reset the hover attribute.</p>
@@ -6556,7 +6576,7 @@ struct SCNotification {
int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
int updated; /* SCN_UPDATEUI */
- int listCompletionMethod;
+ int listCompletionMethod;
/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION */
};
@@ -7249,19 +7269,19 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
<tr>
<td align="left"><code>ch</code></td>
- <td align="left">If a fillup character was the method of selection, the used
+ <td align="left">If a fillup character was the method of selection, the used
character, otherwise 0.</td>
</tr>
<tr>
<td align="left"><code>listCompletionMethod</code></td>
- <td align="left">A value indicating the way in which the completion
+ <td align="left">A value indicating the way in which the completion
occurred. See the table below.</td>
</tr>
</tbody>
</table>
<br />
-
+
See the <code><a class="jump" href="#SCN_AUTOCCOMPLETED">SCN_AUTOCCOMPLETED</a></code> notification
for the possible values for <code>listCompletionMethod.</code>
<p><b id="SCN_URIDROPPED">SCN_URIDROPPED</b><br />
@@ -7377,13 +7397,13 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
<tr>
<td align="left"><code>ch</code></td>
- <td align="left">If a fillup character was the method of selection, the used
+ <td align="left">If a fillup character was the method of selection, the used
character, otherwise 0.</td>
</tr>
<tr>
<td align="left"><code>listCompletionMethod</code></td>
- <td align="left">A value indicating the way in which the completion
+ <td align="left">A value indicating the way in which the completion
occurred. See the table below.</td>
</tr>
</tbody>
@@ -7407,7 +7427,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
<td align="center">0x01</td>
- <td>A fillup character triggered the completion. The character used is
+ <td>A fillup character triggered the completion. The character used is
in ch. </td>
</tr>
@@ -7446,7 +7466,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
<td>The
<code>
- <a class="message" href="#SCI_AUTOCSELECT">SCI_AUTOCSELECT</a></code> message
+ <a class="message" href="#SCI_AUTOCSELECT">SCI_AUTOCSELECT</a></code> message
triggered the completion. ch is 0.</td>
</tr>
@@ -7467,7 +7487,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
<code>SCN_FOCUSOUT</code> (2029) when it loses focus.</p>
<p><b id="SCN_AUTOCCOMPLETED">SCN_AUTOCCOMPLETED<br />
- </b>This notification is generated after an autocompletion has inserted its
+ </b>This notification is generated after an autocompletion has inserted its
text. The fields are identical to the
<code>
<a class="jump" href="#SCN_AUTOCSELECTION">SCN_AUTOCSELECTION</a></code>
@@ -7624,7 +7644,7 @@ EM_FORMATRANGE
<b id="SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</b> Deprecated<br />
Scintilla no longer supports palette mode. The last version to support palettes was 2.29.
Any calls to these methods should be removed.</p>
-
+
<p><b id="SCI_SETKEYSUNICODE">SCI_SETKEYSUNICODE(bool keysUnicode)</b> Deprecated<br />
<b id="SCI_GETKEYSUNICODE">SCI_GETKEYSUNICODE</b> Deprecated<br />
On Windows, Scintilla no longer supports narrow character windows so input is always treated as Unicode.</p>
diff --git a/scintilla/doc/ScintillaDownload.html b/scintilla/doc/ScintillaDownload.html
index 7d7169c..a86f1ed 100644
--- a/scintilla/doc/ScintillaDownload.html
+++ b/scintilla/doc/ScintillaDownload.html
@@ -6,7 +6,7 @@
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Download Scintilla
</title>
@@ -26,9 +26,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
- <font size="4"> <a href="http://www.scintilla.org/scintilla362.zip">
+ <font size="4"> <a href="http://www.scintilla.org/scintilla363.zip">
Windows</a>&nbsp;&nbsp;
- <a href="http://www.scintilla.org/scintilla362.tgz">
+ <a href="http://www.scintilla.org/scintilla363.tgz">
GTK+/Linux</a>&nbsp;&nbsp;
</font>
</td>
@@ -42,7 +42,7 @@
containing very few restrictions.
</p>
<h3>
- Release 3.6.2
+ Release 3.6.3
</h3>
<h4>
Source Code
@@ -50,8 +50,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/scintilla362.zip">zip format</a> (1500K) commonly used on Windows</li>
- <li><a href="http://www.scintilla.org/scintilla362.tgz">tgz format</a> (1400K) commonly used on Linux and compatible operating systems</li>
+ <li><a href="http://www.scintilla.org/scintilla363.zip">zip format</a> (1500K) commonly used on Windows</li>
+ <li><a href="http://www.scintilla.org/scintilla363.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 05f531c..e2e57c8 100644
--- a/scintilla/doc/ScintillaHistory.html
+++ b/scintilla/doc/ScintillaHistory.html
@@ -6,7 +6,7 @@
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Scintilla and SciTE
</title>
@@ -476,6 +476,10 @@
<td>Jonathan Hunt</td>
<td>Serg Stetsuk</td>
<td>Jordan Jueckstock</td>
+ </tr><tr>
+ <td>Yury Dubinsky</td>
+ <td>Sam Hocevar</td>
+ <td>Luyomi</td>
</tr>
</table>
<p>
@@ -488,6 +492,135 @@
</li>
</ul>
<h3>
+ <a href="http://www.scintilla.org/scite364.zip">Release 3.6.4</a>
+ </h3>
+ <ul>
+ <li>
+ Released 18 January 2016.
+ </li>
+ <li>
+ For the HTML lexer, limit the extent of Mako line comments to finish before
+ the line end characters.
+ </li>
+ <li>
+ For Qt, release builds have assertions turned off.
+ </li>
+ <li>
+ For Qt on Windows, fix compilation failure for Qt 4.x.
+ </li>
+ <li>
+ IME target range displayed on Qt for OS X.
+ </li>
+ </ul>
+ <h3>
+ <a href="http://www.scintilla.org/scite363.zip">Release 3.6.3</a>
+ </h3>
+ <ul>
+ <li>
+ Released 18 January 2016.
+ </li>
+ <li>
+ Allow painting without first styling all visible text then styling in the background
+ using idle-time. This helps performance when scrolling down in very large documents.
+ Can also incrementally style after the visible area to the end of the document so that
+ the document is already styled when the user scrolls to it.
+ </li>
+ <li>
+ Support GObject introspection on GTK+.
+ </li>
+ <li>
+ SciTE supports pasting to each selection with the selection.multipaste setting.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1123/">Feature #1123.</a>
+ </li>
+ <li>
+ SciTE can optionally display a read-only indicator on tabs and in the Buffers menu.
+ </li>
+ <li>
+ Bash lexer flags incomplete here doc delimiters as syntax errors.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1789/">Bug #1789</a>.<br />
+ Support added for using '#' in non-comment ways as is possible with zsh.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1794/">Bug #1794</a>.<br />
+ Recognize more characters as here-doc delimiters.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1778/">Bug #1778</a>.
+ </li>
+ <li>
+ Errorlist lexer highlights warning messages from the Microsoft linker.
+ </li>
+ <li>
+ Errorlist lexer fixes bug with final line in escape sequence recognition mode.
+ </li>
+ <li>
+ Lua lexer includes '&amp;' and '|' bitwise operators for Lua 5.3.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1790/">Bug #1790</a>.
+ </li>
+ <li>
+ Perl lexer updated for Perl 5.20 and 5.22.<br />
+ Allow '_' for subroutine prototypes.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1791/">Bug #1791</a>.<br />
+ Double-diamond operator &lt;&lt;&gt;&gt;.<br />
+ Hexadecimal floating point literals.<br />
+ Repetition in list assignment.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1793/">Bug #1793</a>.<br />
+ Highlight changed subroutine prototype syntax for Perl 5.20.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1797/">Bug #1797</a>.<br />
+ Fix module ::-syntax when special characters such as 'x' are used.<br />
+ Added ' and " detection as prefix chars for x repetition operator.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1800/">Bug #1800</a>.
+ </li>
+ <li>
+ Visual Prolog lexer recognizes numbers more accurately and allows non-ASCII verbatim
+ quoting characters.
+ <a href="http://sourceforge.net/p/scintilla/feature-requests/1130/">Feature #1130.</a>
+ </li>
+ <li>
+ Send SCN_UPDATEUI with SC_UPDATE_SELECTION when the application changes multiple
+ selection.
+ </li>
+ <li>
+ Expand folded areas before deleting fold header line.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1796/">Bug #1796</a>.
+ </li>
+ <li>
+ Treat Unicode line ends like common line ends when maintaining fold state.
+ </li>
+ <li>
+ Highlight whole run for hover indicator when wrapped.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1784/">Bug #1784</a>.
+ </li>
+ <li>
+ On Cocoa, fix crash when autocompletion list closed during scroll bounce-back.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1788/">Bug #1788</a>.
+ </li>
+ <li>
+ On Windows, fix non-BMP input through WM_CHAR and allow WM_UNICHAR to work
+ with non-BMP characters and on non-Unicode documents.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1779/">Bug #1779</a>.
+ </li>
+ <li>
+ On Windows using DirectWrite, for ligatures and other character clusters,
+ display caret and selections part-way through clusters so that the caret doesn't stick
+ to the end of the cluster making it easier to understand editing actions.
+ </li>
+ <li>
+ On Windows, Scintilla no longer uses a .DEF file during linking as it duplicates
+ source code directives.
+ </li>
+ <li>
+ On GTK+ and Qt, Korean input by word fixed.
+ </li>
+ <li>
+ On GTK+, Qt, and Win32 block IME input when document is read-only or any selected text
+ is protected.
+ </li>
+ <li>
+ On GTK+ on OS X, fix warning during destruction.
+ <a href="http://sourceforge.net/p/scintilla/bugs/1777/">Bug #1777</a>.
+ </li>
+ <li>
+ Fix SciTE crashes when using LPEG lexers.
+ </li>
+ </ul>
+ <h3>
<a href="http://www.scintilla.org/scite362.zip">Release 3.6.2</a>
</h3>
<ul>
diff --git a/scintilla/doc/ScintillaRelated.html b/scintilla/doc/ScintillaRelated.html
index 2403ee1..60d3a4f 100644
--- a/scintilla/doc/ScintillaRelated.html
+++ b/scintilla/doc/ScintillaRelated.html
@@ -6,7 +6,7 @@
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Scintilla and SciTE Related Sites
</title>
@@ -38,7 +38,7 @@
is a port to MorphOS.
</p>
<p>
- <a href="https://metacpan.org/module/Wx::Scintilla">Wx::Scintilla</a>
+ <a href="https://metacpan.org/pod/Wx::Scintilla">Wx::Scintilla</a>
is a Perl Binding for Scintilla on wxWidgets.
</p>
<p>
@@ -50,7 +50,7 @@
these programs, using all the typical GObject conventions.
</p>
<p>
- <a href="http://mewsoft.com/cgi-bin/forum/forum.cgi?action=ViewTopic&Topic=1494&Forum=1&Page=1&Period=0a&Lang=English">Editawy</a>
+ <a href="http://www.mewsoft.com/forums/source-code-editor-activex-control-released-scintilla-activex-wrapper-control&amp;action=ViewTopic&amp;Topic=1494&amp;Forum=1&amp;Page=1&amp;Period=0a&amp;Lang=English">Editawy</a>
is an ActiveX Control wrapper that support all Scintilla functions and additional high level functions.
</p>
<p>
@@ -76,7 +76,7 @@
</a> is an encapsulation of Scintilla for use within the .NET framework.
</p>
<p>
- <a href="http://www.riverbankcomputing.co.uk/software/qscintilla/intro">QScintilla
+ <a href="https://riverbankcomputing.com/software/qscintilla/intro">QScintilla
</a> is a port of Scintilla to the Qt platform. It has a similar license to Qt: GPL for use in
free software and commercial for use in close-source applications.
</p>
@@ -128,7 +128,16 @@
Projects using Scintilla
</h3>
<p>
- <a href="http://rhaberkorn.github.com/sciteco/">SciTECO</a>
+ <a href="http://studio.zerobrane.com">ZeroBrane Studio Lua IDE</a>
+ is a lightweight Lua IDE with code completion, syntax highlighting, live
+ coding, remote debugger, and code analyzer (Windows, OSX, and Linux).
+ </p>
+ <p>
+ <a href="http://www.xml-buddy.com/">XML Validator Buddy</a>
+ is an XML/JSON editor and XML validator for Windows.
+ </p>
+ <p>
+ <a href="https://github.com/rhaberkorn/sciteco">SciTECO</a>
is an advanced TECO dialect and interactive screen editor based on Scintilla.
</p>
<p>
@@ -154,7 +163,7 @@
is a cross-platform, visual database design, sql coding and administration tool.
</p>
<p>
- <a href="http://liveditor.com/index.html">LIVEditor</a>
+ <a href="http://liveditor.com/index.php">LIVEditor</a>
is for web front end coders editing html/css/js code.
</p>
<p>
@@ -171,14 +180,14 @@
</p>
<p>
<a href="https://launchpad.net/codeassistor">The CodeAssistor Editor</a>
- is a small and simple MacOSX source code editor.
+ is a small and simple source code editor for MacOSX, Windows, and GTK/Linux.
</p>
<p>
<a href="http://www.topwizprogramming.com/freecode_pbeditor.html">PBEditor</a>
is a text editor for PowerBuilder.
</p>
<p>
- <a href="http://www.cryptool.org/">CrypTool</a>
+ <a href="https://www.cryptool.org/en/">CrypTool</a>
is an application for applying and analyzing cryptographic algorithms.
</p>
<p>
@@ -191,15 +200,11 @@
is a simple programming language with a Visual Basic like syntax.
</p>
<p>
- <a href="http://www.daansystems.com/lispide">LispIDE</a>
+ <a href="http://www.daansystems.com/lispide/">LispIDE</a>
is a basic Lisp editor for Windows 2000, XP and Vista.
</p>
<p>
- <a href="http://www.flexsoft.cc/download.htm">FlexEdit</a>
- is Free Text/Hex Editor for Windows.
- </p>
- <p>
- <a href="http://www.assembla.com/wiki/show/FileWorkbench">File Workbench:</a>
+ <a href="https://www.assembla.com/wiki/show/FileWorkbench">File Workbench:</a>
a file manager / text editor environment with Squirrel scripting.
</p>
<p>
@@ -207,19 +212,11 @@
is a free, easy and comfortable cross-platform editor written in Perl.
</p>
<p>
- <a href="http://top.gresham-computing.com">TOP</a>
- is an interface to HP's NonStop servers which run a proprietary OS.
- </p>
- <p>
<a href="http://universalindent.sourceforge.net/">UniversalIndentGUI</a>
is a cross platform GUI for several code formatters, beautifiers and indenters
like GreatCode, AStyle (Artistic Styler), GNU Indent, BCPP and so on.
</p>
<p>
- <a href="http://scitools.com/products/trackback/product.php">TrackBack</a>
- watches and backs up every change made in your source code.
- </p>
- <p>
<a href="http://elementaryreports.com/">Elementary Reports</a>
is designed to reduce the time to compose detailed and professional primary school reports.
</p>
@@ -234,12 +231,12 @@
class diagrams.
</p>
<p>
- The <a href="http://www.adobe.com/devnet/bridge/">ExtendScript Toolkit</a>
+ The <a href="http://www.adobe.com/devnet/bridge.html">ExtendScript Toolkit</a>
is a development and debugging tool for JavaScript
scripts included with Adobe CS3 Suites.
</p>
<p>
- <a href="http://tortoisesvn.net/">TortoiseSVN</a>
+ <a href="https://tortoisesvn.net/">TortoiseSVN</a>
is a Windows GUI client for the Subversion source control software.
</p>
<p>
@@ -264,7 +261,7 @@
is a graphical user interface for changing SciTE properties files.
</p>
<p>
- <a href="http://www.totalcmd.net/plugring/SciLister.html">Scintilla Lister</a>
+ <a href="http://totalcmd.net/plugring/SciLister.html">Scintilla Lister</a>
is a plugin for Total Commander allowing viewing all documents with syntax highlighting
inside Total Commander.
</p>
@@ -280,7 +277,7 @@
Code::Blocks</a> is an open source, cross platform free C++ IDE.
</p>
<p>
- <a href="http://notepad-plus.sourceforge.net/uk/site.htm">
+ <a href="https://notepad-plus-plus.org/">
Notepad++</a> is a free source code editor under Windows.
</p>
<p>
@@ -292,7 +289,7 @@
LSW DotNet-Lab</a> is a development environment for the .NET platform.
</p>
<p>
- <a href="http://glintercept.nutty.org/">
+ <a href="https://github.com/dtrebilco/glintercept">
GLIntercept</a> is an OpenGL function call interceptor that uses SciTE as a
run-time shader editor.
</p>
@@ -309,7 +306,7 @@
PyCrash Viewer</a> can examine crash dumps of Python programs.
</p>
<p>
- <a href="http://www.cabletest.com/mpt-wa-software-discovery.shtml">
+ <a href="http://www.cabletest.com/en/featured_products_MPT2.aspx">
MPT series Wire Analyzers</a> use Scintilla and SciTE.
</p>
<p>
@@ -331,19 +328,15 @@
is a user-friendly source code editor easily extended using Python.
</p>
<p>
- <a href="http://www.spaceblue.com/venis/">
+ <a href="http://www.spaceblue.com/products/venis/index.html">
Venis IX</a>,
the Visual Environment for NSIS (Nullsoft Scriptable Install System).
</p>
<p>
- <a href="http://www.die-offenbachs.de/detlev/eric.html">Eric3</a>
+ <a href="http://eric-ide.python-projects.org/">Eric3</a>
is a Python IDE written using PyQt and QScintilla.
</p>
<p>
- <a href="http://www.bomberstudios.com/sciteflash/">SciTE|Flash</a>
- is a free Scintilla-based ActionScript editor for Windows.
- </p>
- <p>
<a href="http://www.computersciencelab.com/CppIde.htm">CPPIDE</a>
is part of some commercial high-school oriented programming course software.
</p>
@@ -360,25 +353,17 @@
Basic interpreter that uses the wxWidgets toolkit. A small IDE is under construction.
</p>
<p>
- <a href="http://freeride.rubyforge.org/wiki/wiki.pl">FreeRIDE</a> will be a
- cross-platform IDE for the Ruby programming language.
- </p>
- <p>
<a href="http://visual-mingw.sourceforge.net/">Visual MinGW</a> is an
IDE for the MinGW compiler system.This runs on Windows with gcc.
</p>
<p>
- The <a href="http://archaeopteryx.com/wingide">Wing IDE</a> is a
+ The <a href="http://archaeopteryx.com/">Wing IDE</a> is a
complete integrated development environment for the Python programming
language.
Available on Intel based Linux and Windows and on MacOS X through XDarwin.
</p>
<p>
- <a href="http://www.gorlice.net.pl/~rybak/luaide/">LuaIDE</a>
- is an IDE for Lua on Windows.
- </p>
- <p>
- <a href="http://www.aegisknight.org/sphere/">Sphere</a>
+ <a href="http://www.spheredev.org/">Sphere</a>
is 2D RPG engine with a development environment.
</p>
<p>
@@ -400,20 +385,10 @@
on either the same or another machine.
</p>
<p>
- <a href="http://www.rexx.com/~dkuhlman/">pyeditor and wxEditor</a>
- are scriptable editors implemented in Python. pyeditor is based on GTK+ and
- the pyscintilla wrapper. wxEditor is based on wxWidgets, wxPython and
- wxStyledTextControl.
- </p>
- <p>
<a href="http://sourceforge.net/projects/pycrust/">PyCrust</a> is an interactive
Python shell based on wxPython.
</p>
<p>
- <a href="http://www.thekompany.com/products/blackadder/">Black Adder</a> is a
- Qt based development environment for Python and Ruby.
- </p>
- <p>
<a href="http://www.activestate.com/Products/Komodo/">Komodo</a>
is a cross-platform multi-language development environment built
as an application of Mozilla.
@@ -425,16 +400,16 @@
will be of interest to others wanting to control SciTE.
</p>
<p>
- <a href="http://anjuta.sourceforge.net/">Anjuta</a>
+ <a href="http://anjuta.org/">Anjuta</a>
is an open source C/C++ IDE for Linux/GNOME.
</p>
<p>
- A <a href="http://www.burgaud.com">version of SciTE for Win32</a> enhanced
+ A <a href="https://www.burgaud.com">version of SciTE for Win32</a> enhanced
with a tab control to allow easy movement between buffers.
Go to the "Goodies" area on this site.
</p>
<p>
- <a href="http://www.suneido.com">
+ <a href="http://suneido.com">
Suneido</a> is an integrated application platform currently available for Win32 that includes an
object-oriented language, client-server database, and user interface and reporting frameworks.
</p>
@@ -449,7 +424,7 @@
wxStyledTextCtrl used as its editor.
</p>
<p>
- <a href="http://www.python.org/download/windows/">PythonWin</a>, a Win32 IDE for Python, uses
+ <a href="https://www.python.org/download/windows/">PythonWin</a>, a Win32 IDE for Python, uses
Scintilla for both its editing and interactive windows.
</p>
<h3>
@@ -464,7 +439,7 @@
is a Unicode aware syntax editor control for Delphi and C++ Builder.
</p>
<p>
- <a href="http://projects.gnome.org/gtksourceview/">GtkSourceView</a>
+ <a href="https://wiki.gnome.org/Projects/GtkSourceView">GtkSourceView</a>
is a text widget that extends the standard GTK+ 2.x text widget and improves it
by implementing syntax highlighting and other features typical of a source editor.
</p>
@@ -473,7 +448,7 @@
is a free source code editing component implemented in Ruby.
</p>
<p>
- <a href="http://www.actiprosoftware.com/Products/DotNet/SyntaxEditor/Default.aspx">SyntaxEditor</a>
+ <a href="http://www.actiprosoftware.com/products/controls/wpf/syntaxeditor">SyntaxEditor</a>
is a commercial native .Net source code editing component.
</p>
<p>
@@ -483,7 +458,7 @@
<p>
<a href="http://www.gtk.org/">GTK+</a>, the GIMP Toolkit, contains a rich text editing
widget.<br />
- <a href="http://gedit.sourceforge.net/">Gedit</a> is an editor for GTK+/GNOME.<br />
+ <a href="https://wiki.gnome.org/Apps/Gedit">Gedit</a> is an editor for GTK+/GNOME.<br />
<!--
<a href="http://www.daimi.au.dk/~mailund/gtk.html">GtkEditor</a> is a source code editing
widget based on the GTK+ text widget.<br />
@@ -496,15 +471,12 @@
<a href="http://www.codeguru.com/">CodeGuru</a> has source code for several Win32 MFC based
editors.
</p>
- <a href="http://synedit.sourceforge.net/">SynEdit</a> is a Win32 edit control written
+ <a href="http://sourceforge.net/projects/synedit/">SynEdit</a> is a Win32 edit control written
in Delphi.
<p>
<a href="http://www.tetradyne.com/srcvwax.htm">SourceView</a> is a commercial editing
component for Win32.
</p>
- <p>
- <a href="http://www.winmain.com/">CodeMax</a> is another commercial component for Win32.
- </p>
<h3>
Documents
</h3>
@@ -540,9 +512,9 @@
WinMerge over the files to work out how to merge.
</p>
<p>
- <a href="http://www.python.org">Python</a> is my favourite programming language. Scintilla
+ <a href="https://www.python.org">Python</a> is my favourite programming language. Scintilla
was started after I tried to improve the editor built into <a
- href="http://www.python.org/download/windows/">PythonWin</a>, but was frustrated by the limitations of
+ href="https://www.python.org/download/windows/">PythonWin</a>, but was frustrated by the limitations of
the Windows Richedit control which PythonWin used.
</p>
<p>
@@ -550,7 +522,7 @@
implementation of regular expression pattern matching used in Scintilla.
</p>
<p>
- Inspirational coding soundscapes by <a href="http://www.davidbridie.com.au">David Bridie</a>.
+ Inspirational coding soundscapes by <a href="http://www.davidbridie.com/">David Bridie</a>.
</p>
</body>
</html>
diff --git a/scintilla/doc/ScintillaToDo.html b/scintilla/doc/ScintillaToDo.html
index 5b29942..c408acf 100644
--- a/scintilla/doc/ScintillaToDo.html
+++ b/scintilla/doc/ScintillaToDo.html
@@ -6,7 +6,7 @@
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Scintilla and SciTE To Do
</title>
diff --git a/scintilla/doc/ScintillaUsage.html b/scintilla/doc/ScintillaUsage.html
index 14bec8f..da850f9 100644
--- a/scintilla/doc/ScintillaUsage.html
+++ b/scintilla/doc/ScintillaUsage.html
@@ -6,7 +6,7 @@
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<meta name="generator" content="SciTE" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>
Scintilla Usage Notes
</title>
@@ -191,7 +191,7 @@ SPAN {
class='S11'>linebuf</span><span class='S10'>)));</span><span class='S0'><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span> <span class='S10'>}</span><span class='S0'><br />
</span> <span class='S10'>}</span><br />
-
+
<p style="margin-bottom: 0in">
Of course, fancier handling could be implemented. For example, if the previous line was the
start of a control construct, the next line could be automatically indented one tab further.
@@ -249,7 +249,7 @@ SPAN {
class='S11'>endStyled</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>notification</span><span class='S10'>-&gt;</span><span
class='S11'>position</span><span class='S10'>);</span><br />
-
+
<p>
Colourize(start, end) retrieves the specified range of text and then calls ColourizeDoc in
keywords.cxx. It starts the process by calling:
@@ -259,7 +259,7 @@ SPAN {
class='S11'>SCI_STARTSTYLING</span><span class='S10'>,</span><span class='S0'>&nbsp;</span>
<span class='S11'>startPos</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S4'>31</span><span class='S10'>);</span><br />
-
+
<p>
and then for each token of the text, calling:
</p>
@@ -268,7 +268,7 @@ SPAN {
class='S11'>SCI_SETSTYLING</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>length</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S11'>style</span><span class='S10'>);</span><br />
-
+
<p>
where style is a number from 0 to 31 whose appearance has been defined using the
SCI_STYLESET... messages.
@@ -324,7 +324,7 @@ SPAN {
class='S10'>=</span><span class='S0'>&nbsp;</span> <span class='S11'>linebuf</span><span
class='S0'>&nbsp;</span> <span class='S10'>+</span><span class='S0'>&nbsp;</span> <span
class='S11'>startword</span><span class='S10'>;</span><br />
-
+
<p>
Then if a calltip is available it can be displayed. The calltip appears immediately below
the position specified. The calltip can be multiple lines separated by newlines (\n).
@@ -344,7 +344,7 @@ SPAN {
class='S11'>wordLen</span><span class='S0'>&nbsp;</span> <span class='S10'>-</span><span
class='S0'>&nbsp;</span> <span class='S4'>1</span><span class='S10'>,</span><span
class='S0'>&nbsp;</span> <span class='S11'>calltip</span><span class='S10'>);</span><br />
-
+
<p>
The calltip can be removed when a closing parenthesis is entered:
</p>
@@ -360,7 +360,7 @@ SPAN {
SCI_CALLTIPCANCEL</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span
class='S4'>0</span><span class='S10'>,</span><span class='S0'>&nbsp;</span> <span class='S4'>
0</span><span class='S10'>);</span><br />
-
+
<p>
Obviously, it is up the application to look after supplying the appropriate calltip text.
</p>
diff --git a/scintilla/doc/index.html b/scintilla/doc/index.html
index 21297c0..7716147 100644
--- a/scintilla/doc/index.html
+++ b/scintilla/doc/index.html
@@ -9,8 +9,8 @@
<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="20151106" />
- <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="Date.Modified" content="20160118" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
#versionlist {
margin: 0;
@@ -56,8 +56,8 @@
GTK+, and OS X</font>
</td>
<td width="40%" align="right">
- <font color="#FFCC99" size="3"> Release version 3.6.2<br />
- Site last modified November 6 2015</font>
+ <font color="#FFCC99" size="3"> Release version 3.6.3<br />
+ Site last modified January 18 2016</font>
</td>
<td width="20%">
&nbsp;
@@ -72,6 +72,7 @@
</tr>
</table>
<ul id="versionlist">
+ <li>Version 3.6.3 supports idle-time styling.</li>
<li>Version 3.6.2 fixes crashes and other bugs, particularly on Cocoa.</li>
<li>Version 3.6.1 adds minor features and fixes bugs.</li>
<li>Version 3.6.0 implements more multiple selection operations.
@@ -151,7 +152,7 @@ if (!IsRemote()) { //if NOT remote...
</p>
<p>
Questions and comments about Scintilla should be directed to the
- <a href="http://groups.google.com/group/scintilla-interest">scintilla-interest</a>
+ <a href="https://groups.google.com/forum/#!forum/scintilla-interest">scintilla-interest</a>
mailing list,
which is for discussion of Scintilla and related projects, their bugs and future features.
This is a low traffic list, averaging less than 20 messages per week.
@@ -176,7 +177,7 @@ if (IsRemote()) {
//-->
</script>
<noscript>
-<a href="http://sourceforge.net/projects/scintilla">
+<a href="http://sourceforge.net/projects/scintilla/">
<img src="http://sflogo.sourceforge.net/sflogo.php?group_id=2439&amp;type=8" width="80" height="15" alt="Get Scintilla at SourceForge.net. Fast, secure and Free Open Source software downloads" /></a>
</noscript>
</body>
diff --git a/scintilla/include/Platform.h b/scintilla/include/Platform.h
index dbc986d..28d34f4 100644
--- a/scintilla/include/Platform.h
+++ b/scintilla/include/Platform.h
@@ -145,7 +145,7 @@ public:
(pt.y >= top) && (pt.y <= bottom);
}
bool ContainsWholePixel(Point pt) const {
- // Does the rectangle contain all of the pixel to left/below the point
+ // Does the rectangle contain all of the pixel to left/below the point
return (pt.x >= left) && ((pt.x+1) <= right) &&
(pt.y >= top) && ((pt.y+1) <= bottom);
}
diff --git a/scintilla/include/Scintilla.h b/scintilla/include/Scintilla.h
index 77b2078..c742534 100644
--- a/scintilla/include/Scintilla.h
+++ b/scintilla/include/Scintilla.h
@@ -506,6 +506,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_WORDSTARTPOSITION 2266
#define SCI_WORDENDPOSITION 2267
#define SCI_ISRANGEWORD 2691
+#define SC_IDLESTYLING_NONE 0
+#define SC_IDLESTYLING_TOVISIBLE 1
+#define SC_IDLESTYLING_AFTERVISIBLE 2
+#define SC_IDLESTYLING_ALL 3
+#define SCI_SETIDLESTYLING 2692
+#define SCI_GETIDLESTYLING 2693
#define SC_WRAP_NONE 0
#define SC_WRAP_WORD 1
#define SC_WRAP_CHAR 2
diff --git a/scintilla/include/Scintilla.iface b/scintilla/include/Scintilla.iface
index fb7d053..6e2928a 100644
--- a/scintilla/include/Scintilla.iface
+++ b/scintilla/include/Scintilla.iface
@@ -249,11 +249,11 @@ enu IMEInteraction=SC_IME_
val SC_IME_WINDOWED=0
val SC_IME_INLINE=1
-# Is the IME displayed in a winow or inline?
+# Is the IME displayed in a window or inline?
get int GetIMEInteraction=2678(,)
# Choose to display the the IME in a winow or inline.
-set void SetIMEInteraction=2679(int imeInteraction,)
+set void SetIMEInteraction=2679(int imeInteraction,)
enu MarkerSymbol=SC_MARK_
val MARKER_MAX=31
@@ -1260,6 +1260,18 @@ fun int WordEndPosition=2267(position pos, bool onlyWordCharacters)
# Is the range start..end considered a word?
fun bool IsRangeWord=2691(position start, position end)
+enu IdleStyling=SC_IDLESTYLING_
+val SC_IDLESTYLING_NONE=0
+val SC_IDLESTYLING_TOVISIBLE=1
+val SC_IDLESTYLING_AFTERVISIBLE=2
+val SC_IDLESTYLING_ALL=3
+
+# Sets limits to idle styling.
+set void SetIdleStyling=2692(int idleStyling,)
+
+# Retrieve the limits to idle styling.
+get int GetIdleStyling=2693(,)
+
enu Wrap=SC_WRAP_
val SC_WRAP_NONE=0
val SC_WRAP_WORD=1
@@ -1408,7 +1420,7 @@ val SC_MULTIPASTE_EACH=1
# Change the effect of pasting when there are multiple selections.
set void SetMultiPaste=2614(int multiPaste,)
-# Retrieve the effect of pasting when there are multiple selections..
+# Retrieve the effect of pasting when there are multiple selections.
get int GetMultiPaste=2615(,)
# Retrieve the value of a tag from a regular expression search.
@@ -1977,7 +1989,7 @@ val SC_MULTIAUTOC_EACH=1
# Change the effect of autocompleting when there are multiple selections.
set void AutoCSetMulti=2636(int multi,)
-# Retrieve the effect of autocompleting when there are multiple selections..
+# Retrieve the effect of autocompleting when there are multiple selections.
get int AutoCGetMulti=2637(,)
enu Ordering=SC_ORDER_
diff --git a/scintilla/include/ScintillaWidget.h b/scintilla/include/ScintillaWidget.h
index 0ae8fab..8409c65 100644
--- a/scintilla/include/ScintillaWidget.h
+++ b/scintilla/include/ScintillaWidget.h
@@ -1,8 +1,9 @@
/* Scintilla source code edit control */
-/** @file ScintillaWidget.h
- ** Definition of Scintilla widget for GTK+.
- ** Only needed by GTK+ code but is harmless on other platforms.
- **/
+/* @file ScintillaWidget.h
+ * Definition of Scintilla widget for GTK+.
+ * Only needed by GTK+ code but is harmless on other platforms.
+ * This comment is not a doc-comment as that causes warnings from g-ir-scanner.
+ */
/* Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
* The License.txt file describes the conditions under which this software may be distributed. */
@@ -19,8 +20,15 @@ extern "C" {
#define SCINTILLA_CLASS(klass) G_TYPE_CHECK_CLASS_CAST (klass, scintilla_get_type (), ScintillaClass)
#define IS_SCINTILLA(obj) G_TYPE_CHECK_INSTANCE_TYPE (obj, scintilla_get_type ())
+#define SCINTILLA_TYPE_OBJECT (scintilla_object_get_type())
+#define SCINTILLA_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SCINTILLA_TYPE_OBJECT, ScintillaObject))
+#define SCINTILLA_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SCINTILLA_TYPE_OBJECT))
+#define SCINTILLA_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), SCINTILLA_TYPE_OBJECT, ScintillaObjectClass))
+#define SCINTILLA_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), SCINTILLA_TYPE_OBJECT))
+#define SCINTILLA_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), SCINTILLA_TYPE_OBJECT, ScintillaObjectClass))
+
typedef struct _ScintillaObject ScintillaObject;
-typedef struct _ScintillaClass ScintillaClass;
+typedef struct _ScintillaClass ScintillaObjectClass;
struct _ScintillaObject {
GtkContainer cont;
@@ -34,11 +42,20 @@ struct _ScintillaClass {
void (* notify) (ScintillaObject *ttt);
};
+GType scintilla_object_get_type (void);
+GtkWidget* scintilla_object_new (void);
+long scintilla_object_send_message (ScintillaObject *sci, unsigned int iMessage, guintptr wParam, gintptr lParam);
+
+#ifndef G_IR_SCANNING
+/* The legacy names confuse the g-ir-scanner program */
+typedef struct _ScintillaClass ScintillaClass;
+
GType scintilla_get_type (void);
GtkWidget* scintilla_new (void);
void scintilla_set_id (ScintillaObject *sci, uptr_t id);
sptr_t scintilla_send_message (ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam);
void scintilla_release_resources(void);
+#endif
#define SCINTILLA_NOTIFY "sci-notify"
diff --git a/scintilla/lexers/LexA68k.cxx b/scintilla/lexers/LexA68k.cxx
index 59c0cd5..aa403e2 100644
--- a/scintilla/lexers/LexA68k.cxx
+++ b/scintilla/lexers/LexA68k.cxx
@@ -117,20 +117,20 @@ static inline bool IsDoxygenChar (const int ch)
static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int initStyle, WordList *keywordlists[], Accessor &styler)
{
- // Used to buffer a string, to be able to compare it using built-in functions
- char Buffer[100];
-
-
- // Used to know the length of an operator
- int OpType;
-
+ // Used to buffer a string, to be able to compare it using built-in functions
+ char Buffer[100];
+
+
+ // Used to know the length of an operator
+ int OpType;
+
// Get references to keywords lists
WordList &cpuInstruction = *keywordlists[0];
WordList &registers = *keywordlists[1];
WordList &directive = *keywordlists[2];
WordList &extInstruction = *keywordlists[3];
- WordList &alert = *keywordlists[4];
+ WordList &alert = *keywordlists[4];
WordList &doxygenKeyword = *keywordlists[5];
@@ -140,109 +140,109 @@ static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int i
/************************************************************
*
- * Parse the source
+ * Parse the source
*
************************************************************/
for ( ; sc.More(); sc.Forward())
{
- /************************************************************
- *
- * A style always terminates at the end of a line, even for
- * comments (no multi-lines comments)
- *
- ************************************************************/
- if (sc.atLineStart) {
+ /************************************************************
+ *
+ * A style always terminates at the end of a line, even for
+ * comments (no multi-lines comments)
+ *
+ ************************************************************/
+ if (sc.atLineStart) {
sc.SetState(SCE_A68K_DEFAULT);
- }
+ }
/************************************************************
*
- * If we are not in "default style", check if the style continues
- * In this case, we just have to loop
+ * If we are not in "default style", check if the style continues
+ * In this case, we just have to loop
*
************************************************************/
if (sc.state != SCE_A68K_DEFAULT)
{
- if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number
+ if ( ((sc.state == SCE_A68K_NUMBER_DEC) && isdigit(sc.ch)) // Decimal number
|| ((sc.state == SCE_A68K_NUMBER_BIN) && IsBin(sc.ch)) // Binary number
|| ((sc.state == SCE_A68K_NUMBER_HEX) && isxdigit(sc.ch)) // Hexa number
- || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument
+ || ((sc.state == SCE_A68K_MACRO_ARG) && isdigit(sc.ch)) // Macro argument
|| ((sc.state == SCE_A68K_STRING1) && (sc.ch != '\'')) // String single-quoted
|| ((sc.state == SCE_A68K_STRING2) && (sc.ch != '\"')) // String double-quoted
- || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point)
- || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier
- || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local)
- || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword
- || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert
- || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment
+ || ((sc.state == SCE_A68K_MACRO_DECLARATION) && IsIdentifierChar(sc.ch)) // Macro declaration (or global label, we don't know at this point)
+ || ((sc.state == SCE_A68K_IDENTIFIER) && IsIdentifierChar(sc.ch)) // Identifier
+ || ((sc.state == SCE_A68K_LABEL) && IsIdentifierChar(sc.ch)) // Label (local)
+ || ((sc.state == SCE_A68K_COMMENT_DOXYGEN) && IsDoxygenChar(sc.ch)) // Doxygen keyword
+ || ((sc.state == SCE_A68K_COMMENT_SPECIAL) && isalpha(sc.ch)) // Alert
+ || ((sc.state == SCE_A68K_COMMENT) && !isalpha(sc.ch) && (sc.ch != '\\'))) // Normal comment
{
continue;
}
- /************************************************************
- *
- * Check if current state terminates
- *
- ************************************************************/
+ /************************************************************
+ *
+ * Check if current state terminates
+ *
+ ************************************************************/
- // Strings: include terminal ' or " in the current string by skipping it
- if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) {
- sc.Forward();
+ // Strings: include terminal ' or " in the current string by skipping it
+ if ((sc.state == SCE_A68K_STRING1) || (sc.state == SCE_A68K_STRING2)) {
+ sc.Forward();
}
-
-
- // If a macro declaration was terminated with ':', it was a label
- else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) {
- sc.ChangeState(SCE_A68K_LABEL);
+
+
+ // If a macro declaration was terminated with ':', it was a label
+ else if ((sc.state == SCE_A68K_MACRO_DECLARATION) && (sc.chPrev == ':')) {
+ sc.ChangeState(SCE_A68K_LABEL);
}
-
- // If it wasn't a Doxygen keyword, change it to normal comment
- else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) {
+
+ // If it wasn't a Doxygen keyword, change it to normal comment
+ else if (sc.state == SCE_A68K_COMMENT_DOXYGEN) {
sc.GetCurrent(Buffer, sizeof(Buffer));
- if (!doxygenKeyword.InList(Buffer)) {
+ if (!doxygenKeyword.InList(Buffer)) {
sc.ChangeState(SCE_A68K_COMMENT);
}
sc.SetState(SCE_A68K_COMMENT);
continue;
}
-
- // If it wasn't an Alert, change it to normal comment
- else if (sc.state == SCE_A68K_COMMENT_SPECIAL) {
- sc.GetCurrent(Buffer, sizeof(Buffer));
- if (!alert.InList(Buffer)) {
+
+ // If it wasn't an Alert, change it to normal comment
+ else if (sc.state == SCE_A68K_COMMENT_SPECIAL) {
+ sc.GetCurrent(Buffer, sizeof(Buffer));
+ if (!alert.InList(Buffer)) {
sc.ChangeState(SCE_A68K_COMMENT);
}
- // Reset style to normal comment, or to Doxygen keyword if it begins with '\'
- if (sc.ch == '\\') {
- sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
- }
- else {
+ // Reset style to normal comment, or to Doxygen keyword if it begins with '\'
+ if (sc.ch == '\\') {
+ sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
+ }
+ else {
sc.SetState(SCE_A68K_COMMENT);
- }
+ }
continue;
}
-
- // If we are in a comment, it's a Doxygen keyword or an Alert
- else if (sc.state == SCE_A68K_COMMENT) {
- if (sc.ch == '\\') {
- sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
- }
- else {
- sc.SetState(SCE_A68K_COMMENT_SPECIAL);
- }
- continue;
+
+ // If we are in a comment, it's a Doxygen keyword or an Alert
+ else if (sc.state == SCE_A68K_COMMENT) {
+ if (sc.ch == '\\') {
+ sc.SetState(SCE_A68K_COMMENT_DOXYGEN);
+ }
+ else {
+ sc.SetState(SCE_A68K_COMMENT_SPECIAL);
+ }
+ continue;
}
-
+
// Check if we are at the end of an identifier
// In this case, colourise it if was a keyword.
- else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) {
+ else if ((sc.state == SCE_A68K_IDENTIFIER) && !IsIdentifierChar(sc.ch)) {
sc.GetCurrentLowered(Buffer, sizeof(Buffer)); // Buffer the string of the current context
if (cpuInstruction.InList(Buffer)) { // And check if it belongs to a keyword list
sc.ChangeState(SCE_A68K_CPUINSTRUCTION);
@@ -269,30 +269,30 @@ static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int i
*
************************************************************/
- // Something which begins at the beginning of a line, and with
- // - '\' + an identifier start char, or
- // - '\\@' + an identifier start char
- // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration
- if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) {
- sc.SetState(SCE_A68K_LABEL);
- }
-
- if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) {
- sc.Forward(2);
- if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) {
- sc.ChangeState(SCE_A68K_LABEL);
- sc.SetState(SCE_A68K_LABEL);
- }
- }
-
+ // Something which begins at the beginning of a line, and with
+ // - '\' + an identifier start char, or
+ // - '\\@' + an identifier start char
+ // is a local label (second case is used for macro local labels). We set it already as a label, it can't be a macro/equ declaration
+ if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.chNext) && (sc.ch == '\\')) {
+ sc.SetState(SCE_A68K_LABEL);
+ }
+
+ if (sc.atLineStart && (sc.ch < 0x80) && (sc.ch == '\\') && (sc.chNext == '\\')) {
+ sc.Forward(2);
+ if ((sc.ch == '@') && IsIdentifierStart(sc.chNext)) {
+ sc.ChangeState(SCE_A68K_LABEL);
+ sc.SetState(SCE_A68K_LABEL);
+ }
+ }
+
// Label and macro identifiers start at the beginning of a line
- // We set both as a macro id, but if it wasn't one (':' at the end),
- // it will be changed as a label.
+ // We set both as a macro id, but if it wasn't one (':' at the end),
+ // it will be changed as a label.
if (sc.atLineStart && (sc.ch < 0x80) && IsIdentifierStart(sc.ch)) {
- sc.SetState(SCE_A68K_MACRO_DECLARATION);
+ sc.SetState(SCE_A68K_MACRO_DECLARATION);
}
- else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match
- sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment
+ else if ((sc.ch < 0x80) && (sc.ch == ';')) { // Default: alert in a comment. If it doesn't match
+ sc.SetState(SCE_A68K_COMMENT); // with an alert, it will be toggle to a normal comment
}
else if ((sc.ch < 0x80) && isdigit(sc.ch)) { // Decimal numbers haven't prefix
sc.SetState(SCE_A68K_NUMBER_DEC);
@@ -309,7 +309,7 @@ static void ColouriseA68kDoc (Sci_PositionU startPos, Sci_Position length, int i
else if ((sc.ch < 0x80) && (sc.ch == '\"')) { // String (double-quoted)
sc.SetState(SCE_A68K_STRING2);
}
- else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\'
+ else if ((sc.ch < 0x80) && (sc.ch == '\\') && (isdigit(sc.chNext))) { // Replacement symbols in macro are prefixed with '\'
sc.SetState(SCE_A68K_MACRO_ARG);
}
else if ((sc.ch < 0x80) && IsIdentifierStart(sc.ch)) { // An identifier: constant, label, etc...
diff --git a/scintilla/lexers/LexAVS.cxx b/scintilla/lexers/LexAVS.cxx
index 551f1f4..20a6ef6 100644
--- a/scintilla/lexers/LexAVS.cxx
+++ b/scintilla/lexers/LexAVS.cxx
@@ -83,7 +83,7 @@ static void ColouriseAvsDoc(
styler.SetLineState(currentLine, 0);
}
}
-
+
// Determine if the current state should terminate.
if (sc.state == SCE_AVS_OPERATOR) {
sc.SetState(SCE_AVS_DEFAULT);
diff --git a/scintilla/lexers/LexBash.cxx b/scintilla/lexers/LexBash.cxx
index 14a4ec5..9582cc5 100644
--- a/scintilla/lexers/LexBash.cxx
+++ b/scintilla/lexers/LexBash.cxx
@@ -96,6 +96,19 @@ static int opposite(int ch) {
return ch;
}
+static int GlobScan(StyleContext &sc) {
+ // forward scan for a glob-like (...), no whitespace allowed
+ int c, sLen = 0;
+ while ((c = sc.GetRelativeCharacter(++sLen)) != 0) {
+ if (IsASpace(c)) {
+ return 0;
+ } else if (c == ')') {
+ return sLen;
+ }
+ }
+ return 0;
+}
+
static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
WordList *keywordlists[], Accessor &styler) {
@@ -113,9 +126,9 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
CharacterSet setBashOperator(CharacterSet::setNone, "^&%()-+=|{}[]:;>,*/<?!.~@");
CharacterSet setSingleCharOp(CharacterSet::setNone, "rwxoRWXOezsfdlpSbctugkTBMACahGLNn");
CharacterSet setParam(CharacterSet::setAlphaNum, "$_");
- CharacterSet setHereDoc(CharacterSet::setAlpha, "_\\-+!");
- CharacterSet setHereDoc2(CharacterSet::setAlphaNum, "_-+!");
- CharacterSet setLeftShift(CharacterSet::setDigits, "=$");
+ CharacterSet setHereDoc(CharacterSet::setAlpha, "_\\-+!%*,./:?@[]^`{}~");
+ CharacterSet setHereDoc2(CharacterSet::setAlphaNum, "_-+!%*,./:=?@[]^`{}~");
+ CharacterSet setLeftShift(CharacterSet::setDigits, "$");
class HereDocCls { // Class to manage HERE document elements
public:
@@ -126,14 +139,13 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
bool Quoted; // true if Quote in ('\'','"','`')
bool Indent; // indented delimiter (for <<-)
int DelimiterLength; // strlen(Delimiter)
- char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf
+ char Delimiter[HERE_DELIM_MAX]; // the Delimiter
HereDocCls() {
State = 0;
Quote = 0;
Quoted = false;
Indent = 0;
DelimiterLength = 0;
- Delimiter = new char[HERE_DELIM_MAX];
Delimiter[0] = '\0';
}
void Append(int ch) {
@@ -141,7 +153,6 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
Delimiter[DelimiterLength] = '\0';
}
~HereDocCls() {
- delete []Delimiter;
}
};
HereDocCls HereDoc;
@@ -173,18 +184,15 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
int Up, Down;
int Style;
int Depth; // levels pushed
- int *CountStack;
- int *UpStack;
- int *StyleStack;
+ int CountStack[BASH_DELIM_STACK_MAX];
+ int UpStack [BASH_DELIM_STACK_MAX];
+ int StyleStack[BASH_DELIM_STACK_MAX];
QuoteStackCls() {
Count = 0;
Up = '\0';
Down = '\0';
Style = 0;
Depth = 0;
- CountStack = new int[BASH_DELIM_STACK_MAX];
- UpStack = new int[BASH_DELIM_STACK_MAX];
- StyleStack = new int[BASH_DELIM_STACK_MAX];
}
void Start(int u, int s) {
Count = 1;
@@ -214,9 +222,6 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
Down = opposite(Up);
}
~QuoteStackCls() {
- delete []CountStack;
- delete []UpStack;
- delete []StyleStack;
}
};
QuoteStackCls QuoteStack;
@@ -345,6 +350,8 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
sc.ForwardSetState(SCE_SH_DEFAULT);
} else if (!setWord.Contains(sc.ch)) {
sc.SetState(SCE_SH_DEFAULT);
+ } else if (cmdState == BASH_CMD_ARITH && !setWordStart.Contains(sc.ch)) {
+ sc.SetState(SCE_SH_DEFAULT);
}
break;
case SCE_SH_NUMBER:
@@ -419,17 +426,18 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
sc.Forward();
HereDoc.Quoted = true;
HereDoc.State = 1;
- } else if (setHereDoc.Contains(sc.chNext)) {
+ } else if (setHereDoc.Contains(sc.chNext) ||
+ (sc.chNext == '=' && cmdState != BASH_CMD_ARITH)) {
// an unquoted here-doc delimiter, no special handling
- // TODO check what exactly bash considers part of the delim
HereDoc.State = 1;
} else if (sc.chNext == '<') { // HERE string <<<
sc.Forward();
sc.ForwardSetState(SCE_SH_DEFAULT);
} else if (IsASpace(sc.chNext)) {
// eat whitespace
- } else if (setLeftShift.Contains(sc.chNext)) {
- // left shift << or <<= operator cases
+ } else if (setLeftShift.Contains(sc.chNext) ||
+ (sc.chNext == '=' && cmdState == BASH_CMD_ARITH)) {
+ // left shift <<$var or <<= cases
sc.ChangeState(SCE_SH_OPERATOR);
sc.ForwardSetState(SCE_SH_DEFAULT);
} else {
@@ -584,12 +592,14 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
HereDoc.State = 2;
if (HereDoc.Quoted) {
if (sc.state == SCE_SH_HERE_DELIM) {
- // Missing quote at end of string! We are stricter than bash.
- // Colour here-doc anyway while marking this bit as an error.
+ // Missing quote at end of string! Syntax error in bash 4.3
+ // Mark this bit as an error, do not colour any here-doc
sc.ChangeState(SCE_SH_ERROR);
+ sc.SetState(SCE_SH_DEFAULT);
+ } else {
+ // HereDoc.Quote always == '\''
+ sc.SetState(SCE_SH_HERE_Q);
}
- // HereDoc.Quote always == '\''
- sc.SetState(SCE_SH_HERE_Q);
} else if (HereDoc.DelimiterLength == 0) {
// no delimiter, illegal (but '' and "" are legal)
sc.ChangeState(SCE_SH_ERROR);
@@ -634,6 +644,23 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
} else {
sc.SetState(SCE_SH_WORD);
}
+ // handle some zsh features within arithmetic expressions only
+ if (cmdState == BASH_CMD_ARITH) {
+ if (sc.chPrev == '[') { // [#8] [##8] output digit setting
+ sc.SetState(SCE_SH_WORD);
+ if (sc.chNext == '#') {
+ sc.Forward();
+ }
+ } else if (sc.Match("##^") && IsUpperCase(sc.GetRelative(3))) { // ##^A
+ sc.SetState(SCE_SH_IDENTIFIER);
+ sc.Forward(3);
+ } else if (sc.chNext == '#' && !IsASpace(sc.GetRelative(2))) { // ##a
+ sc.SetState(SCE_SH_IDENTIFIER);
+ sc.Forward(2);
+ } else if (setWordStart.Contains(sc.chNext)) { // #name
+ sc.SetState(SCE_SH_IDENTIFIER);
+ }
+ }
} else if (sc.ch == '\"') {
sc.SetState(SCE_SH_STRING);
QuoteStack.Start(sc.ch, BASH_DELIM_STRING);
@@ -687,6 +714,15 @@ static void ColouriseBashDoc(Sci_PositionU startPos, Sci_Position length, int in
char s[10];
bool isCmdDelim = false;
sc.SetState(SCE_SH_OPERATOR);
+ // globs have no whitespace, do not appear in arithmetic expressions
+ if (cmdState != BASH_CMD_ARITH && sc.ch == '(' && sc.chNext != '(') {
+ int i = GlobScan(sc);
+ if (i > 1) {
+ sc.SetState(SCE_SH_IDENTIFIER);
+ sc.Forward(i);
+ continue;
+ }
+ }
// handle opening delimiters for test/arithmetic expressions - ((,[[,[
if (cmdState == BASH_CMD_START
|| cmdState == BASH_CMD_BODY) {
diff --git a/scintilla/lexers/LexCPP.cxx b/scintilla/lexers/LexCPP.cxx
index 628672b..fc9b5b8 100644
--- a/scintilla/lexers/LexCPP.cxx
+++ b/scintilla/lexers/LexCPP.cxx
@@ -374,7 +374,7 @@ struct OptionSetCPP : public OptionSet<OptionsCPP> {
DefineProperty("lexer.cpp.verbatim.strings.allow.escapes", &OptionsCPP::verbatimStringsAllowEscapes,
"Set to 1 to allow verbatim strings to contain escape sequences.");
-
+
DefineProperty("lexer.cpp.triplequoted.strings", &OptionsCPP::triplequotedStrings,
"Set to 1 to enable highlighting of triple-quoted strings.");
@@ -1467,7 +1467,7 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl
}
iMacro++;
}
-
+
// Insert results back into tokens
tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
@@ -1481,7 +1481,7 @@ void LexerCPP::EvaluateTokens(std::vector<std::string> &tokens, const SymbolTabl
tokens.insert(tokens.begin() + i, macroTokens.begin(), macroTokens.end());
}
} else {
- // Identifier not found
+ // Identifier not found
tokens.erase(tokens.begin() + i);
}
} else {
diff --git a/scintilla/lexers/LexECL.cxx b/scintilla/lexers/LexECL.cxx
index 7c00cdc..4ab6c1b 100644
--- a/scintilla/lexers/LexECL.cxx
+++ b/scintilla/lexers/LexECL.cxx
@@ -175,7 +175,7 @@ static void ColouriseEclDoc(Sci_PositionU startPos, Sci_Position length, int ini
} else if (keywords5.InList(s)) {
sc.ChangeState(SCE_ECL_WORD5);
}
- else //Data types are of from KEYWORD##
+ else //Data types are of from KEYWORD##
{
int i = static_cast<int>(strlen(s)) - 1;
while(i >= 0 && (isdigit(s[i]) || s[i] == '_'))
@@ -186,7 +186,7 @@ static void ColouriseEclDoc(Sci_PositionU startPos, Sci_Position length, int ini
s2[i + 1] = 0;
if (keywords3.InList(s2)) {
sc.ChangeState(SCE_ECL_WORD3);
- }
+ }
}
sc.SetState(SCE_ECL_DEFAULT);
}
@@ -393,7 +393,7 @@ static bool MatchNoCase(Accessor & styler, Sci_PositionU & pos, const char *s) {
for (; *s; i++) {
char compare_char = tolower(*s);
char styler_char = tolower(styler.SafeGetCharAt(pos+i));
- if (compare_char != styler_char)
+ if (compare_char != styler_char)
return false;
s++;
}
@@ -405,7 +405,7 @@ static bool MatchNoCase(Accessor & styler, Sci_PositionU & pos, const char *s) {
// Store both the current line's fold level and the next lines in the
// level store to make it easy to pick up with each increment
// and to make it possible to fiddle the current level for "} else {".
-static void FoldEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
+static void FoldEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyle,
WordList *[], Accessor &styler) {
bool foldComment = true;
bool foldPreprocessor = true;
@@ -473,7 +473,7 @@ static void FoldEclDoc(Sci_PositionU startPos, Sci_Position length, int initStyl
}
}
if (style == SCE_ECL_WORD2) {
- if (MatchNoCase(styler, i, "record") || MatchNoCase(styler, i, "transform") || MatchNoCase(styler, i, "type") || MatchNoCase(styler, i, "function") ||
+ if (MatchNoCase(styler, i, "record") || MatchNoCase(styler, i, "transform") || MatchNoCase(styler, i, "type") || MatchNoCase(styler, i, "function") ||
MatchNoCase(styler, i, "module") || MatchNoCase(styler, i, "service") || MatchNoCase(styler, i, "interface") || MatchNoCase(styler, i, "ifblock") ||
MatchNoCase(styler, i, "macro") || MatchNoCase(styler, i, "beginc++")) {
levelNext++;
diff --git a/scintilla/lexers/LexErrorList.cxx b/scintilla/lexers/LexErrorList.cxx
index f3d68f2..d6fe5ee 100644
--- a/scintilla/lexers/LexErrorList.cxx
+++ b/scintilla/lexers/LexErrorList.cxx
@@ -127,6 +127,10 @@ static int RecogniseErrorListLine(const char *lineBuffer, Sci_PositionU lengthLi
strstart(lineBuffer, " from ")) {
// GCC showing include path to following error
return SCE_ERR_GCC_INCLUDED_FROM;
+ } else if (strstr(lineBuffer, "warning LNK")) {
+ // Microsoft linker warning:
+ // {<object> : } warning LNK9999
+ return SCE_ERR_MS;
} else {
// Look for one of the following formats:
// GCC: <filename>:<line>:<message>
@@ -374,6 +378,7 @@ static void ColouriseErrorListDoc(Sci_PositionU startPos, Sci_Position length, i
}
}
if (linePos > 0) { // Last line does not have ending characters
+ lineBuffer[linePos] = '\0';
ColouriseErrorListLine(lineBuffer, linePos, startPos + length - 1, styler, valueSeparate, escapeSequences);
}
}
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index dcca93f..f4fe707 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/lexers/LexHTML.cxx
@@ -828,7 +828,7 @@ static void ColouriseHyperTextDoc(Sci_PositionU startPos, Sci_Position length, i
// handle end of Mako comment line
else if (isMako && makoComment && (ch == '\r' || ch == '\n')) {
makoComment = 0;
- styler.ColourTo(i, StateToPrint);
+ styler.ColourTo(i - 1, StateToPrint);
if (scriptLanguage == eScriptPython) {
state = SCE_HP_DEFAULT;
} else {
diff --git a/scintilla/lexers/LexKVIrc.cxx b/scintilla/lexers/LexKVIrc.cxx
index 76259db..75cb833 100644
--- a/scintilla/lexers/LexKVIrc.cxx
+++ b/scintilla/lexers/LexKVIrc.cxx
@@ -359,7 +359,7 @@ static void FoldKVIrcDoc(Sci_PositionU startPos, Sci_Position length, int /*init
WordList *[], Accessor &styler)
{
/* Based on CMake's folder */
-
+
/* Exiting if folding isnt enabled */
if ( styler.GetPropertyInt("fold") == 0 )
return;
diff --git a/scintilla/lexers/LexLaTeX.cxx b/scintilla/lexers/LexLaTeX.cxx
index 7e03a9c..6dc0617 100644
--- a/scintilla/lexers/LexLaTeX.cxx
+++ b/scintilla/lexers/LexLaTeX.cxx
@@ -60,7 +60,7 @@ private:
if (static_cast<Sci_Position>(modes.size()) > numLines * 2 + 256)
modes.resize(numLines + 128);
}
-
+
vector<latexFoldSave> saves;
void setSave(Sci_Position line, const latexFoldSave &save) {
if (line >= static_cast<Sci_Position>(saves.size())) saves.resize(line + 1);
@@ -192,7 +192,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int
int state = initStyle;
if (state == SCE_L_ERROR || state == SCE_L_SHORTCMD || state == SCE_L_SPECIAL) // should not happen
latexStateReset(mode, state);
-
+
char chNext = styler.SafeGetCharAt(startPos);
char chVerbatimDelim = '\0';
styler.StartSegment(startPos);
@@ -207,7 +207,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int
chNext = styler.SafeGetCharAt(i + 1);
continue;
}
-
+
if (ch == '\r' || ch == '\n')
setMode(styler.GetLine(i), mode);
@@ -256,7 +256,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int
state = SCE_L_COMMENT;
break;
}
- break;
+ break;
// These 3 will never be reached.
case SCE_L_ERROR:
case SCE_L_SPECIAL:
@@ -400,7 +400,7 @@ void SCI_METHOD LexerLaTeX::Lex(Sci_PositionU startPos, Sci_Position length, int
chNext = styler.SafeGetCharAt(i + 1);
mode = 0;
state = SCE_L_DEFAULT;
- } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation}
+ } else { // This may not be an error, e.g. \begin{equation}\text{$a$}\end{equation}
styler.ColourTo(i, SCE_L_SHORTCMD);
}
break;
diff --git a/scintilla/lexers/LexLua.cxx b/scintilla/lexers/LexLua.cxx
index 09bab27..0647d2c 100644
--- a/scintilla/lexers/LexLua.cxx
+++ b/scintilla/lexers/LexLua.cxx
@@ -64,7 +64,7 @@ static void ColouriseLuaDoc(
// but probably enough in most cases. [pP] is for hex floats.
CharacterSet setNumber(CharacterSet::setDigits, ".-+abcdefpABCDEFP");
CharacterSet setExponent(CharacterSet::setNone, "eEpP");
- CharacterSet setLuaOperator(CharacterSet::setNone, "*/-+()={}~[];<>,.^%:#");
+ CharacterSet setLuaOperator(CharacterSet::setNone, "*/-+()={}~[];<>,.^%:#&|");
CharacterSet setEscapeSkip(CharacterSet::setNone, "\"'\\");
Sci_Position currentLine = styler.GetLine(startPos);
diff --git a/scintilla/lexers/LexMatlab.cxx b/scintilla/lexers/LexMatlab.cxx
index 7780370..f20f732 100644
--- a/scintilla/lexers/LexMatlab.cxx
+++ b/scintilla/lexers/LexMatlab.cxx
@@ -67,7 +67,7 @@ static void ColouriseMatlabOctaveDoc(
styler.StartAt(startPos);
- // boolean for when the ' is allowed to be transpose vs the start/end
+ // boolean for when the ' is allowed to be transpose vs the start/end
// of a string
bool transpose = false;
@@ -86,13 +86,13 @@ static void ColouriseMatlabOctaveDoc(
for (; sc.More(); sc.Forward(), column++) {
if(sc.atLineStart) {
- // set the line state to the current commentDepth
+ // set the line state to the current commentDepth
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
// reset the column to 0, nonSpace to -1 (not set)
column = 0;
- nonSpaceColumn = -1;
+ nonSpaceColumn = -1;
}
// save the column position of first non space character in a line
@@ -111,7 +111,7 @@ static void ColouriseMatlabOctaveDoc(
sc.ForwardSetState(SCE_MATLAB_DEFAULT);
transpose = true;
} else if(sc.ch == '.' && sc.chNext == '.') {
- // we werent an operator, but a '...'
+ // we werent an operator, but a '...'
sc.ChangeState(SCE_MATLAB_COMMENT);
transpose = false;
} else {
@@ -165,7 +165,7 @@ static void ColouriseMatlabOctaveDoc(
// end or start of a nested a block comment?
if( IsCommentChar(sc.ch) && sc.chNext == '}' && nonSpaceColumn == column) {
if(commentDepth > 0) commentDepth --;
-
+
curLine = styler.GetLine(sc.currentPos);
styler.SetLineState(curLine, commentDepth);
sc.Forward();
diff --git a/scintilla/lexers/LexMySQL.cxx b/scintilla/lexers/LexMySQL.cxx
index 4cd89e5..15afcdc 100644
--- a/scintilla/lexers/LexMySQL.cxx
+++ b/scintilla/lexers/LexMySQL.cxx
@@ -362,7 +362,7 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt
int styleNext = styler.StyleAt(startPos);
int style = initStyle;
int activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE;
-
+
bool endPending = false;
bool whenPending = false;
bool elseIfPending = false;
@@ -375,11 +375,11 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt
style = styleNext;
styleNext = styler.StyleAt(i + 1);
activeState = (style == SCE_MYSQL_HIDDENCOMMAND) ? HIDDENCOMMAND_STATE : style & HIDDENCOMMAND_STATE;
-
+
char currentChar = nextChar;
nextChar = styler.SafeGetCharAt(i + 1);
bool atEOL = (currentChar == '\r' && nextChar != '\n') || (currentChar == '\n');
-
+
switch (MASKACTIVE(style))
{
case SCE_MYSQL_COMMENT:
@@ -392,7 +392,7 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt
break;
case SCE_MYSQL_COMMENTLINE:
if (foldComment)
- {
+ {
// Not really a standard, but we add support for single line comments
// with special curly braces syntax as foldable comments too.
// MySQL needs -- comments to be followed by space or control char
@@ -500,12 +500,12 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt
}
}
}
-
+
// Keep the current end state for the next round.
endPending = endFound;
}
break;
-
+
default:
if (!isspacechar(currentChar) && endPending)
{
@@ -547,7 +547,7 @@ static void FoldMySQLDoc(Sci_PositionU startPos, Sci_Position length, int initSt
lev |= SC_FOLDLEVELHEADERFLAG;
if (lev != styler.LevelAt(lineCurrent))
styler.SetLevel(lineCurrent, lev);
-
+
lineCurrent++;
levelCurrent = levelNext;
visibleChars = 0;
diff --git a/scintilla/lexers/LexOScript.cxx b/scintilla/lexers/LexOScript.cxx
index 55e57bd..899881d 100644
--- a/scintilla/lexers/LexOScript.cxx
+++ b/scintilla/lexers/LexOScript.cxx
@@ -205,12 +205,12 @@ static void ColouriseOScriptDoc(Sci_PositionU startPos, Sci_Position length,
bool isFirstToken = true;
// It starts with true at the beginning of a line and changes to false as
// soon as the first identifier on the line is passed by.
- bool isFirstIdentifier = true;
+ bool isFirstIdentifier = true;
// It becomes false when #ifdef DOC (the preprocessor directive often
// used to start a documentation comment) is encountered and remain false
// until the end of the documentation block is not detected. This is done
// by checking for the complementary #endif preprocessor directive.
- bool endDocComment = false;
+ bool endDocComment = false;
for (; sc.More(); sc.Forward()) {
diff --git a/scintilla/lexers/LexPO.cxx b/scintilla/lexers/LexPO.cxx
index 61e6011..fcf886d 100644
--- a/scintilla/lexers/LexPO.cxx
+++ b/scintilla/lexers/LexPO.cxx
@@ -41,7 +41,7 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init
Sci_Position curLine = styler.GetLine(startPos);
// the line state holds the last state on or before the line that isn't the default style
int curLineState = curLine > 0 ? styler.GetLineState(curLine - 1) : SCE_PO_DEFAULT;
-
+
for (; sc.More(); sc.Forward()) {
// whether we should leave a state
switch (sc.state) {
@@ -57,19 +57,19 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init
// on its own like a keyword rather than changing the whole flags style
sc.ChangeState(SCE_PO_FUZZY);
break;
-
+
case SCE_PO_MSGCTXT:
case SCE_PO_MSGID:
case SCE_PO_MSGSTR:
if (isspacechar(sc.ch))
sc.SetState(SCE_PO_DEFAULT);
break;
-
+
case SCE_PO_ERROR:
if (sc.atLineEnd)
sc.SetState(SCE_PO_DEFAULT);
break;
-
+
case SCE_PO_MSGCTXT_TEXT:
case SCE_PO_MSGID_TEXT:
case SCE_PO_MSGSTR_TEXT:
@@ -92,7 +92,7 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init
}
break;
}
-
+
// whether we should enter a new state
if (sc.state == SCE_PO_DEFAULT) {
// forward to the first non-white character on the line
@@ -103,11 +103,11 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init
// and anyway the styling don't use line state for comments
if (curLineState == SCE_PO_COMMENT)
curLineState = SCE_PO_DEFAULT;
-
+
while (sc.More() && ! sc.atLineEnd && isspacechar(sc.ch))
sc.Forward();
}
-
+
if (atLineStart && sc.ch == '#') {
if (sc.chNext == '.')
sc.SetState(SCE_PO_PROGRAMMER_COMMENT);
@@ -134,11 +134,11 @@ static void ColourisePODoc(Sci_PositionU startPos, Sci_Position length, int init
sc.SetState(SCE_PO_ERROR);
} else if (! isspacechar(sc.ch))
sc.SetState(SCE_PO_ERROR);
-
+
if (sc.state != SCE_PO_DEFAULT)
curLineState = sc.state;
}
-
+
if (sc.atLineEnd) {
// Update the line state, so it can be seen by next line
curLine = styler.GetLine(sc.currentPos);
@@ -163,7 +163,7 @@ static void FoldPODoc(Sci_PositionU startPos, Sci_Position length, int, WordList
return;
bool foldCompact = styler.GetPropertyInt("fold.compact") != 0;
bool foldComment = styler.GetPropertyInt("fold.comment") != 0;
-
+
Sci_PositionU endPos = startPos + length;
Sci_Position curLine = styler.GetLine(startPos);
int lineState = styler.GetLineState(curLine);
@@ -172,17 +172,17 @@ static void FoldPODoc(Sci_PositionU startPos, Sci_Position length, int, WordList
int nextLevel;
int visible = 0;
int chNext = styler[startPos];
-
+
for (Sci_PositionU i = startPos; i < endPos; i++) {
int ch = chNext;
chNext = styler.SafeGetCharAt(i+1);
-
+
if (! isspacechar(ch)) {
visible++;
} else if ((ch == '\r' && chNext != '\n') || ch == '\n' || i+1 >= endPos) {
int lvl = level;
Sci_Position nextLine = curLine + 1;
-
+
nextLineState = styler.GetLineState(nextLine);
if ((lineState != SCE_PO_COMMENT || foldComment) &&
nextLineState == lineState &&
@@ -190,14 +190,14 @@ static void FoldPODoc(Sci_PositionU startPos, Sci_Position length, int, WordList
nextLevel = SC_FOLDLEVELBASE + 1;
else
nextLevel = SC_FOLDLEVELBASE;
-
+
if (nextLevel > level)
lvl |= SC_FOLDLEVELHEADERFLAG;
if (visible == 0 && foldCompact)
lvl |= SC_FOLDLEVELWHITEFLAG;
-
+
styler.SetLevel(curLine, lvl);
-
+
lineState = nextLineState;
curLine = nextLine;
level = nextLevel;
diff --git a/scintilla/lexers/LexPerl.cxx b/scintilla/lexers/LexPerl.cxx
index 84088d3..4e020cc 100644
--- a/scintilla/lexers/LexPerl.cxx
+++ b/scintilla/lexers/LexPerl.cxx
@@ -52,10 +52,10 @@ using namespace Scintilla;
#define HERE_DELIM_MAX 256 // maximum length of HERE doc delimiter
-#define PERLNUM_BINARY 1 // order is significant: 1-4 cannot have a dot
-#define PERLNUM_HEX 2
-#define PERLNUM_OCTAL 3
-#define PERLNUM_FLOAT_EXP 4 // exponent part only
+#define PERLNUM_BINARY 1 // order is significant: 1-3 cannot have a dot
+#define PERLNUM_OCTAL 2
+#define PERLNUM_FLOAT_EXP 3 // exponent part only
+#define PERLNUM_HEX 4 // may be a hex float
#define PERLNUM_DECIMAL 5 // 1-5 are numbers; 6-7 are strings
#define PERLNUM_VECTOR 6
#define PERLNUM_V_VECTOR 7
@@ -65,6 +65,12 @@ using namespace Scintilla;
#define BACK_OPERATOR 1 // whitespace/comments are insignificant
#define BACK_KEYWORD 2 // operators/keywords are needed for disambiguation
+#define SUB_BEGIN 0 // states for subroutine prototype scan:
+#define SUB_HAS_PROTO 1 // only 'prototype' attribute allows prototypes
+#define SUB_HAS_ATTRIB 2 // other attributes can exist leftward
+#define SUB_HAS_MODULE 3 // sub name can have a ::identifier part
+#define SUB_HAS_SUB 4 // 'sub' keyword
+
// all interpolated styles are different from their parent styles by a constant difference
// we also assume SCE_PL_STRING_VAR is the interpolated style with the smallest value
#define INTERPOLATE_SHIFT (SCE_PL_STRING_VAR - SCE_PL_STRING)
@@ -105,9 +111,11 @@ static int disambiguateBareword(LexAccessor &styler, Sci_PositionU bk, Sci_Posit
// &bareword: subroutine call
|| styler.Match(bk - 1, "->")
// ->bareword: part of variable spec
+ || styler.Match(bk - 1, "::")
+ // ::bareword: part of module spec
|| styler.Match(bk - 2, "sub")) {
- // sub bareword: subroutine declaration
- // (implied BACK_KEYWORD, no keywords end in 'sub'!)
+ // sub bareword: subroutine declaration
+ // (implied BACK_KEYWORD, no keywords end in 'sub'!)
result |= 1;
}
// next, scan forward after word past tab/spaces only;
@@ -121,7 +129,7 @@ static int disambiguateBareword(LexAccessor &styler, Sci_PositionU bk, Sci_Posit
if ((ch == '}' && brace)
// {bareword}: variable spec
|| styler.Match(fw, "=>")) {
- // [{(, bareword=>: hash literal
+ // [{(, bareword=>: hash literal
result |= 2;
}
}
@@ -136,6 +144,22 @@ static void skipWhitespaceComment(LexAccessor &styler, Sci_PositionU &p) {
p--;
}
+static int findPrevLexeme(LexAccessor &styler, Sci_PositionU &bk, int &style) {
+ // scan backward past whitespace and comments to find a lexeme
+ skipWhitespaceComment(styler, bk);
+ if (bk == 0)
+ return 0;
+ int sz = 1;
+ style = styler.StyleAt(bk);
+ while (bk > 0) { // find extent of lexeme
+ if (styler.StyleAt(bk - 1) == style) {
+ bk--; sz++;
+ } else
+ break;
+ }
+ return sz;
+}
+
static int styleBeforeBracePair(LexAccessor &styler, Sci_PositionU bk) {
// backtrack to find open '{' corresponding to a '}', balanced
// return significant style to be tested for '/' disambiguation
@@ -214,20 +238,59 @@ static int podLineScan(LexAccessor &styler, Sci_PositionU &pos, Sci_PositionU en
static bool styleCheckSubPrototype(LexAccessor &styler, Sci_PositionU bk) {
// backtrack to identify if we're starting a subroutine prototype
- // we also need to ignore whitespace/comments:
- // 'sub' [whitespace|comment] <identifier> [whitespace|comment]
+ // we also need to ignore whitespace/comments, format is like:
+ // sub abc::pqr :const :prototype(...)
+ // lexemes are tested in pairs, e.g. '::'+'pqr', ':'+'const', etc.
+ // and a state machine generates legal subroutine syntax matches
styler.Flush();
- skipWhitespaceComment(styler, bk);
- if (bk == 0 || styler.StyleAt(bk) != SCE_PL_IDENTIFIER) // check identifier
- return false;
- while (bk > 0 && (styler.StyleAt(bk) == SCE_PL_IDENTIFIER)) {
- bk--;
- }
- skipWhitespaceComment(styler, bk);
- if (bk < 2 || styler.StyleAt(bk) != SCE_PL_WORD // check "sub" keyword
- || !styler.Match(bk - 2, "sub")) // assume suffix is unique!
- return false;
- return true;
+ int state = SUB_BEGIN;
+ do {
+ // find two lexemes, lexeme 2 follows lexeme 1
+ int style2 = SCE_PL_DEFAULT;
+ Sci_PositionU pos2 = bk;
+ int len2 = findPrevLexeme(styler, pos2, style2);
+ int style1 = SCE_PL_DEFAULT;
+ Sci_PositionU pos1 = pos2;
+ if (pos1 > 0) pos1--;
+ int len1 = findPrevLexeme(styler, pos1, style1);
+ if (len1 == 0 || len2 == 0) // lexeme pair must exist
+ break;
+
+ // match parts of syntax, if invalid subroutine syntax, break off
+ if (style1 == SCE_PL_OPERATOR && len1 == 1 &&
+ styler.SafeGetCharAt(pos1) == ':') { // ':'
+ if (style2 == SCE_PL_IDENTIFIER || style2 == SCE_PL_WORD) {
+ if (len2 == 9 && styler.Match(pos2, "prototype")) { // ':' 'prototype'
+ if (state == SUB_BEGIN) {
+ state = SUB_HAS_PROTO;
+ } else
+ break;
+ } else { // ':' <attribute>
+ if (state == SUB_HAS_PROTO || state == SUB_HAS_ATTRIB) {
+ state = SUB_HAS_ATTRIB;
+ } else
+ break;
+ }
+ } else
+ break;
+ } else if (style1 == SCE_PL_OPERATOR && len1 == 2 &&
+ styler.Match(pos1, "::")) { // '::'
+ if (style2 == SCE_PL_IDENTIFIER) { // '::' <identifier>
+ state = SUB_HAS_MODULE;
+ } else
+ break;
+ } else if (style1 == SCE_PL_WORD && len1 == 3 &&
+ styler.Match(pos1, "sub")) { // 'sub'
+ if (style2 == SCE_PL_IDENTIFIER) { // 'sub' <identifier>
+ state = SUB_HAS_SUB;
+ } else
+ break;
+ } else
+ break;
+ bk = pos1; // set position for finding next lexeme pair
+ if (bk > 0) bk--;
+ } while (state != SUB_HAS_SUB);
+ return (state == SUB_HAS_SUB);
}
static int actualNumStyle(int numberStyle) {
@@ -537,7 +600,8 @@ void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int
CharacterSet &setPOD = setModifiers;
CharacterSet setNonHereDoc(CharacterSet::setDigits, "=$@");
CharacterSet setHereDocDelim(CharacterSet::setAlphaNum, "_");
- CharacterSet setSubPrototype(CharacterSet::setNone, "\\[$@%&*+];");
+ CharacterSet setSubPrototype(CharacterSet::setNone, "\\[$@%&*+];_ \t");
+ CharacterSet setRepetition(CharacterSet::setDigits, ")\"'");
// for format identifiers
CharacterSet setFormatStart(CharacterSet::setAlpha, "_=");
CharacterSet &setFormat = setHereDocDelim;
@@ -555,13 +619,12 @@ void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int
int Quote; // the char after '<<'
bool Quoted; // true if Quote in ('\'','"','`')
int DelimiterLength; // strlen(Delimiter)
- char *Delimiter; // the Delimiter, 256: sizeof PL_tokenbuf
+ char Delimiter[HERE_DELIM_MAX]; // the Delimiter
HereDocCls() {
State = 0;
Quote = 0;
Quoted = false;
DelimiterLength = 0;
- Delimiter = new char[HERE_DELIM_MAX];
Delimiter[0] = '\0';
}
void Append(int ch) {
@@ -569,7 +632,6 @@ void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int
Delimiter[DelimiterLength] = '\0';
}
~HereDocCls() {
- delete []Delimiter;
}
};
HereDocCls HereDoc; // TODO: FIFO for stacked here-docs
@@ -762,6 +824,14 @@ void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int
break;
}
// number then dot (go through)
+ } else if (numState == PERLNUM_HEX) {
+ if (dotCount <= 1 && IsADigit(sc.chNext, 16)) {
+ break; // hex with one dot is a hex float
+ } else {
+ sc.SetState(SCE_PL_OPERATOR);
+ break;
+ }
+ // hex then dot (go through)
} else if (IsADigit(sc.chNext)) // vectors
break;
// vector then dot (go through)
@@ -780,8 +850,15 @@ void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int
break;
// number then word (go through)
} else if (numState == PERLNUM_HEX) {
- if (IsADigit(sc.ch, 16))
+ if (sc.ch == 'P' || sc.ch == 'p') { // hex float exponent, sign
+ numState = PERLNUM_FLOAT_EXP;
+ if (sc.chNext == '+' || sc.chNext == '-') {
+ sc.Forward();
+ }
+ break;
+ } else if (IsADigit(sc.ch, 16))
break;
+ // hex or hex float then word (go through)
} else if (numState == PERLNUM_VECTOR || numState == PERLNUM_V_VECTOR) {
if (IsADigit(sc.ch)) // vector
break;
@@ -1265,7 +1342,7 @@ void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int
fw++;
} else if (sc.ch == 'x' && (sc.chNext == '=' || // repetition
!setWord.Contains(sc.chNext) ||
- (IsADigit(sc.chPrev) && IsADigit(sc.chNext)))) {
+ (setRepetition.Contains(sc.chPrev) && IsADigit(sc.chNext)))) {
sc.ChangeState(SCE_PL_OPERATOR);
}
// if potentially a keyword, scan forward and grab word, then check
@@ -1438,7 +1515,10 @@ void SCI_METHOD LexerPerl::Lex(Sci_PositionU startPos, Sci_Position length, int
}
backFlag = BACK_NONE;
if (isHereDoc) { // handle '<<', HERE doc
- if (preferRE) {
+ if (sc.Match("<<>>")) { // double-diamond operator (5.22)
+ sc.SetState(SCE_PL_OPERATOR);
+ sc.Forward(3);
+ } else if (preferRE) {
sc.SetState(SCE_PL_HERE_DELIM);
HereDoc.State = 0;
} else { // << operator
diff --git a/scintilla/lexers/LexRust.cxx b/scintilla/lexers/LexRust.cxx
index f98296b..ca5f3c7 100644
--- a/scintilla/lexers/LexRust.cxx
+++ b/scintilla/lexers/LexRust.cxx
@@ -287,7 +287,7 @@ static void ScanNumber(Accessor& styler, Sci_Position& pos) {
} else if (!error) {
/* If there's a period, it's a floating point literal unless it's
* followed by an identifier (meaning this is a method call, e.g.
- * `1.foo()`) or another period, in which case it's a range (e.g. 1..2)
+ * `1.foo()`) or another period, in which case it's a range (e.g. 1..2)
*/
n = styler.SafeGetCharAt(pos + 1, '\0');
if (c == '.' && !(IsIdentifierStart(n) || n == '.')) {
@@ -308,7 +308,7 @@ static void ScanNumber(Accessor& styler, Sci_Position& pos) {
/* It is invalid to have no digits in the exponent. */
error |= !ScanDigits(styler, pos, 10);
}
-
+
/* Scan the floating point suffix. */
c = styler.SafeGetCharAt(pos, '\0');
if (c == 'f') {
@@ -620,7 +620,7 @@ static void ResumeRawString(Accessor &styler, Sci_Position& pos, Sci_Position ma
} else if (pos >= max) {
break;
} else {
- if (ascii_only && !IsASCII((char)c))
+ if (ascii_only && !IsASCII((char)c))
break;
pos++;
}
diff --git a/scintilla/lexers/LexSQL.cxx b/scintilla/lexers/LexSQL.cxx
index 442c3d4..1320bae 100644
--- a/scintilla/lexers/LexSQL.cxx
+++ b/scintilla/lexers/LexSQL.cxx
@@ -567,8 +567,8 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i
break;
}
}
-
- char qComplement = 0x00;
+
+ char qComplement = 0x00;
if (qOperator == '<') {
qComplement = '>';
@@ -580,8 +580,8 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i
qComplement = ']';
} else {
qComplement = qOperator;
- }
-
+ }
+
if (sc.Match(qComplement, '\'')) {
sc.Forward();
sc.ForwardSetState(SCE_SQL_DEFAULT);
@@ -592,7 +592,7 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i
// Determine if a new state should be entered.
if (sc.state == SCE_SQL_DEFAULT) {
if (sc.Match('q', '\'') || sc.Match('Q', '\'')) {
- sc.SetState(SCE_SQL_QOPERATOR);
+ sc.SetState(SCE_SQL_QOPERATOR);
sc.Forward();
} else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext)) ||
((sc.ch == '-' || sc.ch == '+') && IsADigit(sc.chNext) && !IsADigit(sc.chPrev))) {
diff --git a/scintilla/lexers/LexTCMD.cxx b/scintilla/lexers/LexTCMD.cxx
index c4a14fd..59b2d7c 100644
--- a/scintilla/lexers/LexTCMD.cxx
+++ b/scintilla/lexers/LexTCMD.cxx
@@ -52,7 +52,7 @@ static unsigned int GetBatchVarLen( char *wordBuffer )
{
int nLength = 0;
if ( wordBuffer[0] == '%' ) {
-
+
if ( wordBuffer[1] == '~' )
nLength = 2;
else if (( wordBuffer[1] == '%' ) && ( wordBuffer[2] == '~' ))
@@ -244,7 +244,7 @@ static void ColouriseTCMDLine( char *lineBuffer, Sci_PositionU lengthLine, Sci_P
if ((CompareCaseInsensitive(sKeywordBuffer, "echo") == 0) ||
(CompareCaseInsensitive(sKeywordBuffer, "echos") == 0) ||
(CompareCaseInsensitive(sKeywordBuffer, "echoerr") == 0) ||
- (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) ||
+ (CompareCaseInsensitive(sKeywordBuffer, "echoserr") == 0) ||
(CompareCaseInsensitive(sKeywordBuffer, "cd") == 0) ||
(CompareCaseInsensitive(sKeywordBuffer, "path") == 0) ||
(CompareCaseInsensitive(sKeywordBuffer, "prompt") == 0)) {
diff --git a/scintilla/lexers/LexVisualProlog.cxx b/scintilla/lexers/LexVisualProlog.cxx
index b28d1c5..e836182 100644
--- a/scintilla/lexers/LexVisualProlog.cxx
+++ b/scintilla/lexers/LexVisualProlog.cxx
@@ -162,6 +162,11 @@ static bool isAlphaNum(int ch){
return (ccLu == cc || ccLl == cc || ccLt == cc || ccLm == cc || ccLo == cc || ccNd == cc || ccNl == cc || ccNo == cc);
}
+static bool isStringVerbatimOpenClose(int ch){
+ CharacterCategory cc = CategoriseCharacter(ch);
+ return (ccPc <= cc && cc <= ccSo);
+}
+
static bool isIdChar(int ch){
return ('_') == ch || isAlphaNum(ch);
}
@@ -198,11 +203,11 @@ static bool isOpenStringVerbatim(int next, int &closingQuote){
case L';':
return false;
default:
- if (isAlphaNum(next)) {
- return false;
- } else {
+ if (isStringVerbatimOpenClose(next)) {
closingQuote = next;
return true;
+ } else {
+ return false;
}
}
}
@@ -247,7 +252,7 @@ static void forwardEscapeLiteral(StyleContext &sc, int EscapeState) {
void SCI_METHOD LexerVisualProlog::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) {
LexAccessor styler(pAccess);
CharacterSet setDoxygen(CharacterSet::setAlpha, "");
- CharacterSet setNumber(CharacterSet::setNone, "+-.0123456789abcdefABCDEFxoXO");
+ CharacterSet setNumber(CharacterSet::setNone, "0123456789abcdefABCDEFxoXO");
StyleContext sc(startPos, length, initStyle, styler, 0x7f);
@@ -273,7 +278,7 @@ void SCI_METHOD LexerVisualProlog::Lex(Sci_PositionU startPos, Sci_Position leng
break;
case SCE_VISUALPROLOG_NUMBER:
// We accept almost anything because of hex. and number suffixes
- if (!(setNumber.Contains(sc.ch))) {
+ if (!(setNumber.Contains(sc.ch)) || (sc.Match('.') && IsADigit(sc.chNext))) {
sc.SetState(SCE_VISUALPROLOG_DEFAULT);
}
break;
@@ -396,7 +401,7 @@ void SCI_METHOD LexerVisualProlog::Lex(Sci_PositionU startPos, Sci_Position leng
if (sc.atLineEnd) {
// Update the line state, so it can be seen by next line
int lineState = 0;
- if (SCE_VISUALPROLOG_STRING_VERBATIM_EOL == sc.state) {
+ if (SCE_VISUALPROLOG_STRING_VERBATIM_EOL == sc.state) {
lineState = closingQuote;
} else if (SCE_VISUALPROLOG_COMMENT_BLOCK == sc.state) {
lineState = nestLevel;
diff --git a/scintilla/scripts/Face.py b/scintilla/scripts/Face.py
index 17d161f..05864f1 100644
--- a/scintilla/scripts/Face.py
+++ b/scintilla/scripts/Face.py
@@ -9,7 +9,7 @@ def sanitiseLine(line):
line = line[:line.find("##")]
line = line.strip()
return line
-
+
def decodeFunction(featureVal):
retType, rest = featureVal.split(" ", 1)
nameIdent, params = rest.split("(")
@@ -17,13 +17,13 @@ def decodeFunction(featureVal):
params, rest = params.split(")")
param1, param2 = params.split(",")
return retType, name, value, param1, param2
-
+
def decodeEvent(featureVal):
retType, rest = featureVal.split(" ", 1)
nameIdent, params = rest.split("(")
name, value = nameIdent.split("=")
return retType, name, value
-
+
def decodeParam(p):
param = p.strip()
type = ""
@@ -44,7 +44,7 @@ class Face:
self.features = {}
self.values = {}
self.events = {}
-
+
def ReadFromFile(self, name):
currentCategory = ""
currentComment = []
@@ -70,11 +70,11 @@ class Face:
raise
p1 = decodeParam(param1)
p2 = decodeParam(param2)
- self.features[name] = {
- "FeatureType": featureType,
+ self.features[name] = {
+ "FeatureType": featureType,
"ReturnType": retType,
- "Value": value,
- "Param1Type": p1[0], "Param1Name": p1[1], "Param1Value": p1[2],
+ "Value": value,
+ "Param1Type": p1[0], "Param1Name": p1[1], "Param1Value": p1[2],
"Param2Type": p2[0], "Param2Name": p2[1], "Param2Value": p2[2],
"Category": currentCategory, "Comment": currentComment
}
@@ -84,10 +84,10 @@ class Face:
self.order.append(name)
elif featureType == "evt":
retType, name, value = decodeEvent(featureVal)
- self.features[name] = {
- "FeatureType": featureType,
+ self.features[name] = {
+ "FeatureType": featureType,
"ReturnType": retType,
- "Value": value,
+ "Value": value,
"Category": currentCategory, "Comment": currentComment
}
if value in self.events:
@@ -102,16 +102,16 @@ class Face:
except ValueError:
print("Failure %s" % featureVal)
raise Exception()
- self.features[name] = {
- "FeatureType": featureType,
- "Category": currentCategory,
+ self.features[name] = {
+ "FeatureType": featureType,
+ "Category": currentCategory,
"Value": value }
self.order.append(name)
elif featureType == "enu" or featureType == "lex":
name, value = featureVal.split("=", 1)
- self.features[name] = {
- "FeatureType": featureType,
- "Category": currentCategory,
+ self.features[name] = {
+ "FeatureType": featureType,
+ "Category": currentCategory,
"Value": value }
self.order.append(name)
diff --git a/scintilla/scripts/FileGenerator.py b/scintilla/scripts/FileGenerator.py
index e2750eb..11d6d70 100644
--- a/scintilla/scripts/FileGenerator.py
+++ b/scintilla/scripts/FileGenerator.py
@@ -7,8 +7,8 @@
# Requires Python 2.5 or later
# The files are copied to a string apart from sections between a
# ++Autogenerated comment and a --Autogenerated comment which is
-# generated by the CopyWithInsertion function. After the whole string is
-# instantiated, it is compared with the target file and if different the file
+# generated by the CopyWithInsertion function. After the whole string is
+# instantiated, it is compared with the target file and if different the file
# is rewritten.
from __future__ import with_statement
diff --git a/scintilla/scripts/GenerateCaseConvert.py b/scintilla/scripts/GenerateCaseConvert.py
index 37506b7..068a068 100644
--- a/scintilla/scripts/GenerateCaseConvert.py
+++ b/scintilla/scripts/GenerateCaseConvert.py
@@ -3,15 +3,15 @@
# Requires Python 3.3 or later
# Should not be run with old versions of Python.
-# Current best approach divides case conversions into two cases:
+# Current best approach divides case conversions into two cases:
# simple symmetric and complex.
# Simple symmetric is where a lower and upper case pair convert to each
-# other and the folded form is the same as the lower case.
+# other and the folded form is the same as the lower case.
# There are 1006 symmetric pairs.
# These are further divided into ranges (stored as lower, upper, range length,
-# range pitch and singletons (stored as lower, upper).
+# range pitch and singletons (stored as lower, upper).
# Complex is for cases that don't fit the above: where there are multiple
-# characters in one of the forms or fold is different to lower or
+# characters in one of the forms or fold is different to lower or
# lower(upper(x)) or upper(lower(x)) are not x. These are represented as UTF-8
# strings with original, folded, upper, and lower separated by '|'.
# There are 126 complex cases.
@@ -33,7 +33,7 @@ def contiguousRanges(l, diff):
def flatten(listOfLists):
"Flatten one level of nesting"
return itertools.chain.from_iterable(listOfLists)
-
+
def conversionSets():
# For all Unicode characters, see whether they have case conversions
# Return 2 sets: one of simple symmetric conversion cases and another
@@ -89,7 +89,7 @@ def groupRanges(symmetrics):
contiguousGroups = flatten([contiguousRanges(g, 1) for g in groups])
longGroups = [(x[0][0], x[0][1], len(x), 1) for x in contiguousGroups if len(x) > 4]
-
+
oneDiffs = [s for s in symmetrics if s[2] == 1]
contiguousOnes = flatten([contiguousRanges(g, 2) for g in [oneDiffs]])
longOneGroups = [(x[0][0], x[0][1], len(x), 2) for x in contiguousOnes if len(x) > 4]
@@ -97,7 +97,7 @@ def groupRanges(symmetrics):
rangeGroups = sorted(longGroups+longOneGroups, key=lambda s: s[0])
rangeCoverage = list(flatten([range(r[0], r[0]+r[2]*r[3], r[3]) for r in rangeGroups]))
-
+
nonRanges = [(l, u) for l, u, d in symmetrics if l not in rangeCoverage]
return rangeGroups, nonRanges
@@ -107,7 +107,7 @@ def escape(s):
def updateCaseConvert():
symmetrics, complexes = conversionSets()
-
+
rangeGroups, nonRanges = groupRanges(symmetrics)
print(len(rangeGroups), "ranges")
@@ -115,9 +115,9 @@ def updateCaseConvert():
print(len(nonRanges), "non ranges")
nonRangeLines = ["%d,%d, " % x for x in nonRanges]
-
+
print(len(symmetrics), "symmetric")
-
+
complexLines = ['"%s|%s|%s|%s|"' % tuple(escape(t) for t in x) for x in complexes]
print(len(complexLines), "complex")
diff --git a/scintilla/scripts/LexGen.py b/scintilla/scripts/LexGen.py
index e22d69a..d0507b7 100644
--- a/scintilla/scripts/LexGen.py
+++ b/scintilla/scripts/LexGen.py
@@ -44,15 +44,15 @@ def UpdateVersionNumbers(sci, root):
"CFBundleShortVersionString", sci.versionDotted)
def RegenerateAll(root):
-
+
sci = ScintillaData.ScintillaData(root)
Regenerate(root + "src/Catalogue.cxx", "//", sci.lexerModules)
# Regenerate(root + "win32/scintilla.mak", "#", sci.lexFiles) #commented out
# UpdateVersionNumbers(sci, root) #commented out
-
-# HFacer.RegenerateAll(root, False) #commented out
+
+# HFacer.RegenerateAll(root, False) #commented out
if __name__=="__main__":
RegenerateAll("../")
diff --git a/scintilla/scripts/ScintillaData.py b/scintilla/scripts/ScintillaData.py
index a5f2695..7aeee4f 100644
--- a/scintilla/scripts/ScintillaData.py
+++ b/scintilla/scripts/ScintillaData.py
@@ -7,14 +7,14 @@
# version
# versionDotted
# versionCommad
-#
+#
# Date last modified
# dateModified
# yearModified
# mdyModified
# dmyModified
# myModified
-#
+#
# Information about lexers and properties defined in lexers
# lexFiles
# sorted list of lexer files
diff --git a/scintilla/src/CellBuffer.cxx b/scintilla/src/CellBuffer.cxx
index e9f8779..653feb7 100644
--- a/scintilla/src/CellBuffer.cxx
+++ b/scintilla/src/CellBuffer.cxx
@@ -496,6 +496,25 @@ void CellBuffer::SetLineEndTypes(int utf8LineEnds_) {
}
}
+bool CellBuffer::ContainsLineEnd(const char *s, int length) const {
+ unsigned char chBeforePrev = 0;
+ unsigned char chPrev = 0;
+ for (int i = 0; i < length; i++) {
+ const unsigned char ch = s[i];
+ if ((ch == '\r') || (ch == '\n')) {
+ return true;
+ } else if (utf8LineEnds) {
+ unsigned char back3[3] = { chBeforePrev, chPrev, ch };
+ if (UTF8IsSeparator(back3) || UTF8IsNEL(back3 + 1)) {
+ return true;
+ }
+ }
+ chBeforePrev = chPrev;
+ chPrev = ch;
+ }
+ return false;
+}
+
void CellBuffer::SetPerLine(PerLine *pl) {
lv.SetPerLine(pl);
}
diff --git a/scintilla/src/CellBuffer.h b/scintilla/src/CellBuffer.h
index cb81a7d..a515202 100644
--- a/scintilla/src/CellBuffer.h
+++ b/scintilla/src/CellBuffer.h
@@ -177,6 +177,7 @@ public:
void Allocate(int newSize);
int GetLineEndTypes() const { return utf8LineEnds; }
void SetLineEndTypes(int utf8LineEnds_);
+ bool ContainsLineEnd(const char *s, int length) const;
void SetPerLine(PerLine *pl);
int Lines() const;
int LineStart(int line) const;
diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx
index 9db875e..bea6a3e 100644
--- a/scintilla/src/Document.cxx
+++ b/scintilla/src/Document.cxx
@@ -109,6 +109,7 @@ Document::Document() {
useTabs = true;
tabIndents = true;
backspaceUnindents = false;
+ durationStyleOneLine = 0.00001;
matchesValid = false;
regex = 0;
@@ -270,7 +271,7 @@ void Document::TentativeUndo() {
bool endSavePoint = cb.IsSavePoint();
if (startSavePoint != endSavePoint)
NotifySavePoint(endSavePoint);
-
+
cb.TentativeCommit();
}
enteredModification--;
@@ -1276,7 +1277,7 @@ int Document::SetLineIndentation(int line, int indent) {
int indentPos = GetLineIndentPosition(line);
UndoGroup ug(this);
DeleteChars(thisLineStart, indentPos - thisLineStart);
- return thisLineStart + InsertString(thisLineStart, linebuf.c_str(),
+ return thisLineStart + InsertString(thisLineStart, linebuf.c_str(),
static_cast<int>(linebuf.length()));
} else {
return GetLineIndentPosition(line);
@@ -1892,6 +1893,33 @@ void Document::EnsureStyledTo(int pos) {
}
}
+void Document::StyleToAdjustingLineDuration(int pos) {
+ // Place bounds on the duration used to avoid glitches spiking it
+ // and so causing slow styling or non-responsive scrolling
+ const double minDurationOneLine = 0.000001;
+ const double maxDurationOneLine = 0.0001;
+
+ // Alpha value for exponential smoothing.
+ // Most recent value contributes 25% to smoothed value.
+ const double alpha = 0.25;
+
+ const Sci_Position lineFirst = LineFromPosition(GetEndStyled());
+ ElapsedTime etStyling;
+ EnsureStyledTo(pos);
+ const double durationStyling = etStyling.Duration();
+ const Sci_Position lineLast = LineFromPosition(GetEndStyled());
+ if (lineLast >= lineFirst + 8) {
+ // Only adjust for styling multiple lines to avoid instability
+ const double durationOneLine = durationStyling / (lineLast - lineFirst);
+ durationStyleOneLine = alpha * durationOneLine + (1.0 - alpha) * durationStyleOneLine;
+ if (durationStyleOneLine < minDurationOneLine) {
+ durationStyleOneLine = minDurationOneLine;
+ } else if (durationStyleOneLine > maxDurationOneLine) {
+ durationStyleOneLine = maxDurationOneLine;
+ }
+ }
+}
+
void Document::LexerChanged() {
// Tell the watchers the lexer has changed.
for (std::vector<WatcherWithUserData>::iterator it = watchers.begin(); it != watchers.end(); ++it) {
@@ -2187,7 +2215,7 @@ int Document::BraceMatch(int position, int /*maxReStyle*/) {
char chSeek = BraceOpposite(chBrace);
if (chSeek == '\0')
return - 1;
- char styBrace = static_cast<char>(StyleAt(position));
+ const int styBrace = StyleIndexAt(position);
int direction = -1;
if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<')
direction = 1;
@@ -2195,7 +2223,7 @@ int Document::BraceMatch(int position, int /*maxReStyle*/) {
position = NextPosition(position, direction);
while ((position >= 0) && (position < Length())) {
char chAtPos = CharAt(position);
- char styAtPos = static_cast<char>(StyleAt(position));
+ const int styAtPos = StyleIndexAt(position);
if ((position > GetEndStyled()) || (styAtPos == styBrace)) {
if (chAtPos == chBrace)
depth++;
@@ -2526,10 +2554,10 @@ public:
return doc != other.doc || position != other.position;
}
int Pos() const {
- return position;
+ return position;
}
int PosRoundUp() const {
- return position;
+ return position;
}
};
@@ -2626,7 +2654,7 @@ long Cxx11RegexFindText(Document *doc, int minPos, int maxPos, const char *s,
std::wregex regexp;
#if defined(__APPLE__)
// Using a UTF-8 locale doesn't change to Unicode over a byte buffer so '.'
- // is one byte not one character.
+ // is one byte not one character.
// However, on OS X this makes wregex act as Unicode
std::locale localeU("en_US.UTF-8");
regexp.imbue(localeU);
diff --git a/scintilla/src/Document.h b/scintilla/src/Document.h
index d0ca953..bf9117c 100644
--- a/scintilla/src/Document.h
+++ b/scintilla/src/Document.h
@@ -246,6 +246,7 @@ public:
bool useTabs;
bool tabIndents;
bool backspaceUnindents;
+ double durationStyleOneLine;
DecorationList decorations;
@@ -272,6 +273,7 @@ public:
Sci_Position SCI_METHOD LineFromPosition(Sci_Position pos) const;
int ClampPositionIntoDocument(int pos) const;
+ bool ContainsLineEnd(const char *s, int length) const { return cb.ContainsLineEnd(s, length); }
bool IsCrLf(int pos) const;
int LenChar(int pos);
bool InGoodUTF8(int pos, int &start, int &end) const;
@@ -339,6 +341,7 @@ public:
cb.GetCharRange(buffer, position, lengthRetrieve);
}
char SCI_METHOD StyleAt(Sci_Position position) const { return cb.StyleAt(position); }
+ int StyleIndexAt(Sci_Position position) const { return static_cast<unsigned char>(cb.StyleAt(position)); }
void GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const {
cb.GetStyleRange(buffer, position, lengthRetrieve);
}
@@ -375,7 +378,7 @@ public:
struct CharacterExtracted {
unsigned int character;
unsigned int widthBytes;
- CharacterExtracted(unsigned int character_, unsigned int widthBytes_) :
+ CharacterExtracted(unsigned int character_, unsigned int widthBytes_) :
character(character_), widthBytes(widthBytes_) {
}
};
@@ -400,6 +403,7 @@ public:
bool SCI_METHOD SetStyles(Sci_Position length, const char *styles);
int GetEndStyled() const { return endStyled; }
void EnsureStyledTo(int pos);
+ void StyleToAdjustingLineDuration(int pos);
void LexerChanged();
int GetStyleClock() const { return styleClock; }
void IncrementStyleClock();
@@ -425,7 +429,7 @@ public:
void AnnotationSetStyles(int line, const unsigned char *styles);
int AnnotationLines(int line) const;
void AnnotationClearAll();
-
+
bool AddWatcher(DocWatcher *watcher, void *userData);
bool RemoveWatcher(DocWatcher *watcher, void *userData);
diff --git a/scintilla/src/EditModel.h b/scintilla/src/EditModel.h
index 33c1ac0..021bf67 100644
--- a/scintilla/src/EditModel.h
+++ b/scintilla/src/EditModel.h
@@ -42,7 +42,7 @@ public:
Selection sel;
bool primarySelection;
- enum IMEInteraction { imeWindowed, imeInline } imeInteraction;
+ enum IMEInteraction { imeWindowed, imeInline } imeInteraction;
int foldFlags;
ContractionState cs;
diff --git a/scintilla/src/EditView.cxx b/scintilla/src/EditView.cxx
index 04b94a8..fc98c3d 100644
--- a/scintilla/src/EditView.cxx
+++ b/scintilla/src/EditView.cxx
@@ -376,14 +376,14 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co
// See if chars, styles, indicators, are all the same
bool allSame = true;
// Check base line layout
- char styleByte = 0;
+ int styleByte = 0;
int numCharsInLine = 0;
while (numCharsInLine < lineLength) {
int charInDoc = numCharsInLine + posLineStart;
char chDoc = model.pdoc->CharAt(charInDoc);
- styleByte = model.pdoc->StyleAt(charInDoc);
+ styleByte = model.pdoc->StyleIndexAt(charInDoc);
allSame = allSame &&
- (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte));
+ (ll->styles[numCharsInLine] == styleByte);
if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed)
allSame = allSame &&
(ll->chars[numCharsInLine] == chDoc);
@@ -394,7 +394,7 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co
allSame = allSame &&
(ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc)));
else { // Style::caseCamel
- if ((model.pdoc->WordCharClass(ll->chars[numCharsInLine]) == CharClassify::ccWord) &&
+ if ((model.pdoc->WordCharClass(ll->chars[numCharsInLine]) == CharClassify::ccWord) &&
((numCharsInLine == 0) || (model.pdoc->WordCharClass(ll->chars[numCharsInLine - 1]) != CharClassify::ccWord))) {
allSame = allSame && (ll->chars[numCharsInLine] == static_cast<char>(toupper(chDoc)));
} else {
@@ -444,13 +444,13 @@ void EditView::LayoutLine(const EditModel &model, int line, Surface *surface, co
else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseLower)
ll->chars[charInLine] = static_cast<char>(tolower(chDoc));
else if (vstyle.styles[ll->styles[charInLine]].caseForce == Style::caseCamel) {
- if ((model.pdoc->WordCharClass(ll->chars[charInLine]) == CharClassify::ccWord) &&
+ if ((model.pdoc->WordCharClass(ll->chars[charInLine]) == CharClassify::ccWord) &&
((charInLine == 0) || (model.pdoc->WordCharClass(ll->chars[charInLine - 1]) != CharClassify::ccWord))) {
ll->chars[charInLine] = static_cast<char>(toupper(chDoc));
} else {
ll->chars[charInLine] = static_cast<char>(tolower(chDoc));
}
- }
+ }
}
}
ll->xHighlightGuide = 0;
@@ -986,11 +986,10 @@ static void DrawIndicators(Surface *surface, const EditModel &model, const ViewS
startPos = deco->rs.EndRun(startPos);
}
while ((startPos < posLineEnd) && (deco->rs.ValueAt(startPos))) {
- int endPos = deco->rs.EndRun(startPos);
- if (endPos > posLineEnd)
- endPos = posLineEnd;
+ const Range rangeRun(deco->rs.StartRun(startPos), deco->rs.EndRun(startPos));
+ const int endPos = std::min(rangeRun.end, posLineEnd);
const bool hover = vsDraw.indicators[deco->indicator].IsDynamic() &&
- ((hoverIndicatorPos >= startPos) && (hoverIndicatorPos <= endPos));
+ rangeRun.ContainsCharacter(hoverIndicatorPos);
const int value = deco->rs.ValueAt(startPos);
Indicator::DrawState drawState = hover ? Indicator::drawHover : Indicator::drawNormal;
DrawIndicator(deco->indicator, startPos - posLineStart, endPos - posLineStart,
@@ -1476,7 +1475,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
if (indicatorValue) {
const Indicator &indicator = vsDraw.indicators[deco->indicator];
const bool hover = indicator.IsDynamic() &&
- ((model.hoverIndicatorPos >= ts.start + posLineStart) &&
+ ((model.hoverIndicatorPos >= ts.start + posLineStart) &&
(model.hoverIndicatorPos <= ts.end() + posLineStart));
if (hover) {
if (indicator.sacHover.style == INDIC_TEXTFORE) {
diff --git a/scintilla/src/Editor.cxx b/scintilla/src/Editor.cxx
index 03f17c0..7128e96 100644
--- a/scintilla/src/Editor.cxx
+++ b/scintilla/src/Editor.cxx
@@ -173,6 +173,8 @@ Editor::Editor() {
paintAbandonedByStyling = false;
paintingAllText = false;
willRedrawAll = false;
+ idleStyling = SC_IDLESTYLING_NONE;
+ needIdleStyling = false;
modEventMask = SC_MODEVENTMASKALL;
@@ -762,7 +764,7 @@ bool Editor::RangeContainsProtected(int start, int end) const {
end = t;
}
for (int pos = start; pos < end; pos++) {
- if (vs.styles[pdoc->StyleAt(pos)].IsProtected())
+ if (vs.styles[pdoc->StyleIndexAt(pos)].IsProtected())
return true;
}
}
@@ -792,15 +794,15 @@ SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, int mov
pos.SetPosition(posMoved);
if (vs.ProtectionActive()) {
if (moveDir > 0) {
- if ((pos.Position() > 0) && vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()) {
+ if ((pos.Position() > 0) && vs.styles[pdoc->StyleIndexAt(pos.Position() - 1)].IsProtected()) {
while ((pos.Position() < pdoc->Length()) &&
- (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()))
+ (vs.styles[pdoc->StyleIndexAt(pos.Position())].IsProtected()))
pos.Add(1);
}
} else if (moveDir < 0) {
- if (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()) {
+ if (vs.styles[pdoc->StyleIndexAt(pos.Position())].IsProtected()) {
while ((pos.Position() > 0) &&
- (vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()))
+ (vs.styles[pdoc->StyleIndexAt(pos.Position() - 1)].IsProtected()))
pos.Add(-1);
}
}
@@ -919,7 +921,7 @@ void Editor::ScrollTo(int line, bool moveThumb) {
SetTopLine(topLineNew);
// Optimize by styling the view as this will invalidate any needed area
// which could abort the initial paint if discovered later.
- StyleToPositionInView(PositionAfterArea(GetClientRectangle()));
+ StyleAreaBounded(GetClientRectangle(), true);
#ifndef UNDER_CE
// Perform redraw rather than scroll if many lines would be redrawn anyway.
if (performBlit) {
@@ -1692,7 +1694,7 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
paintAbandonedByStyling = false;
- StyleToPositionInView(PositionAfterArea(rcArea));
+ StyleAreaBounded(rcArea, false);
PRectangle rcClient = GetClientRectangle();
//Platform::DebugPrintf("Client: (%3d,%3d) ... (%3d,%3d) %d\n",
@@ -1954,6 +1956,8 @@ void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
void Editor::ClearBeforeTentativeStart() {
// Make positions for the first composition string.
+ FilterSelections();
+ UndoGroup ug(pdoc, (sel.Count() > 1) || !sel.Empty() || inOverstrike);
for (size_t r = 0; r<sel.Count(); r++) {
if (!RangeContainsProtected(sel.Range(r).Start().Position(),
sel.Range(r).End().Position())) {
@@ -2575,21 +2579,24 @@ void Editor::NotifyModified(Document *, DocModification mh, void *) {
}
if ((mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) && cs.HiddenLines()) {
// Some lines are hidden so may need shown.
- // TODO: check if the modified area is hidden.
+ const int lineOfPos = pdoc->LineFromPosition(mh.position);
+ int endNeedShown = mh.position;
if (mh.modificationType & SC_MOD_BEFOREINSERT) {
- int lineOfPos = pdoc->LineFromPosition(mh.position);
- bool insertingNewLine = false;
- for (int i=0; i < mh.length; i++) {
- if ((mh.text[i] == '\n') || (mh.text[i] == '\r'))
- insertingNewLine = true;
- }
- if (insertingNewLine && (mh.position != pdoc->LineStart(lineOfPos)))
- NeedShown(mh.position, pdoc->LineStart(lineOfPos+1) - mh.position);
- else
- NeedShown(mh.position, 0);
+ if (pdoc->ContainsLineEnd(mh.text, mh.length) && (mh.position != pdoc->LineStart(lineOfPos)))
+ endNeedShown = pdoc->LineStart(lineOfPos+1);
} else if (mh.modificationType & SC_MOD_BEFOREDELETE) {
- NeedShown(mh.position, mh.length);
+ // Extend the need shown area over any folded lines
+ endNeedShown = mh.position + mh.length;
+ int lineLast = pdoc->LineFromPosition(mh.position+mh.length);
+ for (int line = lineOfPos; line <= lineLast; line++) {
+ const int lineMaxSubord = pdoc->GetLastChild(line, -1, -1);
+ if (lineLast < lineMaxSubord) {
+ lineLast = lineMaxSubord;
+ endNeedShown = pdoc->LineEnd(lineLast);
+ }
+ }
}
+ NeedShown(mh.position, endNeedShown - mh.position);
}
if (mh.linesAdded != 0) {
// Update contraction state for inserted and removed lines
@@ -3109,7 +3116,7 @@ void Editor::CursorUpOrDown(int direction, Selection::selTypes selt) {
const SelectionPosition spCaretNow = sel.Range(r).caret;
const SelectionPosition posNew = MovePositionSoVisible(
PositionUpOrDown(spCaretNow, direction, lastX), direction);
- sel.Range(r) = selt == Selection::selStream ?
+ sel.Range(r) = selt == Selection::selStream ?
SelectionRange(posNew, sel.Range(r).anchor) : SelectionRange(posNew);
}
sel.RemoveDuplicates();
@@ -3475,7 +3482,7 @@ int Editor::DelWordOrLine(unsigned int iMessage) {
// which means 2 actions so wrap in an undo group.
// Rightwards and leftwards deletions differ in treatment of virtual space.
- // Clear virtual space for leftwards, realise for rightwards.
+ // Clear virtual space for leftwards, realise for rightwards.
const bool leftwards = (iMessage == SCI_DELWORDLEFT) || (iMessage == SCI_DELLINELEFT);
if (!additionalSelectionTyping) {
@@ -3494,7 +3501,7 @@ int Editor::DelWordOrLine(unsigned int iMessage) {
sel.Range(r) = SelectionRange(
InsertSpace(sel.Range(r).caret.Position(), sel.Range(r).caret.VirtualSpace()));
}
-
+
Range rangeDelete;
switch (iMessage) {
case SCI_DELWORDLEFT:
@@ -4572,7 +4579,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
}
bool Editor::PositionIsHotspot(int position) const {
- return vs.styles[static_cast<unsigned char>(pdoc->StyleAt(position))].hotspot;
+ return vs.styles[pdoc->StyleIndexAt(position)].hotspot;
}
bool Editor::PointIsHotspot(Point pt) {
@@ -4597,10 +4604,7 @@ void Editor::SetHoverIndicatorPosition(int position) {
}
}
if (hoverIndicatorPosPrev != hoverIndicatorPos) {
- if (hoverIndicatorPosPrev != INVALID_POSITION)
- InvalidateRange(hoverIndicatorPosPrev, hoverIndicatorPosPrev + 1);
- if (hoverIndicatorPos != INVALID_POSITION)
- InvalidateRange(hoverIndicatorPos, hoverIndicatorPos + 1);
+ Redraw();
}
}
@@ -4898,17 +4902,15 @@ void Editor::Tick() {
}
bool Editor::Idle() {
+ bool needWrap = Wrapping() && wrapPending.NeedsWrap();
- bool idleDone;
-
- bool wrappingDone = !Wrapping();
-
- if (!wrappingDone) {
+ if (needWrap) {
// Wrap lines during idle.
WrapLines(wsIdle);
// No more wrapping
- if (!wrapPending.NeedsWrap())
- wrappingDone = true;
+ needWrap = wrapPending.NeedsWrap();
+ } else if (needIdleStyling) {
+ IdleStyling();
}
// Add more idle things to do here, but make sure idleDone is
@@ -4916,7 +4918,7 @@ bool Editor::Idle() {
// false will stop calling this idle function until SetIdle() is
// called again.
- idleDone = wrappingDone; // && thatDone && theOtherThingDone...
+ const bool idleDone = !needWrap && !needIdleStyling; // && thatDone && theOtherThingDone...
return !idleDone;
}
@@ -5007,9 +5009,9 @@ void Editor::StyleToPositionInView(Position pos) {
int endWindow = PositionAfterArea(GetClientDrawingRectangle());
if (pos > endWindow)
pos = endWindow;
- int styleAtEnd = pdoc->StyleAt(pos-1);
+ const int styleAtEnd = pdoc->StyleIndexAt(pos-1);
pdoc->EnsureStyledTo(pos);
- if ((endWindow > pos) && (styleAtEnd != pdoc->StyleAt(pos-1))) {
+ if ((endWindow > pos) && (styleAtEnd != pdoc->StyleIndexAt(pos-1))) {
// Style at end of line changed so is multi-line change like starting a comment
// so require rest of window to be styled.
DiscardOverdraw(); // Prepared bitmaps may be invalid
@@ -5019,12 +5021,71 @@ void Editor::StyleToPositionInView(Position pos) {
}
}
+int Editor::PositionAfterMaxStyling(int posMax, bool scrolling) const {
+ if ((idleStyling == SC_IDLESTYLING_NONE) || (idleStyling == SC_IDLESTYLING_AFTERVISIBLE)) {
+ // Both states do not limit styling
+ return posMax;
+ }
+
+ // Try to keep time taken by styling reasonable so interaction remains smooth.
+ // When scrolling, allow less time to ensure responsive
+ const double secondsAllowed = scrolling ? 0.005 : 0.02;
+
+ const int linesToStyle = Platform::Clamp(static_cast<int>(secondsAllowed / pdoc->durationStyleOneLine),
+ 10, 0x10000);
+ const int stylingMaxLine = std::min(
+ static_cast<int>(pdoc->LineFromPosition(pdoc->GetEndStyled()) + linesToStyle),
+ pdoc->LinesTotal());
+ return std::min(static_cast<int>(pdoc->LineStart(stylingMaxLine)), posMax);
+}
+
+void Editor::StartIdleStyling(bool truncatedLastStyling) {
+ if ((idleStyling == SC_IDLESTYLING_ALL) || (idleStyling == SC_IDLESTYLING_AFTERVISIBLE)) {
+ if (pdoc->GetEndStyled() < pdoc->Length()) {
+ // Style remainder of document in idle time
+ needIdleStyling = true;
+ }
+ } else if (truncatedLastStyling) {
+ needIdleStyling = true;
+ }
+
+ if (needIdleStyling) {
+ SetIdle(true);
+ }
+}
+
+// Style for an area but bound the amount of styling to remain responsive
+void Editor::StyleAreaBounded(PRectangle rcArea, bool scrolling) {
+ const int posAfterArea = PositionAfterArea(rcArea);
+ const int posAfterMax = PositionAfterMaxStyling(posAfterArea, scrolling);
+ if (posAfterMax < posAfterArea) {
+ // Idle styling may be performed before current visible area
+ // Style a bit now then style further in idle time
+ pdoc->StyleToAdjustingLineDuration(posAfterMax);
+ } else {
+ // Can style all wanted now.
+ StyleToPositionInView(posAfterArea);
+ }
+ StartIdleStyling(posAfterMax < posAfterArea);
+}
+
+void Editor::IdleStyling() {
+ const int posAfterArea = PositionAfterArea(GetClientRectangle());
+ const int endGoal = (idleStyling >= SC_IDLESTYLING_AFTERVISIBLE) ?
+ pdoc->Length() : posAfterArea;
+ const int posAfterMax = PositionAfterMaxStyling(endGoal, false);
+ pdoc->StyleToAdjustingLineDuration(posAfterMax);
+ if (pdoc->GetEndStyled() >= endGoal) {
+ needIdleStyling = false;
+ }
+}
+
void Editor::IdleWork() {
// Style the line after the modification as this allows modifications that change just the
// line of the modification to heal instead of propagating to the rest of the window.
- if (workNeeded.items & WorkNeeded::workStyle)
+ if (workNeeded.items & WorkNeeded::workStyle) {
StyleToPositionInView(pdoc->LineStart(pdoc->LineFromPosition(workNeeded.upTo) + 2));
-
+ }
NotifyUpdateUI();
workNeeded.Reset();
}
@@ -6417,6 +6478,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_ISRANGEWORD:
return pdoc->IsWordAt(static_cast<int>(wParam), static_cast<int>(lParam));
+ case SCI_SETIDLESTYLING:
+ idleStyling = static_cast<int>(wParam);
+ break;
+
+ case SCI_GETIDLESTYLING:
+ return idleStyling;
+
case SCI_SETWRAPMODE:
if (vs.SetWrapState(static_cast<int>(wParam))) {
xOffset = 0;
@@ -6615,7 +6683,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETIMEINTERACTION:
return imeInteraction;
-
+
#ifdef INCLUDE_DEPRECATED_FEATURES
case SCI_SETUSEPALETTE:
InvalidateStyleRedraw();
@@ -7776,6 +7844,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_CLEARSELECTIONS:
sel.Clear();
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
@@ -7786,16 +7855,19 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_ADDSELECTION:
sel.AddSelection(SelectionRange(static_cast<int>(wParam), static_cast<int>(lParam)));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
case SCI_DROPSELECTIONN:
sel.DropSelection(static_cast<int>(wParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
case SCI_SETMAINSELECTION:
sel.SetMain(static_cast<int>(wParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
@@ -7804,6 +7876,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETSELECTIONNCARET:
sel.Range(wParam).caret.SetPosition(static_cast<int>(lParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
@@ -7812,6 +7885,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETSELECTIONNANCHOR:
sel.Range(wParam).anchor.SetPosition(static_cast<int>(lParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
case SCI_GETSELECTIONNANCHOR:
@@ -7819,6 +7893,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETSELECTIONNCARETVIRTUALSPACE:
sel.Range(wParam).caret.SetVirtualSpace(static_cast<int>(lParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
@@ -7827,6 +7902,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETSELECTIONNANCHORVIRTUALSPACE:
sel.Range(wParam).anchor.SetVirtualSpace(static_cast<int>(lParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
@@ -7835,6 +7911,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETSELECTIONNSTART:
sel.Range(wParam).anchor.SetPosition(static_cast<int>(lParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
@@ -7843,6 +7920,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_SETSELECTIONNEND:
sel.Range(wParam).caret.SetPosition(static_cast<int>(lParam));
+ ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h
index aae574a..2ab4c1a 100644
--- a/scintilla/src/Editor.h
+++ b/scintilla/src/Editor.h
@@ -36,7 +36,7 @@ public:
/**
* When platform has a way to generate an event before painting,
- * accumulate needed styling range and other work items in
+ * accumulate needed styling range and other work items in
* WorkNeeded to avoid unnecessary work inside paint handler
*/
class WorkNeeded {
@@ -234,6 +234,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
bool paintingAllText;
bool willRedrawAll;
WorkNeeded workNeeded;
+ int idleStyling;
+ bool needIdleStyling;
int modEventMask;
@@ -525,6 +527,10 @@ protected: // ScintillaBase subclass needs access to much of Editor
int PositionAfterArea(PRectangle rcArea) const;
void StyleToPositionInView(Position pos);
+ int PositionAfterMaxStyling(int posMax, bool scrolling) const;
+ void StartIdleStyling(bool truncatedLastStyling);
+ void StyleAreaBounded(PRectangle rcArea, bool scrolling);
+ void IdleStyling();
virtual void IdleWork();
virtual void QueueIdleWork(WorkNeeded::workItems items, int upTo=0);
diff --git a/scintilla/src/Indicator.cxx b/scintilla/src/Indicator.cxx
index 6b012a9..bae8130 100644
--- a/scintilla/src/Indicator.cxx
+++ b/scintilla/src/Indicator.cxx
@@ -128,7 +128,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
rcBox.top = rcLine.top + 1;
rcBox.left = rc.left;
rcBox.right = rc.right;
- surface->AlphaRectangle(rcBox, (sacDraw.style == INDIC_ROUNDBOX) ? 1 : 0,
+ surface->AlphaRectangle(rcBox, (sacDraw.style == INDIC_ROUNDBOX) ? 1 : 0,
sacDraw.fore, fillAlpha, sacDraw.fore, outlineAlpha, 0);
} else if (sacDraw.style == INDIC_DOTBOX) {
PRectangle rcBox = PixelGridAlign(rc);
diff --git a/scintilla/src/PerLine.cxx b/scintilla/src/PerLine.cxx
index 8cc3818..db61bae 100644
--- a/scintilla/src/PerLine.cxx
+++ b/scintilla/src/PerLine.cxx
@@ -410,8 +410,7 @@ const unsigned char *LineAnnotation::Styles(int line) const {
static char *AllocateAnnotation(int length, int style) {
size_t len = sizeof(AnnotationHeader) + length + ((style == IndividualStyles) ? length : 0);
- char *ret = new char[len];
- memset(ret, 0, len);
+ char *ret = new char[len]();
return ret;
}
diff --git a/scintilla/src/ScintillaBase.cxx b/scintilla/src/ScintillaBase.cxx
index 092a24e..22efb7f 100644
--- a/scintilla/src/ScintillaBase.cxx
+++ b/scintilla/src/ScintillaBase.cxx
@@ -276,7 +276,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
}
PRectangle rcac;
rcac.left = pt.x - ac.lb->CaretFromEdge();
- if (pt.y >= rcPopupBounds.bottom - heightLB && // Wont fit below.
+ if (pt.y >= rcPopupBounds.bottom - heightLB && // Won't fit below.
pt.y >= (rcPopupBounds.bottom + rcPopupBounds.top) / 2) { // and there is more room above.
rcac.top = pt.y - heightLB;
if (rcac.top < rcPopupBounds.top) {
@@ -305,7 +305,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
// Make an allowance for large strings in list
rcList.left = pt.x - ac.lb->CaretFromEdge();
rcList.right = rcList.left + widthLB;
- if (((pt.y + vs.lineHeight) >= (rcPopupBounds.bottom - heightAlloced)) && // Wont fit below.
+ if (((pt.y + vs.lineHeight) >= (rcPopupBounds.bottom - heightAlloced)) && // Won't fit below.
((pt.y + vs.lineHeight / 2) >= (rcPopupBounds.bottom + rcPopupBounds.top) / 2)) { // and there is more room above.
rcList.top = pt.y - heightAlloced;
} else {
diff --git a/scintilla/src/UniConversion.cxx b/scintilla/src/UniConversion.cxx
index 639ccbf..fdb551c 100644
--- a/scintilla/src/UniConversion.cxx
+++ b/scintilla/src/UniConversion.cxx
@@ -19,10 +19,6 @@ using namespace Scintilla;
namespace Scintilla {
#endif
-enum { SURROGATE_TRAIL_FIRST = 0xDC00 };
-enum { SURROGATE_TRAIL_LAST = 0xDFFF };
-enum { SUPPLEMENTAL_PLANE_FIRST = 0x10000 };
-
unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) {
unsigned int len = 0;
for (unsigned int i = 0; i < tlen && uptr[i];) {
diff --git a/scintilla/src/UniConversion.h b/scintilla/src/UniConversion.h
index e2e3887..7e64b90 100644
--- a/scintilla/src/UniConversion.h
+++ b/scintilla/src/UniConversion.h
@@ -57,6 +57,10 @@ inline bool UTF8IsNEL(const unsigned char *us) {
enum { SURROGATE_LEAD_FIRST = 0xD800 };
enum { SURROGATE_LEAD_LAST = 0xDBFF };
+enum { SURROGATE_TRAIL_FIRST = 0xDC00 };
+enum { SURROGATE_TRAIL_LAST = 0xDFFF };
+enum { SUPPLEMENTAL_PLANE_FIRST = 0x10000 };
+
inline unsigned int UTF16CharLength(wchar_t uch) {
return ((uch >= SURROGATE_LEAD_FIRST) && (uch <= SURROGATE_LEAD_LAST)) ? 2 : 1;
}
diff --git a/scintilla/version.txt b/scintilla/version.txt
index ecd385f..dbf96fd 100644
--- a/scintilla/version.txt
+++ b/scintilla/version.txt
@@ -1 +1 @@
-362
+363
diff --git a/scintilla/win32/PlatWin.cxx b/scintilla/win32/PlatWin.cxx
index 3f40818..62fa2e3 100644
--- a/scintilla/win32/PlatWin.cxx
+++ b/scintilla/win32/PlatWin.cxx
@@ -1614,17 +1614,16 @@ void SurfaceD2D::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *
HRESULT hr = pIDWriteFactory->CreateTextLayout(tbuf.buffer, tbuf.tlen, pTextFormat, 10000.0, 1000.0, &pTextLayout);
if (!SUCCEEDED(hr))
return;
- // For now, assuming WCHAR == cluster
if (!SUCCEEDED(pTextLayout->GetClusterMetrics(clusterMetrics, clusters, &count)))
return;
+ // A cluster may be more than one WCHAR, such as for "ffi" which is a ligature in the Candara font
FLOAT position = 0.0f;
size_t ti=0;
for (size_t ci=0; ci<count; ci++) {
- position += clusterMetrics[ci].width;
for (size_t inCluster=0; inCluster<clusterMetrics[ci].length; inCluster++) {
- //poses.buffer[ti++] = int(position + 0.5);
- poses.buffer[ti++] = position;
+ poses.buffer[ti++] = position + clusterMetrics[ci].width * (inCluster + 1) / clusterMetrics[ci].length;
}
+ position += clusterMetrics[ci].width;
}
PLATFORM_ASSERT(ti == static_cast<size_t>(tbuf.tlen));
pTextLayout->Release();
@@ -2463,7 +2462,7 @@ POINT ListBoxX::MinTrackSize() const {
POINT ListBoxX::MaxTrackSize() const {
PRectangle rc = PRectangle::FromInts(0, 0,
- Platform::Maximum(MinClientWidth(),
+ Platform::Maximum(MinClientWidth(),
maxCharWidth * maxItemCharacters + static_cast<int>(TextInset.x) * 2 +
TextOffset() + ::GetSystemMetrics(SM_CXVSCROLL)),
ItemHeight() * lti.Count());
@@ -3162,12 +3161,6 @@ int Platform::Clamp(int val, int minVal, int maxVal) {
return val;
}
-#ifdef _MSC_VER
-// GetVersionEx has been deprecated fro Windows 8.1 but called here to determine if Windows 9x.
-// Too dangerous to find alternate check.
-#pragma warning(disable: 4996)
-#endif
-
void Platform_Initialise(void *hInstance) {
::InitializeCriticalSection(&crPlatformLock);
hinstPlatformRes = static_cast<HINSTANCE>(hInstance);
@@ -3191,10 +3184,6 @@ void Platform_Initialise(void *hInstance) {
ListBoxX_Register();
}
-#ifdef _MSC_VER
-#pragma warning(default: 4996)
-#endif
-
void Platform_Finalise(bool fromDllMain) {
#if defined(USE_D2D)
if (!fromDllMain) {
diff --git a/scintilla/win32/ScintillaWin.cxx b/scintilla/win32/ScintillaWin.cxx
index bccd6ce..67c4332 100644
--- a/scintilla/win32/ScintillaWin.cxx
+++ b/scintilla/win32/ScintillaWin.cxx
@@ -100,6 +100,14 @@
#define UNICODE_NOCHAR 0xFFFF
#endif
+#ifndef IS_HIGH_SURROGATE
+#define IS_HIGH_SURROGATE(x) ((x) >= SURROGATE_LEAD_FIRST && (x) <= SURROGATE_LEAD_LAST)
+#endif
+
+#ifndef IS_LOW_SURROGATE
+#define IS_LOW_SURROGATE(x) ((x) >= SURROGATE_TRAIL_FIRST && (x) <= SURROGATE_TRAIL_LAST)
+#endif
+
#ifndef MK_ALT
#define MK_ALT 32
#endif
@@ -212,6 +220,7 @@ class ScintillaWin :
public ScintillaBase {
bool lastKeyDownConsumed;
+ wchar_t lastHighSurrogateChar;
bool capturedMouse;
bool trackedMouseLeave;
@@ -269,6 +278,7 @@ class ScintillaWin :
virtual bool DragThreshold(Point ptStart, Point ptNow);
virtual void StartDrag();
int TargetAsUTF8(char *text);
+ void AddCharUTF16(wchar_t const *wcs, unsigned int wclen);
int EncodedFromUTF8(char *utf8, char *encoded) const;
sptr_t WndPaint(uptr_t wParam);
@@ -383,6 +393,7 @@ ATOM ScintillaWin::callClassAtom = 0;
ScintillaWin::ScintillaWin(HWND hwnd) {
lastKeyDownConsumed = false;
+ lastHighSurrogateChar = 0;
capturedMouse = false;
trackedMouseLeave = false;
@@ -729,6 +740,26 @@ int ScintillaWin::EncodedFromUTF8(char *utf8, char *encoded) const {
}
}
+// Add one character from a UTF-16 string, by converting to either UTF-8 or
+// the current codepage. Code is similar to HandleCompositionWindowed().
+void ScintillaWin::AddCharUTF16(wchar_t const *wcs, unsigned int wclen) {
+ if (IsUnicodeMode()) {
+ char utfval[maxLenInputIME * 3];
+ unsigned int len = UTF8Length(wcs, wclen);
+ UTF8FromUTF16(wcs, wclen, utfval, len);
+ utfval[len] = '\0';
+ AddCharUTF(utfval, len);
+ } else {
+ UINT cpDest = CodePageOfDocument();
+ char inBufferCP[maxLenInputIME * 2];
+ int size = ::WideCharToMultiByte(cpDest,
+ 0, wcs, wclen, inBufferCP, sizeof(inBufferCP) - 1, 0, 0);
+ for (int i=0; i<size; i++) {
+ AddChar(inBufferCP[i]);
+ }
+ }
+}
+
sptr_t ScintillaWin::WndPaint(uptr_t wParam) {
//ElapsedTime et;
@@ -950,13 +981,13 @@ void ScintillaWin::EscapeHanja() {
SetCandidateWindowPos();
// IME_ESC_HANJA_MODE appears to receive the first character only.
if (ImmEscapeW(GetKeyboardLayout(0), imc.hIMC, IME_ESC_HANJA_MODE, &uniChar[0])) {
- SetSelection (currentPos, currentPos + oneCharLen);
+ SetSelection(currentPos, currentPos + oneCharLen);
}
}
}
void ScintillaWin::ToggleHanja() {
- // If selection, convert every hanja to hangul within the main range.
+ // If selection, convert every hanja to hangul within the main range.
// If no selection, commit to IME.
if (sel.Count() > 1) {
return; // Do not allow multi carets.
@@ -969,12 +1000,59 @@ void ScintillaWin::ToggleHanja() {
}
}
+namespace {
+
+unsigned int GetImeCaretPos(HIMC hIMC) {
+ return ImmGetCompositionStringW(hIMC, GCS_CURSORPOS, NULL, 0);
+}
+
+std::vector<BYTE> GetImeAttributes(HIMC hIMC) {
+ int attrLen = ::ImmGetCompositionStringW(hIMC, GCS_COMPATTR, NULL, 0);
+ std::vector<BYTE> attr(attrLen, 0);
+ ::ImmGetCompositionStringW(hIMC, GCS_COMPATTR, &attr[0], static_cast<DWORD>(attr.size()));
+ return attr;
+}
+
+std::vector<int> MapImeIndicators(std::vector<BYTE> inputStyle) {
+ std::vector<int> imeIndicator(inputStyle.size(), SC_INDICATOR_UNKNOWN);
+ for (size_t i = 0; i < inputStyle.size(); i++) {
+ switch (static_cast<int>(inputStyle.at(i))) {
+ case ATTR_INPUT:
+ imeIndicator[i] = SC_INDICATOR_INPUT;
+ break;
+ case ATTR_TARGET_NOTCONVERTED:
+ case ATTR_TARGET_CONVERTED:
+ imeIndicator[i] = SC_INDICATOR_TARGET;
+ break;
+ case ATTR_CONVERTED:
+ imeIndicator[i] = SC_INDICATOR_CONVERTED;
+ break;
+ default:
+ imeIndicator[i] = SC_INDICATOR_UNKNOWN;
+ break;
+ }
+ }
+ return imeIndicator;
+}
+
+std::wstring GetCompositionString(HIMC hIMC, DWORD dwIndex) {
+ const LONG byteLen = ::ImmGetCompositionStringW(hIMC, dwIndex, NULL, 0);
+ std::wstring wcs(byteLen / 2, 0);
+ ::ImmGetCompositionStringW(hIMC, dwIndex, &wcs[0], byteLen);
+ return wcs;
+}
+
+}
+
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.
IMContext imc(MainHWND());
- if (!imc.hIMC) {
+ if (!imc.hIMC)
+ return 0;
+ if (pdoc->IsReadOnly() || SelectionContainsProtected()) {
+ ::ImmNotifyIME(imc.hIMC, NI_COMPOSITIONSTR, CPS_CANCEL, 0);
return 0;
}
@@ -989,28 +1067,15 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
view.imeCaretBlockOverride = false;
if (lParam & GCS_COMPSTR) {
- wchar_t wcs[maxLenInputIME] = { 0 };
- long bytes = ::ImmGetCompositionStringW
- (imc.hIMC, GCS_COMPSTR, wcs, maxLenInputIME);
- unsigned int wcsLen = bytes / 2;
-
- if ((wcsLen == 0) || (wcsLen >= maxLenInputIME)) {
+ const std::wstring wcs = GetCompositionString(imc.hIMC, GCS_COMPSTR);
+ if ((wcs.size() == 0) || (wcs.size() >= maxLenInputIME)) {
ShowCaretAtCurrentPosition();
return 0;
}
pdoc->TentativeStart(); // TentativeActive from now on.
- // Get attribute information from composition string.
- BYTE compAttr[maxLenInputIME] = { 0 };
- unsigned int imeCursorPos = 0;
-
- if (lParam & GCS_COMPATTR) {
- ImmGetCompositionStringW(imc.hIMC, GCS_COMPATTR, compAttr, sizeof(compAttr));
- }
- if (lParam & GCS_CURSORPOS) {
- imeCursorPos = ImmGetCompositionStringW(imc.hIMC, GCS_CURSORPOS, NULL, 0);
- }
+ std::vector<int> imeIndicator = MapImeIndicators(GetImeAttributes(imc.hIMC));
// Display character by character.
int numBytes = 0;
@@ -1018,9 +1083,9 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
bool tmpRecordingMacro = recordingMacro;
recordingMacro = false;
- for (size_t i = 0; i < wcsLen; ) {
+ for (size_t i = 0; i < wcs.size(); ) {
const size_t ucWidth = UTF16CharLength(wcs[i]);
- const std::wstring uniChar(wcs+i, ucWidth);
+ const std::wstring uniChar(wcs, i, ucWidth);
char oneChar[UTF8MaxBytes + 1] = "\0\0\0\0"; // Maximum 4 bytes in utf8
unsigned int oneCharLen = 0;
@@ -1040,39 +1105,22 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
numBytes += oneCharLen;
imeCharPos[i + ucWidth] = numBytes;
- // Draw an indicator on the character.
- int indicator = SC_INDICATOR_UNKNOWN;
- switch ((int)compAttr[i]) {
- case ATTR_INPUT:
- indicator = SC_INDICATOR_INPUT;
- break;
- case ATTR_TARGET_NOTCONVERTED:
- case ATTR_TARGET_CONVERTED:
- indicator = SC_INDICATOR_TARGET;
- break;
- case ATTR_CONVERTED:
- indicator = SC_INDICATOR_CONVERTED;
- break;
- }
- DrawImeIndicator(indicator, oneCharLen);
+ DrawImeIndicator(imeIndicator[i], oneCharLen);
i += ucWidth;
}
recordingMacro = tmpRecordingMacro;
// Move IME caret position.
- MoveImeCarets(-imeCharPos[wcsLen] + imeCharPos[imeCursorPos]);
+ unsigned int imeCursorPos = GetImeCaretPos(imc.hIMC);
+ MoveImeCarets(-imeCharPos[wcs.size()] + imeCharPos[imeCursorPos]);
if (KoreanIME()) {
view.imeCaretBlockOverride = true;
}
} else if (lParam & GCS_RESULTSTR) {
- wchar_t wcs[maxLenInputIME] = { 0 };
- long bytes = ::ImmGetCompositionStringW
- (imc.hIMC, GCS_RESULTSTR, wcs, maxLenInputIME);
- unsigned int wcsLen = bytes / 2;
-
- for (size_t i = 0; i < wcsLen;) {
+ const std::wstring wcs = GetCompositionString(imc.hIMC, GCS_RESULTSTR);
+ for (size_t i = 0; i < wcs.size();) {
const size_t ucWidth = UTF16CharLength(wcs[i]);
- const std::wstring uniChar(wcs+i, ucWidth);
+ const std::wstring uniChar(wcs, i, ucWidth);
char oneChar[UTF8MaxBytes+1] = "\0\0\0\0"; // Maximum 4 bytes in UTF-8.
unsigned int oneCharLen = 0;
@@ -1414,40 +1462,32 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
case WM_CHAR:
if (((wParam >= 128) || !iscntrl(static_cast<int>(wParam))) || !lastKeyDownConsumed) {
- wchar_t wcs[2] = {static_cast<wchar_t>(wParam), 0};
- if (IsUnicodeMode()) {
- // For a wide character version of the window:
- char utfval[UTF8MaxBytes];
- unsigned int len = UTF8Length(wcs, 1);
- UTF8FromUTF16(wcs, 1, utfval, len);
- AddCharUTF(utfval, len);
- } else {
- UINT cpDest = CodePageOfDocument();
- char inBufferCP[20];
- int size = ::WideCharToMultiByte(cpDest,
- 0, wcs, 1, inBufferCP, sizeof(inBufferCP) - 1, 0, 0);
- inBufferCP[size] = '\0';
- AddCharUTF(inBufferCP, size);
+ wchar_t wcs[3] = {static_cast<wchar_t>(wParam), 0};
+ unsigned int wclen = 1;
+ if (IS_HIGH_SURROGATE(wcs[0])) {
+ // If this is a high surrogate character, we need a second one
+ lastHighSurrogateChar = wcs[0];
+ return 0;
+ } else if (IS_LOW_SURROGATE(wcs[0])) {
+ wcs[1] = wcs[0];
+ wcs[0] = lastHighSurrogateChar;
+ lastHighSurrogateChar = 0;
+ wclen = 2;
}
+ AddCharUTF16(wcs, wclen);
}
return 0;
case WM_UNICHAR:
if (wParam == UNICODE_NOCHAR) {
- return IsUnicodeMode() ? 1 : 0;
+ return TRUE;
} else if (lastKeyDownConsumed) {
return 1;
} else {
- if (IsUnicodeMode()) {
- char utfval[UTF8MaxBytes];
- wchar_t wcs[2] = {static_cast<wchar_t>(wParam), 0};
- unsigned int len = UTF8Length(wcs, 1);
- UTF8FromUTF16(wcs, 1, utfval, len);
- AddCharUTF(utfval, len);
- return 1;
- } else {
- return 0;
- }
+ wchar_t wcs[3] = {0};
+ unsigned int wclen = UTF16FromUTF32Character(static_cast<unsigned int>(wParam), wcs);
+ AddCharUTF16(wcs, wclen);
+ return FALSE;
}
case WM_SYSKEYDOWN:
@@ -1473,7 +1513,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
}
case WM_IME_REQUEST: {
- if (wParam == IMR_RECONVERTSTRING) {
+ if (wParam == IMR_RECONVERTSTRING) {
return ImeOnReconvert(lParam);
}
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
@@ -1534,7 +1574,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
case WM_IME_COMPOSITION:
- if (KoreanIME() || imeInteraction == imeInline) {
+ if (KoreanIME() || imeInteraction == imeInline) {
return HandleCompositionInline(wParam, lParam);
} else {
return HandleCompositionWindowed(wParam, lParam);
@@ -1681,7 +1721,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
#endif
case SCI_SETTECHNOLOGY:
- if ((wParam == SC_TECHNOLOGY_DEFAULT) ||
+ if ((wParam == SC_TECHNOLOGY_DEFAULT) ||
(wParam == SC_TECHNOLOGY_DIRECTWRITERETAIN) ||
(wParam == SC_TECHNOLOGY_DIRECTWRITEDC) ||
(wParam == SC_TECHNOLOGY_DIRECTWRITE)) {
@@ -2180,7 +2220,7 @@ void ScintillaWin::Paste() {
if (!::OpenClipboard(MainHWND()))
return;
UndoGroup ug(pdoc);
- const bool isLine = SelectionEmpty() &&
+ const bool isLine = SelectionEmpty() &&
(::IsClipboardFormatAvailable(cfLineSelect) || ::IsClipboardFormatAvailable(cfVSLineTag));
ClearSelection(multiPasteMode == SC_MULTIPASTE_EACH);
bool isRectangular = (::IsClipboardFormatAvailable(cfColumnSelect) != 0);
@@ -2608,7 +2648,7 @@ void ScintillaWin::ImeStartComposition() {
if (stylesValid) {
// Since the style creation code has been made platform independent,
// The logfont for the IME is recreated here.
- int styleHere = (pdoc->StyleAt(sel.MainCaret())) & 31;
+ const int styleHere = pdoc->StyleIndexAt(sel.MainCaret());
LOGFONTW lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L""};
int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel * SC_FONT_SIZE_MULTIPLIER;
if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1
@@ -2679,7 +2719,7 @@ LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) {
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;
+ rc->dwTargetStrOffset =rc->dwCompStrOffset;
IMContext imc(MainHWND());
if (!imc.hIMC)
@@ -2695,7 +2735,7 @@ LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) {
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.
+ // 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());