• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28563 (tree)
Time2019-04-13 16:12:45
Authorstefankueng

Log Message

Merged revision(s) r28561, r28562 from trunk:
* Update to Scintilla 4.1.4
* apply the backgroundcolors patch

Change Summary

Incremental Difference

--- branches/1.12.x/ext/scintilla/.hg_archival.txt (revision 28562)
+++ branches/1.12.x/ext/scintilla/.hg_archival.txt (revision 28563)
@@ -1,6 +1,6 @@
11 repo: bdf8c3ef2fb01ea24578e726337888e706d10b92
2-node: 974d0f564d0da81442861a23ce670e4312bebda0
2+node: 6e30c91dfee4fd5c498032180c9917cc6ec21da0
33 branch: default
4-latesttag: rel-4-1-3
4+latesttag: rel-4-1-4
55 latesttagdistance: 1
66 changessincelatesttag: 1
--- branches/1.12.x/ext/scintilla/backgroundcolors.patch (revision 28562)
+++ branches/1.12.x/ext/scintilla/backgroundcolors.patch (revision 28563)
@@ -1,8 +1,8 @@
11 Index: include/Scintilla.h
22 ===================================================================
3---- include/Scintilla.h (revision 28493)
3+--- include/Scintilla.h (revision 28561)
44 +++ include/Scintilla.h (working copy)
5-@@ -1127,6 +1127,8 @@
5+@@ -1129,6 +1129,8 @@
66 #endif
77 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
88
@@ -11,11 +11,11 @@
1111 /* These structures are defined to be exactly the same shape as the Win32
1212 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
1313 * So older code that treats Scintilla as a RichEdit will work. */
14-Index: src/Editor.cxx
15-===================================================================
16---- src/Editor.cxx (revision 28493)
17-+++ src/Editor.cxx (working copy)
18-@@ -106,6 +106,7 @@
14+Index: src/Editor.cxx
15+===================================================================
16+--- src/Editor.cxx (revision 28561)
17++++ src/Editor.cxx (working copy)
18+@@ -109,6 +109,7 @@
1919 }
2020
2121 Editor::Editor() : durationWrapOneLine(0.00001, 0.000001, 0.0001) {
@@ -25,21 +25,21 @@
2525 stylesValid = false;
2626 Index: src/Editor.h
2727 ===================================================================
28---- src/Editor.h (revision 28493)
28+--- src/Editor.h (revision 28561)
2929 +++ src/Editor.h (working copy)
3030 @@ -596,6 +596,7 @@
31- static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len);
31+ static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len) noexcept;
3232
3333 public:
3434 + virtual void NotifyParent(SCNotification * scn) = 0;
3535 // Public so the COM thunks can access it.
36- bool IsUnicodeMode() const;
36+ bool IsUnicodeMode() const noexcept;
3737 // Public so scintilla_send_message can use it.
3838 Index: src/EditView.cxx
3939 ===================================================================
40---- src/EditView.cxx (revision 28493)
40+--- src/EditView.cxx (revision 28561)
4141 +++ src/EditView.cxx (working copy)
42-@@ -56,6 +56,7 @@
42+@@ -55,6 +55,7 @@
4343 #include "MarginView.h"
4444 #include "EditView.h"
4545 #include "ElapsedPeriod.h"
@@ -47,7 +47,7 @@
4747
4848 using namespace Scintilla;
4949
50-@@ -188,6 +189,7 @@
50+@@ -187,6 +188,7 @@
5151 tabArrowHeight = 4;
5252 customDrawTabArrow = nullptr;
5353 customDrawWrapMarker = nullptr;
@@ -76,7 +76,7 @@
7676
7777 Index: src/EditView.h
7878 ===================================================================
79---- src/EditView.h (revision 28493)
79+--- src/EditView.h (revision 28561)
8080 +++ src/EditView.h (working copy)
8181 @@ -77,6 +77,7 @@
8282 std::unique_ptr<Surface> pixmapLine;
@@ -88,9 +88,9 @@
8888 PositionCache posCache;
8989 Index: win32/ScintillaWin.cxx
9090 ===================================================================
91---- win32/ScintillaWin.cxx (revision 28493)
91+--- win32/ScintillaWin.cxx (revision 28561)
9292 +++ win32/ScintillaWin.cxx (working copy)
93-@@ -358,6 +358,7 @@
93+@@ -357,6 +357,7 @@
9494 void SetCtrlID(int identifier) override;
9595 int GetCtrlID() override;
9696 void NotifyParent(SCNotification scn) override;
@@ -98,7 +98,7 @@
9898 void NotifyDoubleClick(Point pt, int modifiers) override;
9999 CaseFolder *CaseFolderForEncoding() override;
100100 std::string CaseMapString(const std::string &s, int caseMapping) override;
101-@@ -2024,6 +2025,13 @@
101+@@ -2023,6 +2024,13 @@
102102 GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
103103 }
104104
--- branches/1.12.x/ext/scintilla/doc/ScintillaDoc.html (revision 28562)
+++ branches/1.12.x/ext/scintilla/doc/ScintillaDoc.html (revision 28563)
@@ -3213,11 +3213,13 @@
32133213 <p><b id="SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int caretStyle)</b><br />
32143214 <b id="SCI_GETCARETSTYLE">SCI_GETCARETSTYLE &rarr; int</b><br />
32153215 The style of the caret can be set with <code>SCI_SETCARETSTYLE</code> to be a line caret
3216- (CARETSTYLE_LINE=1), a block caret (CARETSTYLE_BLOCK=2) or to not draw at all
3217- (CARETSTYLE_INVISIBLE=0). The default value is the line caret (CARETSTYLE_LINE=1).
3216+ (CARETSTYLE_LINE=1) or a block caret (CARETSTYLE_BLOCK=2) for insert mode combined with
3217+ a bar caret (CARETSTYLE_OVERSTRIKE_BAR=0) or a block caret (CARETSTYLE_OVERSTRIKE_BLOCK=16) for overtype mode,
3218+ or to not draw at all (CARETSTYLE_INVISIBLE=0). The default value for insert mode is the line caret (CARETSTYLE_LINE=1),
3219+ for overtype mode is the bar caret (CARETSTYLE_OVERSTRIKE_BAR=0).
32183220 You can determine the current caret style setting using <code>SCI_GETCARETSTYLE</code>.</p>
32193221
3220- <p>The block character draws most combining and multibyte character sequences successfully,
3222+ <p>The block caret draws most combining and multibyte character sequences successfully,
32213223 though some fonts like Thai Fonts (and possibly others) can sometimes appear strange when
32223224 the cursor is positioned at these characters, which may result in only drawing a part of the
32233225 cursor character sequence. This is most notable on Windows platforms.</p>
@@ -5002,8 +5004,6 @@
50025004 There is some interaction between call tips and autocompletion lists in that showing a
50035005 call tip cancels any active autocompletion list, and vice versa.</p>
50045006
5005- <p>Call tips are not implemented on Qt.</p>
5006-
50075007 <p>Call tips can highlight part of the text within them. You could use this to highlight the
50085008 current argument to a function by counting the number of commas (or whatever separator your
50095009 language uses). See <code>SciTEBase::CharAdded()</code> in <code>SciTEBase.cxx</code> for an
--- branches/1.12.x/ext/scintilla/doc/ScintillaDownload.html (revision 28562)
+++ branches/1.12.x/ext/scintilla/doc/ScintillaDownload.html (revision 28563)
@@ -26,9 +26,9 @@
2626 <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
2727 <tr>
2828 <td>
29- <font size="4"> <a href="https://www.scintilla.org/scintilla413.zip">
29+ <font size="4"> <a href="https://www.scintilla.org/scintilla414.zip">
3030 Windows</a>&nbsp;&nbsp;
31- <a href="https://www.scintilla.org/scintilla413.tgz">
31+ <a href="https://www.scintilla.org/scintilla414.tgz">
3232 GTK+/Linux</a>&nbsp;&nbsp;
3333 </font>
3434 </td>
@@ -42,7 +42,7 @@
4242 containing very few restrictions.
4343 </p>
4444 <h3>
45- Release 4.1.3
45+ Release 4.1.4
4646 </h3>
4747 <h4>
4848 Source Code
@@ -50,8 +50,8 @@
5050 The source code package contains all of the source code for Scintilla but no binary
5151 executable code and is available in
5252 <ul>
53- <li><a href="https://www.scintilla.org/scintilla413.zip">zip format</a> (1600K) commonly used on Windows</li>
54- <li><a href="https://www.scintilla.org/scintilla413.tgz">tgz format</a> (1400K) commonly used on Linux and compatible operating systems</li>
53+ <li><a href="https://www.scintilla.org/scintilla414.zip">zip format</a> (1700K) commonly used on Windows</li>
54+ <li><a href="https://www.scintilla.org/scintilla414.tgz">tgz format</a> (1500K) commonly used on Linux and compatible operating systems</li>
5555 </ul>
5656 Instructions for building on both Windows and Linux are included in the readme file.
5757 <h4>
--- branches/1.12.x/ext/scintilla/doc/ScintillaHistory.html (revision 28562)
+++ branches/1.12.x/ext/scintilla/doc/ScintillaHistory.html (revision 28563)
@@ -540,6 +540,7 @@
540540 <td>jj5</td>
541541 </tr><tr>
542542 <td>Jad Altahan</td>
543+ <td>Andrea Ricchi</td>
543544 </tr>
544545 </table>
545546 <p>
@@ -552,6 +553,79 @@
552553 </li>
553554 </ul>
554555 <h3>
556+ <a href="https://www.scintilla.org/scite414.zip">Release 4.1.4</a>
557+ </h3>
558+ <ul>
559+ <li>
560+ Released 7 March 2019.
561+ </li>
562+ <li>
563+ Calltips implemented on Qt.
564+ <a href="https://sourceforge.net/p/scintilla/bugs/1548/">Bug #1548</a>.
565+ </li>
566+ <li>
567+ Block caret in overtype mode SCI_SETCARETSTYLE(caretStyle | CARETSTYLE_OVERSTRIKE_BLOCK).
568+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1217/">Feature #1217</a>.
569+ </li>
570+ <li>
571+ SciTE supports changing caret style via caret.style property.
572+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1264/">Feature #1624</a>.
573+ </li>
574+ <li>
575+ Lexer added for .NET's Common Intermediate Language CIL.
576+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1265/">Feature #1265</a>.
577+ </li>
578+ <li>
579+ The C++ lexer, with styling.within.preprocessor on, now interprets "(" in preprocessor "#if("
580+ as an operator instead of part of the directive. This improves folding as well which could become
581+ unbalanced.
582+ </li>
583+ <li>
584+ Fix raw strings in Nim.
585+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1253/">Feature #1253</a>.
586+ </li>
587+ <li>
588+ Fix inconsistency with dot styling in Nim.
589+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1260/">Feature #1260</a>.
590+ </li>
591+ <li>
592+ Enhance the styling of backticks in Nim.
593+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1261/">Feature #1261</a>.
594+ </li>
595+ <li>
596+ Enhance raw string identifier styling in Nim.
597+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1262/">Feature #1262</a>.
598+ </li>
599+ <li>
600+ Fix fold behaviour with comments in Nim.
601+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1254/">Feature #1254</a>.
602+ </li>
603+ <li>
604+ Fix TCL lexer recognizing '"' after "," inside a bracketed substitution.
605+ <a href="https://sourceforge.net/p/scintilla/bugs/1947/">Bug #1947</a>.
606+ </li>
607+ <li>
608+ Fix garbage text from SCI_MOVESELECTEDLINESUP and SCI_MOVESELECTEDLINESDOWN
609+ for rectangular or thin selection by performing no action.
610+ <a href="https://sourceforge.net/p/scintilla/bugs/2078/">Bug #2078</a>.
611+ </li>
612+ <li>
613+ Ensure container notified if Insert pressed when caret off-screen.
614+ <a href="https://sourceforge.net/p/scintilla/bugs/2083/">Bug #2083</a>.
615+ </li>
616+ <li>
617+ Fix memory leak when checking running instance on GTK.
618+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1267/">Feature #1267</a>.
619+ </li>
620+ <li>
621+ Platform layer font cache removed on Win32 as there is a platform-independent cache.
622+ </li>
623+ <li>
624+ SciTE for GTK easier to build on macOS.
625+ <a href="https://sourceforge.net/p/scintilla/bugs/2084/">Bug #2084</a>.
626+ </li>
627+ </ul>
628+ <h3>
555629 <a href="https://www.scintilla.org/scite413.zip">Release 4.1.3</a>
556630 </h3>
557631 <ul>
@@ -1161,6 +1235,9 @@
11611235 Released 26 May 2017.
11621236 </li>
11631237 <li>
1238+ This is the final release of SciTE 3.x.
1239+ </li>
1240+ <li>
11641241 Support dropped for Microsoft Visual C++ 2013 due to increased use of C++11 features.
11651242 </li>
11661243 <li>
@@ -1244,7 +1321,7 @@
12441321 </li>
12451322 <li>
12461323 SciTE on Windows Find strip Find button works in incremental no-close mode.
1247- <href="https://sourceforge.net/p/scintilla/bugs/1926/">Bug #1926</a>.
1324+ <a href="https://sourceforge.net/p/scintilla/bugs/1926/">Bug #1926</a>.
12481325 </li>
12491326 </ul>
12501327 <h3>
--- branches/1.12.x/ext/scintilla/doc/index.html (revision 28562)
+++ branches/1.12.x/ext/scintilla/doc/index.html (revision 28563)
@@ -9,7 +9,7 @@
99 <meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
1010 <meta name="Description"
1111 content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
12- <meta name="Date.Modified" content="20190110" />
12+ <meta name="Date.Modified" content="20190307" />
1313 <meta name="viewport" content="width=device-width, initial-scale=1" />
1414 <style type="text/css">
1515 #versionlist {
@@ -56,8 +56,8 @@
5656 GTK+, and OS X</font>
5757 </td>
5858 <td width="40%" align="right">
59- <font color="#FFCC99" size="3"> Release version 4.1.3<br />
60- Site last modified January 10 2019</font>
59+ <font color="#FFCC99" size="3"> Release version 4.1.4<br />
60+ Site last modified March 7 2019</font>
6161 </td>
6262 <td width="20%">
6363 &nbsp;
@@ -72,6 +72,7 @@
7272 </tr>
7373 </table>
7474 <ul id="versionlist">
75+ <li>Version 4.1.4 makes calltips work on Qt and adds a lexer for .NET's Common Intermediate Language CIL.</li>
7576 <li>Version 4.1.3 is compatible with macOS 10.14, improves performance, and adds a new lexer for Nim which will replace the "nimrod" lexer.</li>
7677 <li>Version 4.1.2 is a minor release.</li>
7778 <li>Version 4.1.1 adds optional indexing of line starts in UTF-8 documents by UTF-32 code points and UTF-16 code units.</li>
--- branches/1.12.x/ext/scintilla/include/SciLexer.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/include/SciLexer.h (revision 28563)
@@ -139,6 +139,7 @@
139139 #define SCLEX_STATA 124
140140 #define SCLEX_SAS 125
141141 #define SCLEX_NIM 126
142+#define SCLEX_CIL 127
142143 #define SCLEX_AUTOMATIC 1000
143144 #define SCE_P_DEFAULT 0
144145 #define SCE_P_COMMENTLINE 1
@@ -1873,6 +1874,17 @@
18731874 #define SCE_NIM_NUMERROR 14
18741875 #define SCE_NIM_OPERATOR 15
18751876 #define SCE_NIM_IDENTIFIER 16
1877+#define SCE_CIL_DEFAULT 0
1878+#define SCE_CIL_COMMENT 1
1879+#define SCE_CIL_COMMENTLINE 2
1880+#define SCE_CIL_WORD 3
1881+#define SCE_CIL_WORD2 4
1882+#define SCE_CIL_WORD3 5
1883+#define SCE_CIL_STRING 6
1884+#define SCE_CIL_LABEL 7
1885+#define SCE_CIL_OPERATOR 8
1886+#define SCE_CIL_IDENTIFIER 9
1887+#define SCE_CIL_STRINGEOL 10
18761888 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
18771889
18781890 #endif
--- branches/1.12.x/ext/scintilla/include/Scintilla.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/include/Scintilla.h (revision 28563)
@@ -827,6 +827,8 @@
827827 #define CARETSTYLE_INVISIBLE 0
828828 #define CARETSTYLE_LINE 1
829829 #define CARETSTYLE_BLOCK 2
830+#define CARETSTYLE_OVERSTRIKE_BAR 0
831+#define CARETSTYLE_OVERSTRIKE_BLOCK 16
830832 #define SCI_SETCARETSTYLE 2512
831833 #define SCI_GETCARETSTYLE 2513
832834 #define SCI_SETINDICATORCURRENT 2500
--- branches/1.12.x/ext/scintilla/lexers/LexCIL.cxx (nonexistent)
+++ branches/1.12.x/ext/scintilla/lexers/LexCIL.cxx (revision 28563)
@@ -0,0 +1,404 @@
1+// Scintilla source code edit control
2+/** @file LexCIL.cxx
3+ ** Lexer for Common Intermediate Language
4+ ** Written by Jad Altahan (github.com/xv)
5+ ** CIL manual: https://www.ecma-international.org/publications/standards/Ecma-335.htm
6+ **/
7+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
8+// The License.txt file describes the conditions under which this software may be distributed.
9+
10+#include <stdlib.h>
11+#include <string.h>
12+#include <stdio.h>
13+#include <stdarg.h>
14+#include <assert.h>
15+#include <ctype.h>
16+
17+#include <string>
18+#include <map>
19+#include <algorithm>
20+
21+#include "ILexer.h"
22+#include "Scintilla.h"
23+#include "SciLexer.h"
24+
25+#include "StringCopy.h"
26+#include "WordList.h"
27+#include "LexAccessor.h"
28+#include "Accessor.h"
29+#include "StyleContext.h"
30+#include "CharacterSet.h"
31+#include "CharacterCategory.h"
32+#include "LexerModule.h"
33+#include "OptionSet.h"
34+#include "DefaultLexer.h"
35+
36+using namespace Scintilla;
37+
38+namespace {
39+ // Use an unnamed namespace to protect the functions and classes from name conflicts
40+
41+bool IsAWordChar(const int ch) {
42+ return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
43+}
44+
45+bool IsOperator(const int ch) {
46+ if ((ch < 0x80) && (isalnum(ch)))
47+ return false;
48+
49+ if (strchr("!%&*+-/<=>@^|~()[]{}", ch)) {
50+ return true;
51+ }
52+
53+ return false;
54+}
55+
56+constexpr bool IsStreamCommentStyle(const int style) noexcept {
57+ return style == SCE_CIL_COMMENT;
58+}
59+
60+struct OptionsCIL {
61+ bool fold;
62+ bool foldComment;
63+ bool foldCommentMultiline;
64+ bool foldCompact;
65+
66+ OptionsCIL() {
67+ fold = true;
68+ foldComment = false;
69+ foldCommentMultiline = true;
70+ foldCompact = true;
71+ }
72+};
73+
74+static const char *const cilWordListDesc[] = {
75+ "Primary CIL keywords",
76+ "Metadata",
77+ "Opcode instructions",
78+ 0
79+};
80+
81+struct OptionSetCIL : public OptionSet<OptionsCIL> {
82+ OptionSetCIL() {
83+ DefineProperty("fold", &OptionsCIL::fold);
84+ DefineProperty("fold.comment", &OptionsCIL::foldComment);
85+
86+ DefineProperty("fold.cil.comment.multiline", &OptionsCIL::foldCommentMultiline,
87+ "Set this property to 0 to disable folding multi-line comments when fold.comment=1.");
88+
89+ DefineProperty("fold.compact", &OptionsCIL::foldCompact);
90+
91+ DefineWordListSets(cilWordListDesc);
92+ }
93+};
94+
95+LexicalClass lexicalClasses[] = {
96+ // Lexer CIL SCLEX_CIL SCE_CIL_:
97+ 0, "SCE_CIL_DEFAULT", "default", "White space",
98+ 1, "SCE_CIL_COMMENT", "comment", "Multi-line comment",
99+ 2, "SCE_CIL_COMMENTLINE", "comment line", "Line comment",
100+ 3, "SCE_CIL_WORD", "keyword", "Keyword 1",
101+ 4, "SCE_CIL_WORD2", "keyword", "Keyword 2",
102+ 5, "SCE_CIL_WORD3", "keyword", "Keyword 3",
103+ 6, "SCE_CIL_STRING", "literal string", "Double quoted string",
104+ 7, "SCE_CIL_LABEL", "label", "Code label",
105+ 8, "SCE_CIL_OPERATOR", "operator", "Operators",
106+ 9, "SCE_CIL_STRINGEOL", "error literal string", "String is not closed",
107+ 10, "SCE_CIL_IDENTIFIER", "identifier", "Identifiers",
108+};
109+
110+}
111+
112+class LexerCIL : public DefaultLexer {
113+ WordList keywords, keywords2, keywords3;
114+ OptionsCIL options;
115+ OptionSetCIL osCIL;
116+
117+public:
118+ LexerCIL() : DefaultLexer(lexicalClasses, ELEMENTS(lexicalClasses)) { }
119+
120+ virtual ~LexerCIL() { }
121+
122+ void SCI_METHOD Release() override {
123+ delete this;
124+ }
125+
126+ int SCI_METHOD Version() const override {
127+ return lvRelease4;
128+ }
129+
130+ const char * SCI_METHOD PropertyNames() override {
131+ return osCIL.PropertyNames();
132+ }
133+
134+ int SCI_METHOD PropertyType(const char *name) override {
135+ return osCIL.PropertyType(name);
136+ }
137+
138+ const char * SCI_METHOD DescribeProperty(const char *name) override {
139+ return osCIL.DescribeProperty(name);
140+ }
141+
142+ Sci_Position SCI_METHOD PropertySet(const char *key, const char *val) override;
143+
144+ const char * SCI_METHOD DescribeWordListSets() override {
145+ return osCIL.DescribeWordListSets();
146+ }
147+
148+ Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
149+
150+ void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
151+ void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
152+
153+ void * SCI_METHOD PrivateCall(int, void *) override {
154+ return 0;
155+ }
156+
157+ int SCI_METHOD LineEndTypesSupported() override {
158+ return SC_LINE_END_TYPE_UNICODE;
159+ }
160+
161+ int SCI_METHOD PrimaryStyleFromStyle(int style) override {
162+ return style;
163+ }
164+
165+ static ILexer4 *LexerFactoryCIL() {
166+ return new LexerCIL();
167+ }
168+};
169+
170+Sci_Position SCI_METHOD LexerCIL::PropertySet(const char *key, const char *val) {
171+ if (osCIL.PropertySet(&options, key, val)) {
172+ return 0;
173+ }
174+
175+ return -1;
176+}
177+
178+Sci_Position SCI_METHOD LexerCIL::WordListSet(int n, const char *wl) {
179+ WordList *wordListN = 0;
180+
181+ switch (n) {
182+ case 0:
183+ wordListN = &keywords;
184+ break;
185+ case 1:
186+ wordListN = &keywords2;
187+ break;
188+ case 2:
189+ wordListN = &keywords3;
190+ break;
191+ }
192+
193+ Sci_Position firstModification = -1;
194+
195+ if (wordListN) {
196+ WordList wlNew;
197+ wlNew.Set(wl);
198+
199+ if (*wordListN != wlNew) {
200+ wordListN->Set(wl);
201+ firstModification = 0;
202+ }
203+ }
204+
205+ return firstModification;
206+}
207+
208+void SCI_METHOD LexerCIL::Lex(Sci_PositionU startPos, Sci_Position length,
209+ int initStyle, IDocument *pAccess) {
210+ if (initStyle == SCE_CIL_STRINGEOL) {
211+ initStyle = SCE_CIL_DEFAULT;
212+ }
213+
214+ Accessor styler(pAccess, NULL);
215+ StyleContext sc(startPos, length, initStyle, styler);
216+
217+ bool identAtLineStart = false, // Checks if an identifier is at line start (ignoring spaces)
218+ canStyleLabels = false; // Checks if conditions are met to style SCE_CIL_LABEL
219+
220+ for (; sc.More(); sc.Forward()) {
221+ if (sc.atLineStart) {
222+ if (sc.state == SCE_CIL_STRING) {
223+ sc.SetState(SCE_CIL_STRING);
224+ }
225+
226+ identAtLineStart = true;
227+ }
228+
229+ // Handle string line continuation
230+ if (sc.ch == '\\' && (sc.chNext == '\n' || sc.chNext == '\r') &&
231+ (sc.state == SCE_CIL_STRING)) {
232+ sc.Forward();
233+
234+ if (sc.ch == '\r' && sc.chNext == '\n') {
235+ sc.Forward();
236+ }
237+
238+ continue;
239+ }
240+
241+ switch (sc.state) {
242+ case SCE_CIL_OPERATOR:
243+ sc.SetState(SCE_CIL_DEFAULT);
244+ break;
245+ case SCE_CIL_IDENTIFIER:
246+ if (!IsAWordChar(sc.ch)) {
247+ if (canStyleLabels && (sc.ch == ':' && sc.chNext != ':')) {
248+ sc.ChangeState(SCE_CIL_LABEL);
249+ sc.ForwardSetState(SCE_CIL_DEFAULT);
250+ } else {
251+ char kwSize[100];
252+ sc.GetCurrent(kwSize, sizeof(kwSize));
253+ int style = SCE_CIL_IDENTIFIER;
254+
255+ if (keywords.InList(kwSize)) {
256+ style = SCE_CIL_WORD;
257+ } else if (keywords2.InList(kwSize)) {
258+ style = SCE_CIL_WORD2;
259+ } else if (keywords3.InList(kwSize)) {
260+ style = SCE_CIL_WORD3;
261+ }
262+
263+ sc.ChangeState(style);
264+ sc.SetState(SCE_CIL_DEFAULT);
265+ }
266+ }
267+ break;
268+ case SCE_CIL_COMMENT:
269+ if (sc.Match('*', '/')) {
270+ sc.Forward();
271+ sc.ForwardSetState(SCE_CIL_DEFAULT);
272+ }
273+ break;
274+ case SCE_CIL_COMMENTLINE:
275+ if (sc.atLineStart) {
276+ sc.SetState(SCE_CIL_DEFAULT);
277+ }
278+ break;
279+ case SCE_CIL_STRING:
280+ if (sc.ch == '\\') {
281+ if (sc.chNext == '"' || sc.chNext == '\\') {
282+ sc.Forward();
283+ }
284+ } else if (sc.ch == '"') {
285+ sc.ForwardSetState(SCE_CIL_DEFAULT);
286+ } else if (sc.atLineEnd) {
287+ sc.ChangeState(SCE_CIL_STRINGEOL);
288+ sc.ForwardSetState(SCE_CIL_DEFAULT);
289+ }
290+ break;
291+ }
292+
293+ if (sc.state == SCE_CIL_DEFAULT) {
294+ // String
295+ if (sc.ch == '"') {
296+ sc.SetState(SCE_CIL_STRING);
297+ }
298+ // Keyword
299+ else if (IsAWordChar(sc.ch)) {
300+ // Allow setting SCE_CIL_LABEL style only if the label is the
301+ // first token in the line and does not start with a dot or a digit
302+ canStyleLabels = identAtLineStart && !(sc.ch == '.' || IsADigit(sc.ch));
303+ sc.SetState(SCE_CIL_IDENTIFIER);
304+ }
305+ // Multi-line comment
306+ else if (sc.Match('/', '*')) {
307+ sc.SetState(SCE_CIL_COMMENT);
308+ sc.Forward();
309+ }
310+ // Line comment
311+ else if (sc.Match('/', '/')) {
312+ sc.SetState(SCE_CIL_COMMENTLINE);
313+ }
314+ // Operators
315+ else if (IsOperator(sc.ch)) {
316+ sc.SetState(SCE_CIL_OPERATOR);
317+ }
318+ }
319+
320+ if (!IsASpace(sc.ch)) {
321+ identAtLineStart = false;
322+ }
323+ }
324+
325+ sc.Complete();
326+}
327+
328+void SCI_METHOD LexerCIL::Fold(Sci_PositionU startPos, Sci_Position length,
329+ int initStyle, IDocument *pAccess) {
330+ if (!options.fold) {
331+ return;
332+ }
333+
334+ LexAccessor styler(pAccess);
335+
336+ const Sci_PositionU endPos = startPos + length;
337+ Sci_Position lineCurrent = styler.GetLine(startPos);
338+
339+ int levelCurrent = SC_FOLDLEVELBASE;
340+ if (lineCurrent > 0)
341+ levelCurrent = styler.LevelAt(lineCurrent - 1) >> 16;
342+
343+ int style = initStyle;
344+ int styleNext = styler.StyleAt(startPos);
345+ int levelNext = levelCurrent;
346+ int visibleChars = 0;
347+
348+ char chNext = styler[startPos];
349+
350+ for (Sci_PositionU i = startPos; i < endPos; i++) {
351+ const char ch = chNext;
352+ int stylePrev = style;
353+
354+ chNext = styler.SafeGetCharAt(i + 1);
355+ style = styleNext;
356+ styleNext = styler.StyleAt(i + 1);
357+
358+ const bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
359+
360+ if (options.foldComment &&
361+ options.foldCommentMultiline && IsStreamCommentStyle(style)) {
362+ if (!IsStreamCommentStyle(stylePrev)) {
363+ levelNext++;
364+ } else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
365+ levelNext--;
366+ }
367+ }
368+
369+ if (style == SCE_CIL_OPERATOR) {
370+ if (ch == '{') {
371+ levelNext++;
372+ } else if (ch == '}') {
373+ levelNext--;
374+ }
375+ }
376+
377+ if (!IsASpace(ch)) {
378+ visibleChars++;
379+ }
380+
381+ if (atEOL || (i == endPos - 1)) {
382+ int lev = levelCurrent | levelNext << 16;
383+ if (visibleChars == 0 && options.foldCompact)
384+ lev |= SC_FOLDLEVELWHITEFLAG;
385+ if (levelCurrent < levelNext)
386+ lev |= SC_FOLDLEVELHEADERFLAG;
387+ if (lev != styler.LevelAt(lineCurrent)) {
388+ styler.SetLevel(lineCurrent, lev);
389+ }
390+
391+ lineCurrent++;
392+ levelCurrent = levelNext;
393+
394+ if (options.foldCompact &&
395+ i == static_cast<Sci_PositionU>(styler.Length() - 1)) {
396+ styler.SetLevel(lineCurrent, lev | SC_FOLDLEVELWHITEFLAG);
397+ }
398+
399+ visibleChars = 0;
400+ }
401+ }
402+}
403+
404+LexerModule lmCIL(SCLEX_CIL, LexerCIL::LexerFactoryCIL, "cil", cilWordListDesc);
\ No newline at end of file
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
--- branches/1.12.x/ext/scintilla/lexers/LexCPP.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/lexers/LexCPP.cxx (revision 28563)
@@ -950,7 +950,7 @@
950950 break;
951951 case SCE_C_PREPROCESSOR:
952952 if (options.stylingWithinPreprocessor) {
953- if (IsASpace(sc.ch)) {
953+ if (IsASpace(sc.ch) || (sc.ch == '(')) {
954954 sc.SetState(SCE_C_DEFAULT|activitySet);
955955 }
956956 } else if (isStringInPreprocessor && (sc.Match('>') || sc.Match('\"') || sc.atLineEnd)) {
--- branches/1.12.x/ext/scintilla/lexers/LexNim.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/lexers/LexNim.cxx (revision 28563)
@@ -55,6 +55,11 @@
5555 return SCE_NIM_NUMBER;
5656 }
5757
58+bool IsLetter(const int ch) {
59+ // 97 to 122 || 65 to 90
60+ return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
61+}
62+
5863 bool IsAWordChar(const int ch) {
5964 return ch < 0x80 && (isalnum(ch) || ch == '_' || ch == '.');
6065 }
@@ -75,6 +80,26 @@
7580 return (ch == '\n' || ch == '\r');
7681 }
7782
83+bool IsFuncName(const char *str) {
84+ const char *identifiers[] = {
85+ "proc",
86+ "func",
87+ "macro",
88+ "method",
89+ "template",
90+ "iterator",
91+ "converter"
92+ };
93+
94+ for (const char *id : identifiers) {
95+ if (strcmp(str, id) == 0) {
96+ return true;
97+ }
98+ }
99+
100+ return false;
101+}
102+
78103 constexpr bool IsTripleLiteral(const int style) noexcept {
79104 return style == SCE_NIM_TRIPLE || style == SCE_NIM_TRIPLEDOUBLE;
80105 }
@@ -99,10 +124,8 @@
99124 bool inPrevPrefix = line > 0;
100125 Sci_Position posPrev = inPrevPrefix ? styler.LineStart(line - 1) : 0;
101126
102- // No fold points inside block comments and triple literals
103- while ((IsASpaceOrTab(ch)
104- || IsStreamComment(style)
105- || IsTripleLiteral(style)) && (startPos < eolPos)) {
127+ // No fold points inside triple literals
128+ while ((IsASpaceOrTab(ch) || IsTripleLiteral(style)) && (startPos < eolPos)) {
106129 if (inPrevPrefix) {
107130 char chPrev = styler[posPrev++];
108131 if (chPrev != ' ' && chPrev != '\t') {
@@ -121,11 +144,14 @@
121144 style = styler.StyleAt(startPos);
122145 }
123146
124- indent += SC_FOLDLEVELBASE;
147+ // Prevent creating fold lines for comments if indented
148+ if (!(IsStreamComment(style) || IsLineComment(style)))
149+ indent += SC_FOLDLEVELBASE;
125150
126151 if (styler.LineStart(line) == styler.Length()
127152 || IsASpaceOrTab(ch)
128153 || IsNewline(ch)
154+ || IsStreamComment(style)
129155 || IsLineComment(style)) {
130156 return indent | SC_FOLDLEVELWHITEFLAG;
131157 } else {
@@ -142,10 +168,12 @@
142168 struct OptionsNim {
143169 bool fold;
144170 bool foldCompact;
171+ bool highlightRawStrIdent;
145172
146173 OptionsNim() {
147174 fold = true;
148175 foldCompact = true;
176+ highlightRawStrIdent = false;
149177 }
150178 };
151179
@@ -156,6 +184,10 @@
156184
157185 struct OptionSetNim : public OptionSet<OptionsNim> {
158186 OptionSetNim() {
187+ DefineProperty("lexer.nim.raw.strings.highlight.ident", &OptionsNim::highlightRawStrIdent,
188+ "Set to 1 to enable highlighting generalized raw string identifiers. "
189+ "Generalized raw string identifiers are anything other than r (or R).");
190+
159191 DefineProperty("fold", &OptionsNim::fold);
160192 DefineProperty("fold.compact", &OptionsNim::foldCompact);
161193
@@ -298,6 +330,7 @@
298330
299331 bool funcNameExists = false;
300332 bool isStylingRawString = false;
333+ bool isStylingRawStringIdent = false;
301334
302335 for (; sc.More(); sc.Forward()) {
303336 if (sc.atLineStart) {
@@ -402,13 +435,17 @@
402435 sc.SetState(SCE_NIM_DEFAULT);
403436 break;
404437 case SCE_NIM_IDENTIFIER:
405- if (!IsAWordChar(sc.ch)) {
438+ if (sc.ch == '.' || !IsAWordChar(sc.ch)) {
406439 char s[100];
407440 sc.GetCurrent(s, sizeof(s));
408441 int style = SCE_NIM_IDENTIFIER;
409442
410443 if (keywords.InList(s) && !funcNameExists) {
411- style = SCE_NIM_WORD;
444+ // Prevent styling keywords if they are sub-identifiers
445+ Sci_Position segStart = styler.GetStartSegment() - 1;
446+ if (segStart < 0 || styler.SafeGetCharAt(segStart, '\0') != '.') {
447+ style = SCE_NIM_WORD;
448+ }
412449 } else if (funcNameExists) {
413450 style = SCE_NIM_FUNCNAME;
414451 }
@@ -417,22 +454,39 @@
417454 sc.SetState(SCE_NIM_DEFAULT);
418455
419456 if (style == SCE_NIM_WORD) {
420- if (0 == strcmp(s, "proc")
421- || 0 == strcmp(s, "func")
422- || 0 == strcmp(s, "macro")
423- || 0 == strcmp(s, "method")
424- || 0 == strcmp(s, "template")
425- || 0 == strcmp(s, "iterator")
426- || 0 == strcmp(s, "converter")) {
427- funcNameExists = true;
428- } else {
429- funcNameExists = false;
430- }
457+ funcNameExists = IsFuncName(s);
431458 } else {
432459 funcNameExists = false;
433460 }
434461 }
462+
463+ if (IsAlphaNumeric(sc.ch) && sc.chNext == '\"') {
464+ isStylingRawStringIdent = true;
465+
466+ if (options.highlightRawStrIdent) {
467+ if (styler.SafeGetCharAt(sc.currentPos + 2) == '\"' &&
468+ styler.SafeGetCharAt(sc.currentPos + 3) == '\"') {
469+ sc.ChangeState(SCE_NIM_TRIPLEDOUBLE);
470+ } else {
471+ sc.ChangeState(SCE_NIM_STRING);
472+ }
473+ }
474+
475+ sc.ForwardSetState(SCE_NIM_DEFAULT);
476+ }
435477 break;
478+ case SCE_NIM_FUNCNAME:
479+ if (sc.ch == '`') {
480+ funcNameExists = false;
481+ sc.ForwardSetState(SCE_NIM_DEFAULT);
482+ } else if (sc.atLineEnd) {
483+ // Prevent leaking the style to the next line if not closed
484+ funcNameExists = false;
485+
486+ sc.ChangeState(SCE_NIM_STRINGEOL);
487+ sc.ForwardSetState(SCE_NIM_DEFAULT);
488+ }
489+ break;
436490 case SCE_NIM_COMMENT:
437491 if (sc.Match(']', '#')) {
438492 if (commentNestLevel > 0) {
@@ -478,10 +532,14 @@
478532 }
479533 break;
480534 case SCE_NIM_STRING:
481- if (sc.ch == '\\' && !isStylingRawString) {
535+ if (!isStylingRawStringIdent && !isStylingRawString && sc.ch == '\\') {
482536 if (sc.chNext == '\"' || sc.chNext == '\'' || sc.chNext == '\\') {
483537 sc.Forward();
484538 }
539+ } else if (isStylingRawString && sc.ch == '\"' && sc.chNext == '\"') {
540+ // Forward in situations such as r"a""bc\" so that "bc\" wouldn't be
541+ // considered a string of its own
542+ sc.Forward();
485543 } else if (sc.ch == '\"') {
486544 sc.ForwardSetState(SCE_NIM_DEFAULT);
487545 } else if (sc.atLineEnd) {
@@ -502,14 +560,26 @@
502560 }
503561 break;
504562 case SCE_NIM_BACKTICKS:
505- if (sc.ch == '`' || sc.atLineEnd) {
563+ if (sc.ch == '`' ) {
506564 sc.ForwardSetState(SCE_NIM_DEFAULT);
565+ } else if (sc.atLineEnd) {
566+ sc.ChangeState(SCE_NIM_STRINGEOL);
567+ sc.ForwardSetState(SCE_NIM_DEFAULT);
507568 }
508569 break;
509570 case SCE_NIM_TRIPLEDOUBLE:
510571 if (sc.Match(R"(""")")) {
511- sc.Forward(2);
512- sc.ForwardSetState(SCE_NIM_DEFAULT);
572+
573+ // Outright forward all " after the closing """ as a triple double
574+ //
575+ // A valid example where this is needed is: """8 double quotes->""""""""
576+ // You can have as many """ at the end as you wish, as long as the actual
577+ // closing literal is there
578+ while (sc.ch == '"') {
579+ sc.Forward();
580+ }
581+
582+ sc.SetState(SCE_NIM_DEFAULT);
513583 }
514584 break;
515585 case SCE_NIM_TRIPLE:
@@ -543,11 +613,31 @@
543613 }
544614 }
545615 // Raw string
546- else if ((sc.ch == 'r' || sc.ch == 'R') && sc.chNext == '\"') {
616+ else if (IsAlphaNumeric(sc.ch) && sc.chNext == '\"') {
547617 isStylingRawString = true;
548618
549- sc.SetState(SCE_NIM_STRING);
550- sc.Forward();
619+ // Triple doubles can be raw strings too. How sweet
620+ if (styler.SafeGetCharAt(sc.currentPos + 2) == '\"' &&
621+ styler.SafeGetCharAt(sc.currentPos + 3) == '\"') {
622+ sc.SetState(SCE_NIM_TRIPLEDOUBLE);
623+ } else {
624+ sc.SetState(SCE_NIM_STRING);
625+ }
626+
627+ int rawStrStyle = options.highlightRawStrIdent ? IsLetter(sc.ch) :
628+ (sc.ch == 'r' || sc.ch == 'R');
629+
630+ if (rawStrStyle) {
631+ sc.Forward();
632+
633+ if (sc.state == SCE_NIM_TRIPLEDOUBLE) {
634+ sc.Forward(2);
635+ }
636+ } else {
637+ // Anything other than r/R is considered a general raw string identifier
638+ isStylingRawStringIdent = true;
639+ sc.SetState(SCE_NIM_IDENTIFIER);
640+ }
551641 }
552642 // String and triple double literal
553643 else if (sc.ch == '\"') {
@@ -555,6 +645,17 @@
555645
556646 if (sc.Match(R"(""")")) {
557647 sc.SetState(SCE_NIM_TRIPLEDOUBLE);
648+
649+ // Keep forwarding until the total opening literal count is 5
650+ // A valid example where this is needed is: """""<-5 double quotes"""
651+ while (sc.ch == '"') {
652+ sc.Forward();
653+
654+ if (sc.Match(R"(""")")) {
655+ sc.Forward();
656+ break;
657+ }
658+ }
558659 } else {
559660 sc.SetState(SCE_NIM_STRING);
560661 }
@@ -569,10 +670,10 @@
569670 }
570671 // Operator definition
571672 else if (sc.ch == '`') {
572- sc.SetState(SCE_NIM_BACKTICKS);
573-
574673 if (funcNameExists) {
575- funcNameExists = false;
674+ sc.SetState(SCE_NIM_FUNCNAME);
675+ } else {
676+ sc.SetState(SCE_NIM_BACKTICKS);
576677 }
577678 }
578679 // Keyword
@@ -616,6 +717,8 @@
616717
617718 if (sc.atLineEnd) {
618719 funcNameExists = false;
720+ isStylingRawString = false;
721+ isStylingRawStringIdent = false;
619722 }
620723 }
621724
@@ -708,4 +811,4 @@
708811 }
709812 }
710813
711-LexerModule lmNim(SCLEX_NIM, LexerNim::LexerFactoryNim, "nim", nimWordListDesc);
814+LexerModule lmNim(SCLEX_NIM, LexerNim::LexerFactoryNim, "nim", nimWordListDesc);
\ No newline at end of file
--- branches/1.12.x/ext/scintilla/lexers/LexTCL.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/lexers/LexTCL.cxx (revision 28563)
@@ -128,8 +128,10 @@
128128 continue;
129129 case ',':
130130 sc.SetState(SCE_TCL_OPERATOR);
131- if (subParen)
131+ if (subParen) {
132132 sc.ForwardSetState(SCE_TCL_SUBSTITUTION);
133+ goto next; // Already forwarded so avoid loop's Forward()
134+ }
133135 continue;
134136 default :
135137 // maybe spaces should be allowed ???
--- branches/1.12.x/ext/scintilla/lexlib/StyleContext.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/lexlib/StyleContext.cxx (revision 28563)
@@ -7,7 +7,6 @@
77
88 #include <cstdlib>
99 #include <cassert>
10-#include <cctype>
1110
1211 #include "ILexer.h"
1312
--- branches/1.12.x/ext/scintilla/src/CaseFolder.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/CaseFolder.cxx (revision 28563)
@@ -41,7 +41,7 @@
4141 mapping[static_cast<unsigned char>(ch)] = chTranslation;
4242 }
4343
44-void CaseFolderTable::StandardASCII() {
44+void CaseFolderTable::StandardASCII() noexcept {
4545 for (size_t iChar=0; iChar<sizeof(mapping); iChar++) {
4646 if (iChar >= 'A' && iChar <= 'Z') {
4747 mapping[iChar] = static_cast<char>(iChar - 'A' + 'a');
--- branches/1.12.x/ext/scintilla/src/CaseFolder.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/CaseFolder.h (revision 28563)
@@ -24,7 +24,7 @@
2424 ~CaseFolderTable() override;
2525 size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override;
2626 void SetTranslation(char ch, char chTranslation);
27- void StandardASCII();
27+ void StandardASCII() noexcept;
2828 };
2929
3030 class ICaseConverter;
--- branches/1.12.x/ext/scintilla/src/Catalogue.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/Catalogue.cxx (revision 28563)
@@ -90,6 +90,7 @@
9090 LINK_LEXER(lmBlitzBasic);
9191 LINK_LEXER(lmBullant);
9292 LINK_LEXER(lmCaml);
93+ LINK_LEXER(lmCIL);
9394 LINK_LEXER(lmClw);
9495 LINK_LEXER(lmClwNoCase);
9596 LINK_LEXER(lmCmake);
--- branches/1.12.x/ext/scintilla/src/CharClassify.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/CharClassify.cxx (revision 28563)
@@ -6,10 +6,11 @@
66 // The License.txt file describes the conditions under which this software may be distributed.
77
88 #include <cstdlib>
9-#include <cctype>
9+#include <cassert>
1010
1111 #include <stdexcept>
1212
13+#include "CharacterSet.h"
1314 #include "CharClassify.h"
1415
1516 using namespace Scintilla;
@@ -25,7 +26,7 @@
2526 charClass[ch] = ccNewLine;
2627 else if (ch < 0x20 || ch == ' ')
2728 charClass[ch] = ccSpace;
28- else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_'))
29+ else if (includeWordClass && (ch >= 0x80 || IsAlphaNumeric(ch) || ch == '_'))
2930 charClass[ch] = ccWord;
3031 else
3132 charClass[ch] = ccPunctuation;
--- branches/1.12.x/ext/scintilla/src/Document.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/Document.cxx (revision 28563)
@@ -473,7 +473,7 @@
473473 Levels()->ClearLevels();
474474 }
475475
476-static bool IsSubordinate(int levelStart, int levelTry) {
476+static bool IsSubordinate(int levelStart, int levelTry) noexcept {
477477 if (levelTry & SC_FOLDLEVELWHITEFLAG)
478478 return true;
479479 else
@@ -1089,7 +1089,7 @@
10891089 }
10901090 }
10911091
1092-static inline bool IsSpaceOrTab(int ch) noexcept {
1092+static constexpr bool IsSpaceOrTab(int ch) noexcept {
10931093 return ch == ' ' || ch == '\t';
10941094 }
10951095
@@ -1435,7 +1435,7 @@
14351435 }
14361436 }
14371437
1438-static Sci::Position NextTab(Sci::Position pos, Sci::Position tabSize) noexcept {
1438+static constexpr Sci::Position NextTab(Sci::Position pos, Sci::Position tabSize) noexcept {
14391439 return ((pos / tabSize) + 1) * tabSize;
14401440 }
14411441
@@ -2551,7 +2551,7 @@
25512551 return pos;
25522552 }
25532553
2554-static bool IsLineEndChar(char c) noexcept {
2554+static constexpr bool IsLineEndChar(char c) noexcept {
25552555 return (c == '\n' || c == '\r');
25562556 }
25572557
--- branches/1.12.x/ext/scintilla/src/Document.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/Document.h (revision 28563)
@@ -126,11 +126,11 @@
126126
127127 class HighlightDelimiter {
128128 public:
129- HighlightDelimiter() : isEnabled(false) {
129+ HighlightDelimiter() noexcept : isEnabled(false) {
130130 Clear();
131131 }
132132
133- void Clear() {
133+ void Clear() noexcept {
134134 beginFoldBlock = -1;
135135 endFoldBlock = -1;
136136 firstChangeableLineBefore = -1;
@@ -164,7 +164,7 @@
164164 bool isEnabled;
165165 };
166166
167-inline int LevelNumber(int level) noexcept {
167+constexpr int LevelNumber(int level) noexcept {
168168 return level & SC_FOLDLEVELNUMBERMASK;
169169 }
170170
@@ -174,13 +174,13 @@
174174 ILexer4 *instance;
175175 bool performingStyle; ///< Prevent reentrance
176176 public:
177- explicit LexInterface(Document *pdoc_) : pdoc(pdoc_), instance(nullptr), performingStyle(false) {
177+ explicit LexInterface(Document *pdoc_) noexcept : pdoc(pdoc_), instance(nullptr), performingStyle(false) {
178178 }
179179 virtual ~LexInterface() {
180180 }
181181 void Colourise(Sci::Position start, Sci::Position end);
182182 virtual int LineEndTypesSupported();
183- bool UseContainerLexing() const {
183+ bool UseContainerLexing() const noexcept {
184184 return instance == nullptr;
185185 }
186186 };
@@ -507,6 +507,11 @@
507507 pdoc->BeginUndoAction();
508508 }
509509 }
510+ // Deleted so UndoGroup objects can not be copied.
511+ UndoGroup(const UndoGroup &) = delete;
512+ UndoGroup(UndoGroup &&) = delete;
513+ void operator=(const UndoGroup &) = delete;
514+ UndoGroup &operator=(UndoGroup &&) = delete;
510515 ~UndoGroup() {
511516 if (groupNeeded) {
512517 pdoc->EndUndoAction();
@@ -573,7 +578,7 @@
573578 virtual void NotifyModifyAttempt(Document *doc, void *userData) = 0;
574579 virtual void NotifySavePoint(Document *doc, void *userData, bool atSavePoint) = 0;
575580 virtual void NotifyModified(Document *doc, DocModification mh, void *userData) = 0;
576- virtual void NotifyDeleted(Document *doc, void *userData) = 0;
581+ virtual void NotifyDeleted(Document *doc, void *userData) noexcept = 0;
577582 virtual void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endPos) = 0;
578583 virtual void NotifyLexerChanged(Document *doc, void *userData) = 0;
579584 virtual void NotifyErrorOccurred(Document *doc, void *userData, int status) = 0;
--- branches/1.12.x/ext/scintilla/src/EditModel.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/EditModel.h (revision 28563)
@@ -62,7 +62,7 @@
6262 virtual Sci::Line TopLineOfMain() const = 0;
6363 virtual Point GetVisibleOriginInMain() const = 0;
6464 virtual Sci::Line LinesOnScreen() const = 0;
65- virtual Range GetHotSpotRange() const = 0;
65+ virtual Range GetHotSpotRange() const noexcept = 0;
6666 bool BidirectionalEnabled() const;
6767 bool BidirectionalR2L() const;
6868 };
--- branches/1.12.x/ext/scintilla/src/EditView.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/EditView.cxx (revision 28563)
@@ -9,7 +9,6 @@
99 #include <cstdlib>
1010 #include <cassert>
1111 #include <cstring>
12-#include <cctype>
1312 #include <cstdio>
1413 #include <cmath>
1514
@@ -65,7 +64,7 @@
6564 return ch >= 0 && ch < ' ';
6665 }
6766
68-PrintParameters::PrintParameters() {
67+PrintParameters::PrintParameters() noexcept {
6968 magnification = 0;
7069 colourMode = SC_PRINT_NORMAL;
7170 wrapState = eWrapWord;
@@ -195,7 +194,7 @@
195194 EditView::~EditView() {
196195 }
197196
198-bool EditView::SetTwoPhaseDraw(bool twoPhaseDraw) {
197+bool EditView::SetTwoPhaseDraw(bool twoPhaseDraw) noexcept {
199198 const PhasesDraw phasesDrawNew = twoPhaseDraw ? phasesTwo : phasesOne;
200199 const bool redraw = phasesDraw != phasesDrawNew;
201200 phasesDraw = phasesDrawNew;
@@ -202,7 +201,7 @@
202201 return redraw;
203202 }
204203
205-bool EditView::SetPhasesDraw(int phases) {
204+bool EditView::SetPhasesDraw(int phases) noexcept {
206205 const PhasesDraw phasesDrawNew = static_cast<PhasesDraw>(phases);
207206 const bool redraw = phasesDraw != phasesDrawNew;
208207 phasesDraw = phasesDrawNew;
@@ -209,11 +208,11 @@
209208 return redraw;
210209 }
211210
212-bool EditView::LinesOverlap() const {
211+bool EditView::LinesOverlap() const noexcept {
213212 return phasesDraw == phasesMultiple;
214213 }
215214
216-void EditView::ClearAllTabstops() {
215+void EditView::ClearAllTabstops() noexcept {
217216 ldTabstops.reset();
218217 }
219218
@@ -281,7 +280,7 @@
281280 pixmapIndentGuideHighlight.reset(Surface::Allocate(vsDraw.technology));
282281 }
283282
284-static const char *ControlCharacterString(unsigned char ch) {
283+static const char *ControlCharacterString(unsigned char ch) noexcept {
285284 const char * const reps[] = {
286285 "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
287286 "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
@@ -828,7 +827,7 @@
828827 return posRet;
829828 }
830829
831-static ColourDesired SelectionBackground(const ViewStyle &vsDraw, bool main, bool primarySelection) {
830+static ColourDesired SelectionBackground(const ViewStyle &vsDraw, bool main, bool primarySelection) noexcept {
832831 return main ?
833832 (primarySelection ? vsDraw.selColours.back : vsDraw.selBackground2) :
834833 vsDraw.selAdditionalBackground;
@@ -1424,7 +1423,7 @@
14241423 for (size_t r = 0; (r<model.sel.Count()) || drawDrag; r++) {
14251424 const bool mainCaret = r == model.sel.Main();
14261425 SelectionPosition posCaret = (drawDrag ? model.posDrag : model.sel.Range(r).caret);
1427- if (vsDraw.caretStyle == CARETSTYLE_BLOCK && !drawDrag && posCaret > model.sel.Range(r).anchor) {
1426+ if ((vsDraw.IsBlockCaretStyle() || imeCaretBlockOverride) && !drawDrag && posCaret > model.sel.Range(r).anchor) {
14281427 if (posCaret.VirtualSpace() > 0)
14291428 posCaret.SetVirtualSpace(posCaret.VirtualSpace() - 1);
14301429 else
@@ -1455,7 +1454,7 @@
14551454 const bool caretBlinkState = (model.caret.active && model.caret.on) || (!additionalCaretsBlink && !mainCaret);
14561455 const bool caretVisibleState = additionalCaretsVisible || mainCaret;
14571456 if ((xposCaret >= 0) && (vsDraw.caretWidth > 0) && (vsDraw.caretStyle != CARETSTYLE_INVISIBLE) &&
1458- ((model.posDrag.IsValid()) || (caretBlinkState && caretVisibleState))) {
1457+ (drawDrag || (caretBlinkState && caretVisibleState))) {
14591458 bool caretAtEOF = false;
14601459 bool caretAtEOL = false;
14611460 bool drawBlockCaret = false;
@@ -1479,16 +1478,17 @@
14791478 if (xposCaret > 0)
14801479 caretWidthOffset = 0.51f; // Move back so overlaps both character cells.
14811480 xposCaret += xStart;
1482- if (model.posDrag.IsValid()) {
1481+ const ViewStyle::CaretShape caretShape = drawDrag ? ViewStyle::CaretShape::line : vsDraw.CaretShapeForMode(model.inOverstrike);
1482+ if (drawDrag) {
14831483 /* Dragging text, use a line caret */
14841484 rcCaret.left = round(xposCaret - caretWidthOffset);
14851485 rcCaret.right = rcCaret.left + vsDraw.caretWidth;
1486- } else if (model.inOverstrike && drawOverstrikeCaret) {
1486+ } else if ((caretShape == ViewStyle::CaretShape::bar) && drawOverstrikeCaret) {
14871487 /* Overstrike (insert mode), use a modified bar caret */
14881488 rcCaret.top = rcCaret.bottom - 2;
14891489 rcCaret.left = xposCaret + 1;
14901490 rcCaret.right = rcCaret.left + widthOverstrikeCaret - 1;
1491- } else if ((vsDraw.caretStyle == CARETSTYLE_BLOCK) || imeCaretBlockOverride) {
1491+ } else if ((caretShape == ViewStyle::CaretShape::block) || imeCaretBlockOverride) {
14921492 /* Block caret */
14931493 rcCaret.left = xposCaret;
14941494 if (!caretAtEOL && !caretAtEOF && (ll->chars[offset] != '\t') && !(IsControlCharacter(ll->chars[offset]))) {
@@ -2347,7 +2347,7 @@
23472347 // Space (3 space characters) between line numbers and text when printing.
23482348 #define lineNumberPrintSpace " "
23492349
2350-static ColourDesired InvertedLight(ColourDesired orig) {
2350+static ColourDesired InvertedLight(ColourDesired orig) noexcept {
23512351 unsigned int r = orig.GetRed();
23522352 unsigned int g = orig.GetGreen();
23532353 unsigned int b = orig.GetBlue();
--- branches/1.12.x/ext/scintilla/src/EditView.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/EditView.h (revision 28563)
@@ -14,7 +14,7 @@
1414 int magnification;
1515 int colourMode;
1616 WrapMode wrapState;
17- PrintParameters();
17+ PrintParameters() noexcept;
1818 };
1919
2020 /**
@@ -54,7 +54,7 @@
5454 int tabWidthMinimumPixels;
5555
5656 bool hideSelection;
57- bool drawOverstrikeCaret;
57+ bool drawOverstrikeCaret; // used by the curses platform
5858
5959 /** In bufferedDraw mode, graphics operations are drawn to a pixmap and then copied to
6060 * the screen. This avoids flashing but is about 30% slower. */
@@ -98,11 +98,11 @@
9898 void operator=(EditView &&) = delete;
9999 virtual ~EditView();
100100
101- bool SetTwoPhaseDraw(bool twoPhaseDraw);
102- bool SetPhasesDraw(int phases);
103- bool LinesOverlap() const;
101+ bool SetTwoPhaseDraw(bool twoPhaseDraw) noexcept;
102+ bool SetPhasesDraw(int phases) noexcept;
103+ bool LinesOverlap() const noexcept;
104104
105- void ClearAllTabstops();
105+ void ClearAllTabstops() noexcept;
106106 XYPOSITION NextTabstopPos(Sci::Line line, XYPOSITION x, XYPOSITION tabWidth) const;
107107 bool ClearTabstops(Sci::Line line);
108108 bool AddTabstop(Sci::Line line, int x);
@@ -168,7 +168,7 @@
168168 AutoLineLayout(AutoLineLayout &&) = delete;
169169 AutoLineLayout &operator=(const AutoLineLayout &) = delete;
170170 AutoLineLayout &operator=(AutoLineLayout &&) = delete;
171- ~AutoLineLayout() {
171+ ~AutoLineLayout() noexcept {
172172 llc.Dispose(ll);
173173 ll = nullptr;
174174 }
@@ -178,7 +178,7 @@
178178 operator LineLayout *() const noexcept {
179179 return ll;
180180 }
181- void Set(LineLayout *ll_) {
181+ void Set(LineLayout *ll_) noexcept {
182182 llc.Dispose(ll);
183183 ll = ll_;
184184 }
--- branches/1.12.x/ext/scintilla/src/Editor.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/Editor.cxx (revision 28563)
@@ -9,7 +9,6 @@
99 #include <cstdlib>
1010 #include <cassert>
1111 #include <cstring>
12-#include <cctype>
1312 #include <cstdio>
1413 #include <cmath>
1514
@@ -59,11 +58,13 @@
5958
6059 using namespace Scintilla;
6160
61+namespace {
62+
6263 /*
6364 return whether this modification represents an operation that
6465 may reasonably be deferred (not done now OR [possibly] at all)
6566 */
66-static bool CanDeferToLastStep(const DocModification &mh) {
67+constexpr bool CanDeferToLastStep(const DocModification &mh) noexcept {
6768 if (mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE))
6869 return true; // CAN skip
6970 if (!(mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)))
@@ -73,7 +74,7 @@
7374 return false; // PRESUMABLY must do
7475 }
7576
76-static bool CanEliminate(const DocModification &mh) {
77+constexpr bool CanEliminate(const DocModification &mh) noexcept {
7778 return
7879 (mh.modificationType & (SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE)) != 0;
7980 }
@@ -82,7 +83,7 @@
8283 return whether this modification represents the FINAL step
8384 in a [possibly lengthy] multi-step Undo/Redo sequence
8485 */
85-static bool IsLastStep(const DocModification &mh) {
86+constexpr bool IsLastStep(const DocModification &mh) noexcept {
8687 return
8788 (mh.modificationType & (SC_PERFORMED_UNDO | SC_PERFORMED_REDO)) != 0
8889 && (mh.modificationType & SC_MULTISTEPUNDOREDO) != 0
@@ -90,13 +91,15 @@
9091 && (mh.modificationType & SC_MULTILINEUNDOREDO) != 0;
9192 }
9293
93-Timer::Timer() :
94+}
95+
96+Timer::Timer() noexcept :
9497 ticking(false), ticksToWait(0), tickerID{} {}
9598
96-Idler::Idler() :
99+Idler::Idler() noexcept :
97100 state(false), idlerID(0) {}
98101
99-static inline bool IsAllSpacesOrTabs(const char *s, unsigned int len) {
102+static constexpr bool IsAllSpacesOrTabs(const char *s, unsigned int len) noexcept {
100103 for (unsigned int i = 0; i < len; i++) {
101104 // This is safe because IsSpaceOrTab() will return false for null terminators
102105 if (!IsSpaceOrTab(s[i]))
@@ -1007,6 +1010,10 @@
10071010
10081011 void Editor::MoveSelectedLines(int lineDelta) {
10091012
1013+ if (sel.IsRectangular()) {
1014+ return;
1015+ }
1016+
10101017 // if selection doesn't start at the beginning of the line, set the new start
10111018 Sci::Position selectionStart = SelectionStart().Position();
10121019 const Sci::Line startLine = pdoc->SciLineFromPosition(selectionStart);
@@ -1046,7 +1053,6 @@
10461053 SelectionText selectedText;
10471054 CopySelectionRange(&selectedText);
10481055
1049- Sci::Position selectionLength = SelectionRange(selectionStart, selectionEnd).Length();
10501056 const Point currentLocation = LocationFromPosition(CurrentPosition());
10511057 const Sci::Line currentLine = LineFromLocation(currentLocation);
10521058
@@ -1059,7 +1065,7 @@
10591065 pdoc->InsertString(pdoc->Length(), eol, strlen(eol));
10601066 GoToLine(currentLine + lineDelta);
10611067
1062- selectionLength = pdoc->InsertString(CurrentPosition(), selectedText.Data(), selectionLength);
1068+ Sci::Position selectionLength = pdoc->InsertString(CurrentPosition(), selectedText.Data(), selectedText.Length());
10631069 if (appendEol) {
10641070 const Sci::Position lengthInserted = pdoc->InsertString(CurrentPosition() + selectionLength, eol, strlen(eol));
10651071 selectionLength += lengthInserted;
@@ -1356,7 +1362,7 @@
13561362 newXY.xOffset = static_cast<int>(pt.x + xOffset - rcClient.left) - 2;
13571363 } else if (pt.x + xOffset >= rcClient.right + newXY.xOffset) {
13581364 newXY.xOffset = static_cast<int>(pt.x + xOffset - rcClient.right) + 2;
1359- if ((vs.caretStyle == CARETSTYLE_BLOCK) || view.imeCaretBlockOverride) {
1365+ if (vs.IsBlockCaretStyle() || view.imeCaretBlockOverride) {
13601366 // Ensure we can see a good portion of the block caret
13611367 newXY.xOffset += static_cast<int>(vs.aveCharWidth);
13621368 }
@@ -1466,7 +1472,7 @@
14661472 void Editor::UpdateSystemCaret() {
14671473 }
14681474
1469-bool Editor::Wrapping() const {
1475+bool Editor::Wrapping() const noexcept {
14701476 return vs.wrapState != eWrapNone;
14711477 }
14721478
@@ -1615,7 +1621,7 @@
16151621 }
16161622 }
16171623
1618-const char *Editor::StringFromEOLMode(int eolMode) {
1624+const char *Editor::StringFromEOLMode(int eolMode) noexcept {
16191625 if (eolMode == SC_EOL_CRLF) {
16201626 return "\r\n";
16211627 } else if (eolMode == SC_EOL_CR) {
@@ -2522,8 +2528,10 @@
25222528 }
25232529 }
25242530
2531+namespace {
2532+
25252533 // Move a position so it is still after the same character as before the insertion.
2526-static inline Sci::Position MovePositionForInsertion(Sci::Position position, Sci::Position startInsertion, Sci::Position length) {
2534+constexpr Sci::Position MovePositionForInsertion(Sci::Position position, Sci::Position startInsertion, Sci::Position length) noexcept {
25272535 if (position > startInsertion) {
25282536 return position + length;
25292537 }
@@ -2532,7 +2540,7 @@
25322540
25332541 // Move a position so it is still after the same character as before the deletion if that
25342542 // character is still present else after the previous surviving character.
2535-static inline Sci::Position MovePositionForDeletion(Sci::Position position, Sci::Position startDeletion, Sci::Position length) {
2543+constexpr Sci::Position MovePositionForDeletion(Sci::Position position, Sci::Position startDeletion, Sci::Position length) noexcept {
25362544 if (position > startDeletion) {
25372545 const Sci::Position endDeletion = startDeletion + length;
25382546 if (position > endDeletion) {
@@ -2545,6 +2553,8 @@
25452553 }
25462554 }
25472555
2556+}
2557+
25482558 void Editor::NotifyModified(Document *, DocModification mh, void *) {
25492559 ContainerNeedsUpdate(SC_UPDATE_CONTENT);
25502560 if (paintState == painting) {
@@ -2713,7 +2723,7 @@
27132723 }
27142724 }
27152725
2716-void Editor::NotifyDeleted(Document *, void *) {
2726+void Editor::NotifyDeleted(Document *, void *) noexcept {
27172727 /* Do nothing */
27182728 }
27192729
@@ -2849,7 +2859,7 @@
28492859 }
28502860
28512861 // Something has changed that the container should know about
2852-void Editor::ContainerNeedsUpdate(int flags) {
2862+void Editor::ContainerNeedsUpdate(int flags) noexcept {
28532863 needUpdateUI |= flags;
28542864 }
28552865
@@ -3233,7 +3243,7 @@
32333243 return static_cast<short>(x & 0xffff);
32343244 }
32353245
3236-unsigned int WithExtends(unsigned int iMessage) {
3246+constexpr unsigned int WithExtends(unsigned int iMessage) noexcept {
32373247 switch (iMessage) {
32383248 case SCI_CHARLEFT: return SCI_CHARLEFTEXTEND;
32393249 case SCI_CHARRIGHT: return SCI_CHARRIGHTEXTEND;
@@ -3260,7 +3270,7 @@
32603270 }
32613271 }
32623272
3263-int NaturalDirection(unsigned int iMessage) {
3273+constexpr int NaturalDirection(unsigned int iMessage) noexcept {
32643274 switch (iMessage) {
32653275 case SCI_CHARLEFT:
32663276 case SCI_CHARLEFTEXTEND:
@@ -3291,7 +3301,7 @@
32913301 }
32923302 }
32933303
3294-bool IsRectExtend(unsigned int iMessage, bool isRectMoveExtends) {
3304+constexpr bool IsRectExtend(unsigned int iMessage, bool isRectMoveExtends) noexcept {
32953305 switch (iMessage) {
32963306 case SCI_CHARLEFTRECTEXTEND:
32973307 case SCI_CHARRIGHTRECTEXTEND:
@@ -3794,6 +3804,7 @@
37943804 inOverstrike = !inOverstrike;
37953805 ContainerNeedsUpdate(SC_UPDATE_SELECTION);
37963806 ShowCaretAtCurrentPosition();
3807+ SetIdle(true);
37973808 break;
37983809 case SCI_CANCEL: // Cancel any modes - handled in subclass
37993810 // Also unselect text
@@ -4016,11 +4027,9 @@
40164027
40174028 class CaseFolderASCII : public CaseFolderTable {
40184029 public:
4019- CaseFolderASCII() {
4030+ CaseFolderASCII() noexcept {
40204031 StandardASCII();
40214032 }
4022- ~CaseFolderASCII() override {
4023- }
40244033 };
40254034
40264035
@@ -4161,7 +4170,7 @@
41614170 EnsureCaretVisible();
41624171 }
41634172
4164-static bool Close(Point pt1, Point pt2, Point threshold) {
4173+static bool Close(Point pt1, Point pt2, Point threshold) noexcept {
41654174 if (std::abs(pt1.x - pt2.x) > threshold.x)
41664175 return false;
41674176 if (std::abs(pt1.y - pt2.y) > threshold.y)
@@ -4384,7 +4393,7 @@
43844393 }
43854394 }
43864395
4387-Window::Cursor Editor::GetMarginCursor(Point pt) const {
4396+Window::Cursor Editor::GetMarginCursor(Point pt) const noexcept {
43884397 int x = 0;
43894398 for (const MarginStyle &m : vs.ms) {
43904399 if ((pt.x >= x) && (pt.x < x + m.width))
@@ -4731,7 +4740,7 @@
47314740 }
47324741 }
47334742
4734-Range Editor::GetHotSpotRange() const {
4743+Range Editor::GetHotSpotRange() const noexcept {
47354744 return hotspot;
47364745 }
47374746
@@ -4949,6 +4958,8 @@
49494958 }
49504959
49514960 bool Editor::Idle() {
4961+ NotifyUpdateUI();
4962+
49524963 bool needWrap = Wrapping() && wrapPending.NeedsWrap();
49534964
49544965 if (needWrap) {
@@ -5572,11 +5583,11 @@
55725583 return length;
55735584 }
55745585
5575-bool Editor::IsUnicodeMode() const {
5586+bool Editor::IsUnicodeMode() const noexcept {
55765587 return pdoc && (SC_CP_UTF8 == pdoc->dbcsCodePage);
55775588 }
55785589
5579-int Editor::CodePage() const {
5590+int Editor::CodePage() const noexcept {
55805591 if (pdoc)
55815592 return pdoc->dbcsCodePage;
55825593 else
@@ -5612,7 +5623,7 @@
56125623 SetEmptySelection(sel.MainCaret() + lengthInserted);
56135624 }
56145625
5615-bool Editor::ValidMargin(uptr_t wParam) const {
5626+bool Editor::ValidMargin(uptr_t wParam) const noexcept {
56165627 return wParam < vs.ms.size();
56175628 }
56185629
@@ -5741,7 +5752,7 @@
57415752 ContainerNeedsUpdate(SC_UPDATE_SELECTION);
57425753 }
57435754
5744-sptr_t Editor::StringResult(sptr_t lParam, const char *val) {
5755+sptr_t Editor::StringResult(sptr_t lParam, const char *val) noexcept {
57455756 const size_t len = val ? strlen(val) : 0;
57465757 if (lParam) {
57475758 char *ptr = CharPtrFromSPtr(lParam);
@@ -5753,7 +5764,7 @@
57535764 return len; // Not including NUL
57545765 }
57555766
5756-sptr_t Editor::BytesResult(sptr_t lParam, const unsigned char *val, size_t len) {
5767+sptr_t Editor::BytesResult(sptr_t lParam, const unsigned char *val, size_t len) noexcept {
57575768 // No NUL termination: len is number of valid/displayed bytes
57585769 if ((lParam) && (len > 0)) {
57595770 char *ptr = CharPtrFromSPtr(lParam);
@@ -7292,7 +7303,7 @@
72927303 return vs.caretcolour.AsInteger();
72937304
72947305 case SCI_SETCARETSTYLE:
7295- if (wParam <= CARETSTYLE_BLOCK)
7306+ if (wParam <= (CARETSTYLE_BLOCK | CARETSTYLE_OVERSTRIKE_BLOCK))
72967307 vs.caretStyle = static_cast<int>(wParam);
72977308 else
72987309 /* Default to the line caret */
@@ -7747,6 +7758,7 @@
77477758 inOverstrike = wParam != 0;
77487759 ContainerNeedsUpdate(SC_UPDATE_SELECTION);
77497760 ShowCaretAtCurrentPosition();
7761+ SetIdle(true);
77507762 }
77517763 break;
77527764
--- branches/1.12.x/ext/scintilla/src/Editor.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/Editor.h (revision 28563)
@@ -19,7 +19,7 @@
1919 enum {tickSize = 100};
2020 TickerID tickerID;
2121
22- Timer();
22+ Timer() noexcept;
2323 };
2424
2525 /**
@@ -29,7 +29,7 @@
2929 bool state;
3030 IdlerID idlerID;
3131
32- Idler();
32+ Idler() noexcept;
3333 };
3434
3535 /**
@@ -47,12 +47,12 @@
4747 enum workItems items;
4848 Sci::Position upTo;
4949
50- WorkNeeded() : items(workNone), upTo(0) {}
51- void Reset() {
50+ WorkNeeded() noexcept : items(workNone), upTo(0) {}
51+ void Reset() noexcept {
5252 items = workNone;
5353 upTo = 0;
5454 }
55- void Need(workItems items_, Sci::Position pos) {
55+ void Need(workItems items_, Sci::Position pos) noexcept {
5656 if ((items_ & workStyle) && (upTo < pos))
5757 upTo = pos;
5858 items = static_cast<workItems>(items | items_);
@@ -69,8 +69,8 @@
6969 bool lineCopy;
7070 int codePage;
7171 int characterSet;
72- SelectionText() : rectangular(false), lineCopy(false), codePage(0), characterSet(0) {}
73- void Clear() {
72+ SelectionText() noexcept : rectangular(false), lineCopy(false), codePage(0), characterSet(0) {}
73+ void Clear() noexcept {
7474 s.clear();
7575 rectangular = false;
7676 lineCopy = false;
@@ -88,16 +88,16 @@
8888 void Copy(const SelectionText &other) {
8989 Copy(other.s, other.codePage, other.characterSet, other.rectangular, other.lineCopy);
9090 }
91- const char *Data() const {
91+ const char *Data() const noexcept {
9292 return s.c_str();
9393 }
94- size_t Length() const {
94+ size_t Length() const noexcept {
9595 return s.length();
9696 }
97- size_t LengthWithTerminator() const {
97+ size_t LengthWithTerminator() const noexcept {
9898 return s.length() + 1;
9999 }
100- bool Empty() const {
100+ bool Empty() const noexcept {
101101 return s.empty();
102102 }
103103 private:
@@ -113,22 +113,22 @@
113113 enum { lineLarge = 0x7ffffff };
114114 Sci::Line start; // When there are wraps pending, will be in document range
115115 Sci::Line end; // May be lineLarge to indicate all of document after start
116- WrapPending() {
116+ WrapPending() noexcept {
117117 start = lineLarge;
118118 end = lineLarge;
119119 }
120- void Reset() {
120+ void Reset() noexcept {
121121 start = lineLarge;
122122 end = lineLarge;
123123 }
124- void Wrapped(Sci::Line line) {
124+ void Wrapped(Sci::Line line) noexcept {
125125 if (start == line)
126126 start++;
127127 }
128- bool NeedsWrap() const {
128+ bool NeedsWrap() const noexcept {
129129 return start < end;
130130 }
131- bool AddRange(Sci::Line lineStart, Sci::Line lineEnd) {
131+ bool AddRange(Sci::Line lineStart, Sci::Line lineEnd) noexcept {
132132 const bool neededWrap = NeedsWrap();
133133 bool changed = false;
134134 if (start > lineStart) {
@@ -302,7 +302,7 @@
302302 PRectangle RectangleFromRange(Range r, int overlap);
303303 void InvalidateRange(Sci::Position start, Sci::Position end);
304304
305- bool UserVirtualSpace() const {
305+ bool UserVirtualSpace() const noexcept {
306306 return ((virtualSpaceOptions & SCVS_USERACCESSIBLE) != 0);
307307 }
308308 Sci::Position CurrentPosition() const;
@@ -347,8 +347,8 @@
347347 struct XYScrollPosition {
348348 int xOffset;
349349 Sci::Line topLine;
350- XYScrollPosition(int xOffset_, Sci::Line topLine_) : xOffset(xOffset_), topLine(topLine_) {}
351- bool operator==(const XYScrollPosition &other) const {
350+ XYScrollPosition(int xOffset_, Sci::Line topLine_) noexcept : xOffset(xOffset_), topLine(topLine_) {}
351+ bool operator==(const XYScrollPosition &other) const noexcept {
352352 return (xOffset == other.xOffset) && (topLine == other.topLine);
353353 }
354354 };
@@ -368,7 +368,7 @@
368368 virtual void NotifyCaretMove();
369369 virtual void UpdateSystemCaret();
370370
371- bool Wrapping() const;
371+ bool Wrapping() const noexcept;
372372 void NeedWrapping(Sci::Line docLineStart=0, Sci::Line docLineEnd=WrapPending::lineLarge);
373373 bool WrapOneLine(Surface *surface, Sci::Line lineToWrap);
374374 enum class WrapScope {wsAll, wsVisible, wsIdle};
@@ -441,13 +441,13 @@
441441 void NotifySavePoint(Document *document, void *userData, bool atSavePoint) override;
442442 void CheckModificationForWrap(DocModification mh);
443443 void NotifyModified(Document *document, DocModification mh, void *userData) override;
444- void NotifyDeleted(Document *document, void *userData) override;
444+ void NotifyDeleted(Document *document, void *userData) noexcept override;
445445 void NotifyStyleNeeded(Document *doc, void *userData, Sci::Position endStyleNeeded) override;
446446 void NotifyLexerChanged(Document *doc, void *userData) override;
447447 void NotifyErrorOccurred(Document *doc, void *userData, int status) override;
448448 void NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
449449
450- void ContainerNeedsUpdate(int flags);
450+ void ContainerNeedsUpdate(int flags) noexcept;
451451 void PageMove(int direction, Selection::selTypes selt=Selection::noSel, bool stuttered = false);
452452 enum { cmSame, cmUpper, cmLower };
453453 virtual std::string CaseMapString(const std::string &s, int caseMapping);
@@ -495,7 +495,7 @@
495495 bool PositionInSelection(Sci::Position pos);
496496 bool PointInSelection(Point pt);
497497 bool PointInSelMargin(Point pt) const;
498- Window::Cursor GetMarginCursor(Point pt) const;
498+ Window::Cursor GetMarginCursor(Point pt) const noexcept;
499499 void TrimAndSetSelection(Sci::Position currentPos_, Sci::Position anchor_);
500500 void LineSelection(Sci::Position lineCurrentPos_, Sci::Position lineAnchorPos_, bool wholeLine);
501501 void WordSelection(Sci::Position pos);
@@ -552,53 +552,53 @@
552552 bool PositionIsHotspot(Sci::Position position) const;
553553 bool PointIsHotspot(Point pt);
554554 void SetHotSpotRange(const Point *pt);
555- Range GetHotSpotRange() const override;
555+ Range GetHotSpotRange() const noexcept override;
556556 void SetHoverIndicatorPosition(Sci::Position position);
557557 void SetHoverIndicatorPoint(Point pt);
558558
559- int CodePage() const;
559+ int CodePage() const noexcept;
560560 virtual bool ValidCodePage(int /* codePage */) const { return true; }
561561 Sci::Line WrapCount(Sci::Line line);
562562 void AddStyledText(const char *buffer, Sci::Position appendLength);
563563
564564 virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;
565- bool ValidMargin(uptr_t wParam) const;
565+ bool ValidMargin(uptr_t wParam) const noexcept;
566566 void StyleSetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
567567 sptr_t StyleGetMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
568568 void SetSelectionNMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
569569
570- static const char *StringFromEOLMode(int eolMode);
570+ static const char *StringFromEOLMode(int eolMode) noexcept;
571571
572572 // Coercion functions for transforming WndProc parameters into pointers
573- static void *PtrFromSPtr(sptr_t lParam) {
573+ static void *PtrFromSPtr(sptr_t lParam) noexcept {
574574 return reinterpret_cast<void *>(lParam);
575575 }
576- static const char *ConstCharPtrFromSPtr(sptr_t lParam) {
576+ static const char *ConstCharPtrFromSPtr(sptr_t lParam) noexcept {
577577 return static_cast<const char *>(PtrFromSPtr(lParam));
578578 }
579- static const unsigned char *ConstUCharPtrFromSPtr(sptr_t lParam) {
579+ static const unsigned char *ConstUCharPtrFromSPtr(sptr_t lParam) noexcept {
580580 return static_cast<const unsigned char *>(PtrFromSPtr(lParam));
581581 }
582- static char *CharPtrFromSPtr(sptr_t lParam) {
582+ static char *CharPtrFromSPtr(sptr_t lParam) noexcept {
583583 return static_cast<char *>(PtrFromSPtr(lParam));
584584 }
585- static unsigned char *UCharPtrFromSPtr(sptr_t lParam) {
585+ static unsigned char *UCharPtrFromSPtr(sptr_t lParam) noexcept {
586586 return static_cast<unsigned char *>(PtrFromSPtr(lParam));
587587 }
588- static void *PtrFromUPtr(uptr_t wParam) {
588+ static void *PtrFromUPtr(uptr_t wParam) noexcept {
589589 return reinterpret_cast<void *>(wParam);
590590 }
591- static const char *ConstCharPtrFromUPtr(uptr_t wParam) {
591+ static const char *ConstCharPtrFromUPtr(uptr_t wParam) noexcept {
592592 return static_cast<const char *>(PtrFromUPtr(wParam));
593593 }
594594
595- static sptr_t StringResult(sptr_t lParam, const char *val);
596- static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len);
595+ static sptr_t StringResult(sptr_t lParam, const char *val) noexcept;
596+ static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len) noexcept;
597597
598598 public:
599599 virtual void NotifyParent(SCNotification * scn) = 0;
600600 // Public so the COM thunks can access it.
601- bool IsUnicodeMode() const;
601+ bool IsUnicodeMode() const noexcept;
602602 // Public so scintilla_send_message can use it.
603603 virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
604604 // Public so scintilla_set_id can use it.
--- branches/1.12.x/ext/scintilla/src/MarginView.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/MarginView.cxx (revision 28563)
@@ -9,7 +9,6 @@
99 #include <cstdlib>
1010 #include <cassert>
1111 #include <cstring>
12-#include <cctype>
1312 #include <cstdio>
1413 #include <cmath>
1514
@@ -101,7 +100,7 @@
101100 y - 2 * dy);
102101 }
103102
104-MarginView::MarginView() {
103+MarginView::MarginView() noexcept {
105104 wrapMarkerPaddingRight = 3;
106105 customDrawWrapMarker = nullptr;
107106 }
--- branches/1.12.x/ext/scintilla/src/MarginView.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/MarginView.h (revision 28563)
@@ -32,7 +32,7 @@
3232 * existing platforms must implement as empty. */
3333 DrawWrapMarkerFn customDrawWrapMarker;
3434
35- MarginView();
35+ MarginView() noexcept;
3636
3737 void DropGraphics(bool freeObjects);
3838 void AllocateGraphics(const ViewStyle &vsDraw);
--- branches/1.12.x/ext/scintilla/src/PositionCache.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/PositionCache.cxx (revision 28563)
@@ -99,7 +99,7 @@
9999 }
100100 }
101101
102-void LineLayout::Free() {
102+void LineLayout::Free() noexcept {
103103 chars.reset();
104104 styles.reset();
105105 positions.reset();
@@ -391,7 +391,7 @@
391391 PLATFORM_ASSERT(cache.size() == lengthForLevel);
392392 }
393393
394-void LineLayoutCache::Deallocate() {
394+void LineLayoutCache::Deallocate() noexcept {
395395 PLATFORM_ASSERT(useCount == 0);
396396 cache.clear();
397397 }
@@ -409,7 +409,7 @@
409409 }
410410 }
411411
412-void LineLayoutCache::SetLevel(int level_) {
412+void LineLayoutCache::SetLevel(int level_) noexcept {
413413 allInvalidated = false;
414414 if ((level_ != -1) && (level != level_)) {
415415 level = level_;
@@ -465,7 +465,7 @@
465465 return ret;
466466 }
467467
468-void LineLayoutCache::Dispose(LineLayout *ll) {
468+void LineLayoutCache::Dispose(LineLayout *ll) noexcept {
469469 allInvalidated = false;
470470 if (ll) {
471471 if (!ll->inCache) {
@@ -488,7 +488,7 @@
488488 return k;
489489 }
490490
491-SpecialRepresentations::SpecialRepresentations() {
491+SpecialRepresentations::SpecialRepresentations() noexcept {
492492 const short none = 0;
493493 std::fill(startByteHasReprs, std::end(startByteHasReprs), none);
494494 }
@@ -664,11 +664,11 @@
664664 }
665665 }
666666
667-bool BreakFinder::More() const {
667+bool BreakFinder::More() const noexcept {
668668 return (subBreak >= 0) || (nextBreak < lineRange.end);
669669 }
670670
671-PositionCacheEntry::PositionCacheEntry() :
671+PositionCacheEntry::PositionCacheEntry() noexcept :
672672 styleNumber(0), len(0), clock(0), positions(nullptr) {
673673 }
674674
@@ -701,7 +701,7 @@
701701 Clear();
702702 }
703703
704-void PositionCacheEntry::Clear() {
704+void PositionCacheEntry::Clear() noexcept {
705705 positions.reset();
706706 styleNumber = 0;
707707 len = 0;
@@ -721,7 +721,7 @@
721721 }
722722 }
723723
724-unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) {
724+unsigned int PositionCacheEntry::Hash(unsigned int styleNumber_, const char *s, unsigned int len_) noexcept {
725725 unsigned int ret = s[0] << 7;
726726 for (unsigned int i=0; i<len_; i++) {
727727 ret *= 1000003;
@@ -734,11 +734,11 @@
734734 return ret;
735735 }
736736
737-bool PositionCacheEntry::NewerThan(const PositionCacheEntry &other) const {
737+bool PositionCacheEntry::NewerThan(const PositionCacheEntry &other) const noexcept {
738738 return clock > other.clock;
739739 }
740740
741-void PositionCacheEntry::ResetClock() {
741+void PositionCacheEntry::ResetClock() noexcept {
742742 if (clock > 0) {
743743 clock = 1;
744744 }
@@ -754,7 +754,7 @@
754754 Clear();
755755 }
756756
757-void PositionCache::Clear() {
757+void PositionCache::Clear() noexcept {
758758 if (!allClear) {
759759 for (PositionCacheEntry &pce : pces) {
760760 pce.Clear();
--- branches/1.12.x/ext/scintilla/src/PositionCache.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/PositionCache.h (revision 28563)
@@ -96,7 +96,7 @@
9696 virtual ~LineLayout();
9797 void Resize(int maxLineLength_);
9898 void EnsureBidiData();
99- void Free();
99+ void Free() noexcept;
100100 void Invalidate(validLevel validity_);
101101 int LineStart(int line) const;
102102 int LineLength(int line) const;
@@ -163,7 +163,7 @@
163163 void operator=(const LineLayoutCache &) = delete;
164164 void operator=(LineLayoutCache &&) = delete;
165165 virtual ~LineLayoutCache();
166- void Deallocate();
166+ void Deallocate() noexcept;
167167 enum {
168168 llcNone=SC_CACHE_NONE,
169169 llcCaret=SC_CACHE_CARET,
@@ -171,11 +171,11 @@
171171 llcDocument=SC_CACHE_DOCUMENT
172172 };
173173 void Invalidate(LineLayout::validLevel validity_);
174- void SetLevel(int level_);
175- int GetLevel() const { return level; }
174+ void SetLevel(int level_) noexcept;
175+ int GetLevel() const noexcept { return level; }
176176 LineLayout *Retrieve(Sci::Line lineNumber, Sci::Line lineCaret, int maxChars, int styleClock_,
177177 Sci::Line linesOnScreen, Sci::Line linesInDoc);
178- void Dispose(LineLayout *ll);
178+ void Dispose(LineLayout *ll) noexcept;
179179 };
180180
181181 class PositionCacheEntry {
@@ -184,7 +184,7 @@
184184 unsigned int clock:16;
185185 std::unique_ptr<XYPOSITION []> positions;
186186 public:
187- PositionCacheEntry();
187+ PositionCacheEntry() noexcept;
188188 // Copy constructor not currently used, but needed for being element in std::vector.
189189 PositionCacheEntry(const PositionCacheEntry &);
190190 // Deleted so PositionCacheEntry objects can not be assigned.
@@ -193,11 +193,11 @@
193193 void operator=(PositionCacheEntry &&) = delete;
194194 ~PositionCacheEntry();
195195 void Set(unsigned int styleNumber_, const char *s_, unsigned int len_, const XYPOSITION *positions_, unsigned int clock_);
196- void Clear();
196+ void Clear() noexcept;
197197 bool Retrieve(unsigned int styleNumber_, const char *s_, unsigned int len_, XYPOSITION *positions_) const;
198- static unsigned int Hash(unsigned int styleNumber_, const char *s, unsigned int len_);
199- bool NewerThan(const PositionCacheEntry &other) const;
200- void ResetClock();
198+ static unsigned int Hash(unsigned int styleNumber_, const char *s, unsigned int len_) noexcept;
199+ bool NewerThan(const PositionCacheEntry &other) const noexcept;
200+ void ResetClock() noexcept;
201201 };
202202
203203 class Representation {
@@ -213,7 +213,7 @@
213213 MapRepresentation mapReprs;
214214 short startByteHasReprs[0x100];
215215 public:
216- SpecialRepresentations();
216+ SpecialRepresentations() noexcept;
217217 void SetRepresentation(const char *charBytes, const char *value);
218218 void ClearRepresentation(const char *charBytes);
219219 const Representation *RepresentationFromCharacter(const char *charBytes, size_t len) const;
@@ -262,7 +262,7 @@
262262 void operator=(BreakFinder &&) = delete;
263263 ~BreakFinder();
264264 TextSegment Next();
265- bool More() const;
265+ bool More() const noexcept;
266266 };
267267
268268 class PositionCache {
@@ -277,9 +277,9 @@
277277 void operator=(const PositionCache &) = delete;
278278 void operator=(PositionCache &&) = delete;
279279 ~PositionCache();
280- void Clear();
280+ void Clear() noexcept;
281281 void SetSize(size_t size_);
282- size_t GetSize() const { return pces.size(); }
282+ size_t GetSize() const noexcept { return pces.size(); }
283283 void MeasureWidths(Surface *surface, const ViewStyle &vstyle, unsigned int styleNumber,
284284 const char *s, unsigned int len, XYPOSITION *positions, const Document *pdoc);
285285 };
--- branches/1.12.x/ext/scintilla/src/Style.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/Style.cxx (revision 28563)
@@ -17,27 +17,27 @@
1717
1818 using namespace Scintilla;
1919
20-FontAlias::FontAlias() {
20+FontAlias::FontAlias() noexcept {
2121 }
2222
23-FontAlias::FontAlias(const FontAlias &other) : Font() {
23+FontAlias::FontAlias(const FontAlias &other) noexcept : Font() {
2424 SetID(other.fid);
2525 }
2626
2727 FontAlias::~FontAlias() {
28- SetID(0);
28+ SetID(FontID{});
2929 // ~Font will not release the actual font resource since it is now 0
3030 }
3131
32-void FontAlias::MakeAlias(const Font &fontOrigin) {
32+void FontAlias::MakeAlias(const Font &fontOrigin) noexcept {
3333 SetID(fontOrigin.GetID());
3434 }
3535
36-void FontAlias::ClearFont() {
37- SetID(0);
36+void FontAlias::ClearFont() noexcept {
37+ SetID(FontID{});
3838 }
3939
40-bool FontSpecification::operator==(const FontSpecification &other) const {
40+bool FontSpecification::operator==(const FontSpecification &other) const noexcept {
4141 return fontName == other.fontName &&
4242 weight == other.weight &&
4343 italic == other.italic &&
@@ -46,7 +46,7 @@
4646 extraFontFlag == other.extraFontFlag;
4747 }
4848
49-bool FontSpecification::operator<(const FontSpecification &other) const {
49+bool FontSpecification::operator<(const FontSpecification &other) const noexcept {
5050 if (fontName != other.fontName)
5151 return fontName < other.fontName;
5252 if (weight != other.weight)
@@ -62,11 +62,11 @@
6262 return false;
6363 }
6464
65-FontMeasurements::FontMeasurements() {
65+FontMeasurements::FontMeasurements() noexcept {
6666 ClearMeasurements();
6767 }
6868
69-void FontMeasurements::ClearMeasurements() {
69+void FontMeasurements::ClearMeasurements() noexcept {
7070 ascent = 1;
7171 descent = 1;
7272 capitalHeight = 1;
--- branches/1.12.x/ext/scintilla/src/Style.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/Style.h (revision 28563)
@@ -17,7 +17,7 @@
1717 int size;
1818 int characterSet;
1919 int extraFontFlag;
20- FontSpecification() :
20+ FontSpecification() noexcept :
2121 fontName(nullptr),
2222 weight(SC_WEIGHT_NORMAL),
2323 italic(false),
@@ -25,22 +25,22 @@
2525 characterSet(0),
2626 extraFontFlag(0) {
2727 }
28- bool operator==(const FontSpecification &other) const;
29- bool operator<(const FontSpecification &other) const;
28+ bool operator==(const FontSpecification &other) const noexcept;
29+ bool operator<(const FontSpecification &other) const noexcept;
3030 };
3131
3232 // Just like Font but only has a copy of the FontID so should not delete it
3333 class FontAlias : public Font {
3434 public:
35- FontAlias();
35+ FontAlias() noexcept;
3636 // FontAlias objects can not be assigned except for initialization
37- FontAlias(const FontAlias &);
37+ FontAlias(const FontAlias &) noexcept;
3838 FontAlias(FontAlias &&) = delete;
3939 FontAlias &operator=(const FontAlias &) = delete;
4040 FontAlias &operator=(FontAlias &&) = delete;
4141 ~FontAlias() override;
42- void MakeAlias(const Font &fontOrigin);
43- void ClearFont();
42+ void MakeAlias(const Font &fontOrigin) noexcept;
43+ void ClearFont() noexcept;
4444 };
4545
4646 struct FontMeasurements {
@@ -50,8 +50,8 @@
5050 XYPOSITION aveCharWidth;
5151 XYPOSITION spaceWidth;
5252 int sizeZoomed;
53- FontMeasurements();
54- void ClearMeasurements();
53+ FontMeasurements() noexcept;
54+ void ClearMeasurements() noexcept;
5555 };
5656
5757 /**
@@ -84,7 +84,7 @@
8484 bool visible_, bool changeable_, bool hotspot_);
8585 void ClearTo(const Style &source);
8686 void Copy(Font &font_, const FontMeasurements &fm_);
87- bool IsProtected() const { return !(changeable && visible);}
87+ bool IsProtected() const noexcept { return !(changeable && visible);}
8888 };
8989
9090 }
--- branches/1.12.x/ext/scintilla/src/ViewStyle.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/ViewStyle.cxx (revision 28563)
@@ -27,6 +27,8 @@
2727 #include "Style.h"
2828 #include "ViewStyle.h"
2929
30+#define CARETSTYLE_INS_MASK 0xF
31+
3032 using namespace Scintilla;
3133
3234 MarginStyle::MarginStyle(int style_, int width_, int mask_) :
@@ -572,6 +574,19 @@
572574 return changed;
573575 }
574576
577+bool ViewStyle::IsBlockCaretStyle() const noexcept {
578+ return (caretStyle == CARETSTYLE_BLOCK) || (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) != 0;
579+}
580+
581+ViewStyle::CaretShape ViewStyle::CaretShapeForMode(bool inOverstrike) const noexcept {
582+ if (inOverstrike) {
583+ return (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) ? CaretShape::block : CaretShape::bar;
584+ }
585+
586+ const int caret = caretStyle & CARETSTYLE_INS_MASK;
587+ return (caret <= CARETSTYLE_BLOCK) ? static_cast<CaretShape>(caret) : CaretShape::line;
588+}
589+
575590 void ViewStyle::AllocStyles(size_t sizeNew) {
576591 size_t i=styles.size();
577592 styles.resize(sizeNew);
--- branches/1.12.x/ext/scintilla/src/ViewStyle.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/src/ViewStyle.h (revision 28563)
@@ -212,6 +212,10 @@
212212
213213 bool WhiteSpaceVisible(bool inIndent) const;
214214
215+ enum class CaretShape { invisible, line, block, bar };
216+ bool IsBlockCaretStyle() const noexcept;
217+ CaretShape CaretShapeForMode(bool inOverstrike) const noexcept;
218+
215219 private:
216220 void AllocStyles(size_t sizeNew);
217221 void CreateAndAddFont(const FontSpecification &fs);
--- branches/1.12.x/ext/scintilla/version.txt (revision 28562)
+++ branches/1.12.x/ext/scintilla/version.txt (revision 28563)
@@ -1 +1 @@
1-413
1+414
--- branches/1.12.x/ext/scintilla/win32/PlatWin.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/win32/PlatWin.cxx (revision 28563)
@@ -8,7 +8,6 @@
88 #include <cstddef>
99 #include <cstdlib>
1010 #include <cstring>
11-#include <cctype>
1211 #include <cstdio>
1312 #include <cstdarg>
1413 #include <ctime>
@@ -63,12 +62,6 @@
6362
6463 UINT CodePageFromCharSet(DWORD characterSet, UINT documentCodePage);
6564
66-RECT RectFromPRectangle(PRectangle prc) noexcept {
67- RECT rc = {static_cast<LONG>(prc.left), static_cast<LONG>(prc.top),
68- static_cast<LONG>(prc.right), static_cast<LONG>(prc.bottom)};
69- return rc;
70-}
71-
7265 #if defined(USE_D2D)
7366 IDWriteFactory *pIDWriteFactory = nullptr;
7467 ID2D1Factory *pD2DFactory = nullptr;
@@ -153,7 +146,7 @@
153146 FLOAT yAscent;
154147 FLOAT yDescent;
155148 FLOAT yInternalLeading;
156- FormatAndMetrics(HFONT hfont_, int extraFontFlag_, int characterSet_) :
149+ FormatAndMetrics(HFONT hfont_, int extraFontFlag_, int characterSet_) noexcept :
157150 technology(SCWIN_TECH_GDI), hfont(hfont_),
158151 #if defined(USE_D2D)
159152 pTextFormat(nullptr),
@@ -166,7 +159,7 @@
166159 int characterSet_,
167160 FLOAT yAscent_,
168161 FLOAT yDescent_,
169- FLOAT yInternalLeading_) :
162+ FLOAT yInternalLeading_) noexcept :
170163 technology(SCWIN_TECH_DIRECTWRITE),
171164 hfont{},
172165 pTextFormat(pTextFormat_),
@@ -229,11 +222,11 @@
229222
230223 namespace {
231224
232-void *PointerFromWindow(HWND hWnd) {
225+void *PointerFromWindow(HWND hWnd) noexcept {
233226 return reinterpret_cast<void *>(::GetWindowLongPtr(hWnd, 0));
234227 }
235228
236-void SetWindowPointer(HWND hWnd, void *ptr) {
229+void SetWindowPointer(HWND hWnd, void *ptr) noexcept {
237230 ::SetWindowLongPtr(hWnd, 0, reinterpret_cast<LONG_PTR>(ptr));
238231 }
239232
@@ -242,11 +235,11 @@
242235
243236 HCURSOR reverseArrowCursor {};
244237
245-FormatAndMetrics *FamFromFontID(void *fid) {
238+FormatAndMetrics *FamFromFontID(void *fid) noexcept {
246239 return static_cast<FormatAndMetrics *>(fid);
247240 }
248241
249-BYTE Win32MapFontQuality(int extraFontFlag) {
242+constexpr BYTE Win32MapFontQuality(int extraFontFlag) noexcept {
250243 switch (extraFontFlag & SC_EFF_QUALITY_MASK) {
251244
252245 case SC_EFF_QUALITY_NON_ANTIALIASED:
@@ -264,7 +257,7 @@
264257 }
265258
266259 #if defined(USE_D2D)
267-D2D1_TEXT_ANTIALIAS_MODE DWriteMapFontQuality(int extraFontFlag) {
260+constexpr D2D1_TEXT_ANTIALIAS_MODE DWriteMapFontQuality(int extraFontFlag) noexcept {
268261 switch (extraFontFlag & SC_EFF_QUALITY_MASK) {
269262
270263 case SC_EFF_QUALITY_NON_ANTIALIASED:
@@ -293,51 +286,11 @@
293286 UTF16FromUTF8(faceName, lf.lfFaceName, LF_FACESIZE);
294287 }
295288
296-/**
297- * Create a hash from the parameters for a font to allow easy checking for identity.
298- * If one font is the same as another, its hash will be the same, but if the hash is the
299- * same then they may still be different.
300- */
301-int HashFont(const FontParameters &fp) noexcept {
302- return
303- static_cast<int>(fp.size) ^
304- (fp.characterSet << 10) ^
305- ((fp.extraFontFlag & SC_EFF_QUALITY_MASK) << 9) ^
306- ((fp.weight/100) << 12) ^
307- (fp.italic ? 0x20000000 : 0) ^
308- (fp.technology << 15) ^
309- fp.faceName[0];
310-}
311-
312-}
313-
314-class FontCached : Font {
315- FontCached *next;
316- int usage;
317- float size;
289+FontID CreateFontFromParameters(const FontParameters &fp) {
318290 LOGFONTW lf;
319- int technology;
320- int hash;
321- explicit FontCached(const FontParameters &fp);
322- bool SameAs(const FontParameters &fp);
323- void Release() override;
324-
325- static FontCached *first;
326-public:
327- ~FontCached() override {}
328- static FontID FindOrCreate(const FontParameters &fp);
329- static void ReleaseId(FontID fid_);
330-};
331-
332-FontCached *FontCached::first = nullptr;
333-
334-FontCached::FontCached(const FontParameters &fp) :
335- next(nullptr), usage(0), size(1.0), hash(0) {
336291 SetLogFont(lf, fp.faceName, fp.characterSet, fp.size, fp.weight, fp.italic, fp.extraFontFlag);
337- technology = fp.technology;
338- hash = HashFont(fp);
339- fid = 0;
340- if (technology == SCWIN_TECH_GDI) {
292+ FontID fid = nullptr;
293+ if (fp.technology == SCWIN_TECH_GDI) {
341294 HFONT hfont = ::CreateFontIndirectW(&lf);
342295 fid = new FormatAndMetrics(hfont, fp.extraFontFlag, fp.characterSet);
343296 } else {
@@ -383,69 +336,11 @@
383336 }
384337 #endif
385338 }
386- usage = 1;
339+ return fid;
387340 }
388341
389-bool FontCached::SameAs(const FontParameters &fp) {
390- if (
391- (size == fp.size) &&
392- (lf.lfWeight == fp.weight) &&
393- (lf.lfItalic == (fp.italic ? 1 : 0)) &&
394- (lf.lfCharSet == fp.characterSet) &&
395- (lf.lfQuality == Win32MapFontQuality(fp.extraFontFlag)) &&
396- (technology == fp.technology)) {
397- wchar_t wszFace[LF_FACESIZE] = L"";
398- UTF16FromUTF8(fp.faceName, wszFace, LF_FACESIZE);
399- return 0 == wcscmp(lf.lfFaceName,wszFace);
400- }
401- return false;
402342 }
403343
404-void FontCached::Release() {
405- delete FamFromFontID(fid);
406- fid = nullptr;
407-}
408-
409-FontID FontCached::FindOrCreate(const FontParameters &fp) {
410- FontID ret {};
411- ::EnterCriticalSection(&crPlatformLock);
412- const int hashFind = HashFont(fp);
413- for (FontCached *cur=first; cur; cur=cur->next) {
414- if ((cur->hash == hashFind) &&
415- cur->SameAs(fp)) {
416- cur->usage++;
417- ret = cur->fid;
418- }
419- }
420- if (!ret) {
421- FontCached *fc = new FontCached(fp);
422- fc->next = first;
423- first = fc;
424- ret = fc->fid;
425- }
426- ::LeaveCriticalSection(&crPlatformLock);
427- return ret;
428-}
429-
430-void FontCached::ReleaseId(FontID fid_) {
431- ::EnterCriticalSection(&crPlatformLock);
432- FontCached **pcur=&first;
433- for (FontCached *cur=first; cur; cur=cur->next) {
434- if (cur->fid == fid_) {
435- cur->usage--;
436- if (cur->usage == 0) {
437- *pcur = cur->next;
438- cur->Release();
439- cur->next = nullptr;
440- delete cur;
441- }
442- break;
443- }
444- pcur=&cur->next;
445- }
446- ::LeaveCriticalSection(&crPlatformLock);
447-}
448-
449344 Font::Font() noexcept : fid{} {
450345 }
451346
@@ -452,18 +347,16 @@
452347 Font::~Font() {
453348 }
454349
455-#define FONTS_CACHED
456-
457350 void Font::Create(const FontParameters &fp) {
458351 Release();
459352 if (fp.faceName)
460- fid = FontCached::FindOrCreate(fp);
353+ fid = CreateFontFromParameters(fp);
461354 }
462355
463356 void Font::Release() {
464357 if (fid)
465- FontCached::ReleaseId(fid);
466- fid = 0;
358+ delete FamFromFontID(fid);
359+ fid = nullptr;
467360 }
468361
469362 // Buffer to hold strings and string position arrays without always allocating on heap.
@@ -532,10 +425,10 @@
532425
533426 void BrushColor(ColourDesired back);
534427 void SetFont(Font &font_);
535- void Clear();
428+ void Clear() noexcept;
536429
537430 public:
538- SurfaceGDI();
431+ SurfaceGDI() noexcept;
539432 // Deleted so SurfaceGDI objects can not be copied.
540433 SurfaceGDI(const SurfaceGDI &) = delete;
541434 SurfaceGDI(SurfaceGDI &&) = delete;
@@ -542,7 +435,7 @@
542435 SurfaceGDI &operator=(const SurfaceGDI &) = delete;
543436 SurfaceGDI &operator=(SurfaceGDI &&) = delete;
544437
545- ~SurfaceGDI() override;
438+ ~SurfaceGDI() noexcept override;
546439
547440 void Init(WindowID wid) override;
548441 void Init(SurfaceID sid, WindowID wid) override;
@@ -589,14 +482,14 @@
589482 void SetBidiR2L(bool bidiR2L_) override;
590483 };
591484
592-SurfaceGDI::SurfaceGDI() {
485+SurfaceGDI::SurfaceGDI() noexcept {
593486 }
594487
595-SurfaceGDI::~SurfaceGDI() {
488+SurfaceGDI::~SurfaceGDI() noexcept {
596489 Clear();
597490 }
598491
599-void SurfaceGDI::Clear() {
492+void SurfaceGDI::Clear() noexcept {
600493 if (penOld) {
601494 ::SelectObject(hdc, penOld);
602495 ::DeleteObject(pen);
@@ -763,7 +656,7 @@
763656 namespace {
764657
765658 // Plot a point into a DWORD buffer symmetrically to all 4 quadrants
766-void AllFour(DWORD *pixels, int width, int height, int x, int y, DWORD val) {
659+void AllFour(DWORD *pixels, int width, int height, int x, int y, DWORD val) noexcept {
767660 pixels[y*width+x] = val;
768661 pixels[y*width+width-1-x] = val;
769662 pixels[(height-1-y)*width+x] = val;
@@ -782,7 +675,7 @@
782675 return converter.val;
783676 }
784677
785-DWORD dwordMultiplied(ColourDesired colour, unsigned int alpha) {
678+DWORD dwordMultiplied(ColourDesired colour, unsigned int alpha) noexcept {
786679 return dwordFromBGRA(
787680 static_cast<byte>(colour.GetBlue() * alpha / 255),
788681 static_cast<byte>(colour.GetGreen() * alpha / 255),
@@ -1098,11 +991,11 @@
1098991 float dpiScaleX;
1099992 float dpiScaleY;
1100993
1101- void Clear();
994+ void Clear() noexcept;
1102995 void SetFont(Font &font_);
1103996
1104997 public:
1105- SurfaceD2D();
998+ SurfaceD2D() noexcept;
1106999 // Deleted so SurfaceD2D objects can not be copied.
11071000 SurfaceD2D(const SurfaceD2D &) = delete;
11081001 SurfaceD2D(SurfaceD2D &&) = delete;
@@ -1160,7 +1053,7 @@
11601053 void SetBidiR2L(bool bidiR2L_) override;
11611054 };
11621055
1163-SurfaceD2D::SurfaceD2D() :
1056+SurfaceD2D::SurfaceD2D() noexcept :
11641057 unicodeMode(false),
11651058 x(0), y(0) {
11661059
@@ -1188,7 +1081,7 @@
11881081 Clear();
11891082 }
11901083
1191-void SurfaceD2D::Clear() {
1084+void SurfaceD2D::Clear() noexcept {
11921085 if (pBrush) {
11931086 pBrush->Release();
11941087 pBrush = nullptr;
@@ -1320,7 +1213,7 @@
13201213 y = y_;
13211214 }
13221215
1323-static int Delta(int difference) {
1216+static constexpr int Delta(int difference) noexcept {
13241217 if (difference < 0)
13251218 return -1;
13261219 else if (difference > 0)
@@ -2221,7 +2114,7 @@
22212114
22222115 namespace {
22232116
2224-HWND HwndFromWindowID(WindowID wid) {
2117+HWND HwndFromWindowID(WindowID wid) noexcept {
22252118 return static_cast<HWND>(wid);
22262119 }
22272120
@@ -2250,7 +2143,7 @@
22502143
22512144 namespace {
22522145
2253-static RECT RectFromMonitor(HMONITOR hMonitor) {
2146+static RECT RectFromMonitor(HMONITOR hMonitor) noexcept {
22542147 MONITORINFO mi = {};
22552148 mi.cbSize = sizeof(mi);
22562149 if (GetMonitorInfo(hMonitor, &mi)) {
@@ -2329,7 +2222,7 @@
23292222
23302223 namespace {
23312224
2332-void FlipBitmap(HBITMAP bitmap, int width, int height) {
2225+void FlipBitmap(HBITMAP bitmap, int width, int height) noexcept {
23332226 HDC hdc = ::CreateCompatibleDC(NULL);
23342227 if (hdc) {
23352228 HBITMAP prevBmp = SelectBitmap(hdc, bitmap);
@@ -2339,7 +2232,7 @@
23392232 }
23402233 }
23412234
2342-HCURSOR GetReverseArrowCursor() {
2235+HCURSOR GetReverseArrowCursor() noexcept {
23432236 if (reverseArrowCursor)
23442237 return reverseArrowCursor;
23452238
@@ -2434,7 +2327,7 @@
24342327 std::vector<ListItemData> data;
24352328
24362329 public:
2437- void Clear() {
2330+ void Clear() noexcept {
24382331 words.clear();
24392332 data.clear();
24402333 }
@@ -2447,7 +2340,7 @@
24472340 return missing;
24482341 }
24492342 }
2450- int Count() const {
2343+ int Count() const noexcept {
24512344 return static_cast<int>(data.size());
24522345 }
24532346
@@ -3297,7 +3190,7 @@
32973190
32983191 namespace {
32993192
3300-bool ListBoxX_Register() {
3193+bool ListBoxX_Register() noexcept {
33013194 WNDCLASSEX wndclassc;
33023195 wndclassc.cbSize = sizeof(wndclassc);
33033196 // We need CS_HREDRAW and CS_VREDRAW because of the ellipsis that might be drawn for
@@ -3318,7 +3211,7 @@
33183211 return ::RegisterClassEx(&wndclassc) != 0;
33193212 }
33203213
3321-bool ListBoxX_Unregister() {
3214+bool ListBoxX_Unregister() noexcept {
33223215 return ::UnregisterClass(ListBoxX_ClassName, hinstPlatformRes) != 0;
33233216 }
33243217
@@ -3349,7 +3242,7 @@
33493242 protected:
33503243 HMODULE h;
33513244 public:
3352- explicit DynamicLibraryImpl(const char *modulePath) {
3245+ explicit DynamicLibraryImpl(const char *modulePath) noexcept {
33533246 h = ::LoadLibraryA(modulePath);
33543247 }
33553248
@@ -3359,7 +3252,7 @@
33593252 }
33603253
33613254 // Use GetProcAddress to get a pointer to the relevant function.
3362- Function FindFunction(const char *name) override {
3255+ Function FindFunction(const char *name) noexcept override {
33633256 if (h) {
33643257 // C++ standard doesn't like casts between function pointers and void pointers so use a union
33653258 union {
@@ -3373,7 +3266,7 @@
33733266 }
33743267 }
33753268
3376- bool IsValid() override {
3269+ bool IsValid() noexcept override {
33773270 return h != NULL;
33783271 }
33793272 };
--- branches/1.12.x/ext/scintilla/win32/PlatWin.h (revision 28562)
+++ branches/1.12.x/ext/scintilla/win32/PlatWin.h (revision 28563)
@@ -13,7 +13,11 @@
1313 extern void Platform_Initialise(void *hInstance);
1414 extern void Platform_Finalise(bool fromDllMain);
1515
16-RECT RectFromPRectangle(PRectangle prc) noexcept;
16+constexpr RECT RectFromPRectangle(PRectangle prc) noexcept {
17+ RECT rc = { static_cast<LONG>(prc.left), static_cast<LONG>(prc.top),
18+ static_cast<LONG>(prc.right), static_cast<LONG>(prc.bottom) };
19+ return rc;
20+}
1721
1822 #if defined(USE_D2D)
1923 extern bool LoadD2D();
--- branches/1.12.x/ext/scintilla/win32/ScintillaWin.cxx (revision 28562)
+++ branches/1.12.x/ext/scintilla/win32/ScintillaWin.cxx (revision 28563)
@@ -9,7 +9,6 @@
99 #include <cstdlib>
1010 #include <cassert>
1111 #include <cstring>
12-#include <cctype>
1312 #include <cstdio>
1413 #include <cmath>
1514 #include <climits>
Show on old repository browser