Skip to content

Commit

Permalink
+upd: Scintilla Lib v5.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
RaiKoHoff committed May 20, 2024
1 parent 963c5f2 commit b5b214a
Show file tree
Hide file tree
Showing 30 changed files with 628 additions and 269 deletions.
7 changes: 4 additions & 3 deletions scintilla/cppcheck.suppress
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ constStatement:scintilla/src/Document.cxx
// ILexer5* is not pointing at logically const
constParameterPointer:scintilla/src/Document.cxx

// Doesn't seem to understand that values change in loops
knownConditionTrueFalse:scintilla/src/Document.cxx

// Some non-explicit constructors are used for conversions or are private to lexers
noExplicitConstructor

// RangesCopy is deliberately returning a copy.
// The copy is always mutated so returning a refererence just enables lifetime problems.
returnByReference:scintilla/src/Selection.h

// MarginView access to all bits is safe and is better defined in later versions of C++
shiftTooManyBitsSigned:scintilla/src/MarginView.cxx

Expand Down
48 changes: 44 additions & 4 deletions scintilla/doc/ScintillaDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@

<h1>Scintilla Documentation</h1>

<p>Last edited 16 February 2024 NH</p>
<p>Last edited 22 March 2024 NH</p>

<p style="background:#90F0C0">Scintilla 5 has moved the lexers from Scintilla into a new
<a href="Lexilla.html">Lexilla</a> project.<br />
Expand Down Expand Up @@ -3804,6 +3804,22 @@ <h2 id="ElementColours">Element colours</h2>
<td>Cocoa</td>
<td>Background colour of selections when another window has focus</td>
</tr>
<tr>
<th align="left"><code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT</code></th>
<td>18</td>
<td>Translucent</td>
<td>All</td>
<td></td>
<td>Text colour of additional selections when another window has focus</td>
</tr>
<tr>
<th align="left"><code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK</code></th>
<td>19</td>
<td>Translucent</td>
<td>All</td>
<td></td>
<td>Background colour of additional selections when another window has focus</td>
</tr>
<tr class="section">
<th align="left"><code>SC_ELEMENT_CARET</code></th>
<td>40</td>
Expand Down Expand Up @@ -3911,6 +3927,8 @@ <h2 id="CaretAndSelectionStyles">Selection, caret, and hotspot styles</h2>
<br />
<a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_TEXT">SC_ELEMENT_SELECTION_INACTIVE_TEXT : colouralpha</a><br />
<a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_BACK">SC_ELEMENT_SELECTION_INACTIVE_BACK : colouralpha</a><br />
<a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_TEXT">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT : colouralpha</a><br />
<a class="element" href="#SC_ELEMENT_SELECTION_INACTIVE_BACK">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK : colouralpha</a><br />
<br />
<a class="element" href="#SC_ELEMENT_CARET_LINE_BACK">SC_ELEMENT_CARET_LINE_BACK : colouralpha</a><br />
<a class="message" href="#SCI_SETCARETLINELAYER">SCI_SETCARETLINELAYER(int layer)</a><br />
Expand Down Expand Up @@ -4035,8 +4053,13 @@ <h2 id="CaretAndSelectionStyles">Selection, caret, and hotspot styles</h2>
<p>
<b id="SC_ELEMENT_SELECTION_INACTIVE_TEXT">SC_ELEMENT_SELECTION_INACTIVE_TEXT : colouralpha</b><br />
<b id="SC_ELEMENT_SELECTION_INACTIVE_BACK">SC_ELEMENT_SELECTION_INACTIVE_BACK : colouralpha</b><br />
<b id="SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT : colouralpha</b><br />
<b id="SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK">SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK : colouralpha</b><br />
When a window no longer has the keyboard focus, it is customary to make its selection less noticeable by colouring it grey.
These elements define the colours to be used for selections without focus.
These elements define the colours to be used for selections without focus. When the <code>ADDITIONAL</code> elements are not set then
the standard values are used:
<code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT</code>&rarr;<code>SC_ELEMENT_SELECTION_INACTIVE_TEXT</code> and
<code>SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK</code>&rarr;<code>SC_ELEMENT_SELECTION_INACTIVE_BACK</code>.
</p>

<p>
Expand Down Expand Up @@ -6420,6 +6443,18 @@ <h2 id="Autocompletion">Autocompletion</h2>
This also avoids a header rectangle above the list.</td>
</tr>

<tr>
<td align="left"><code>SC_AUTOCOMPLETE_SELECT_FIRST_ITEM</code></td>

<td align="center">2</td>

<td>Always select the first item from the autocompletion list regardless of the value
entered in the editor. Useful when the autocompletion logic of the application
sorts autocompletion entries so that the best match is always at the top of the
list. Without this option, Scintilla selects the item from the autocompletion
list matching the value entered in the editor.</td>
</tr>

</tbody>
</table>

Expand Down Expand Up @@ -8563,6 +8598,8 @@ <h3 id="Substyles">Substyles</h3>

<p><b id="SCI_ALLOCATESUBSTYLES">SCI_ALLOCATESUBSTYLES(int styleBase, int numberStyles) &rarr; int</b><br />
Allocate some number of substyles for a particular base style returning the first substyle number allocated.
A failure, such as requesting more substyles than available, is indicated by returning a negative number.
Lexers that support substyles will commonly allow allocating 64 substyles.
Substyles are allocated contiguously.</p>

<p><b id="SCI_FREESUBSTYLES">SCI_FREESUBSTYLES</b><br />
Expand Down Expand Up @@ -8661,7 +8698,7 @@ <h4>ILexer5</h4>

<p>
The types <code>Sci_Position</code> and <code>Sci_PositionU</code> are used for positions and line numbers in the document.
With Scintilla 4, 64-bit builds define these as 64-bit types to allow future implementation of documents larger than 2 GB.
64-bit builds define these as 64-bit types to allow documents larger than 2 GB.
</p>

<p>
Expand Down Expand Up @@ -8699,6 +8736,9 @@ <h4>ILexer5</h4>
The new approach allows the lexer to decide whether to backtrack or to handle this
more efficiently.</p>

<p><code>AllocateSubStyles</code> returns a negative number when more
substyles are requested than is available.</p>

<p><code>NamedStyles</code>, <code>NameOfStyle</code>,
<code>TagsOfStyle</code>, and <code>DescriptionOfStyle</code>
are used to provide information on the set of styles used by this lexer.
Expand Down Expand Up @@ -8839,7 +8879,7 @@ <h2 id="Notifications">Notifications</h2>
int x; /* SCN_DWELLSTART, SCN_DWELLEND */
int y; /* SCN_DWELLSTART, SCN_DWELLEND */
int token; /* SCN_MODIFIED with SC_MOD_CONTAINER */
int annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
Sci_Position annotationLinesAdded; /* SCN_MODIFIED with SC_MOD_CHANGEANNOTATION */
int updated; /* SCN_UPDATEUI */
int listCompletionMethod;
/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION */
Expand Down
10 changes: 5 additions & 5 deletions scintilla/doc/ScintillaDownload.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr>
<td>
<font size="4"> <a href="https://www.scintilla.org/scintilla542.zip">
<font size="4"> <a href="https://www.scintilla.org/scintilla550.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/scintilla542.tgz">
<a href="https://www.scintilla.org/scintilla550.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
Expand All @@ -42,16 +42,16 @@ <h2>
containing very few restrictions.
</p>
<h3>
Release 5.4.2
Release 5.5.0
</h3>
<h4>
Source Code
</h4>
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
<li><a href="https://www.scintilla.org/scintilla542.zip">zip format</a> (1.8M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla542.tgz">tgz format</a> (1.7M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/scintilla550.zip">zip format</a> (1.8M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla550.tgz">tgz format</a> (1.7M) commonly used on Linux and compatible operating systems</li>
</ul>
Instructions for building on both Windows and Linux are included in the readme file.
<h4>
Expand Down
44 changes: 43 additions & 1 deletion scintilla/doc/ScintillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,48 @@ <h2>Contributors</h2>
</tr>
</table>
<h2>Releases</h2>
<h3>
<a href="https://www.scintilla.org/scintilla550.zip">Release 5.5.0</a>
</h3>
<ul>
<li>
Released 23 April 2024.
</li>
<li>
Add elements for inactive additional selections SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT
and SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK.
When not set these default to SC_ELEMENT_SELECTION_INACTIVE_TEXT and SC_ELEMENT_SELECTION_INACTIVE_BACK.
<a href="https://sourceforge.net/p/scintilla/bugs/2417/">Bug #2417</a>.
</li>
<li>
On Cocoa, avoid use of NSUserDefaults which will soon require justification when used in applications on the App Store.
</li>
<li>
Fix Win32 IME crash in windowed mode.
<a href="https://sourceforge.net/p/scintilla/bugs/2433/">Bug #2433</a>.
</li>
<li>
Scale reverse arrow cursor for margins to match other cursors when user changes pointer size.
<a href="https://sourceforge.net/p/scintilla/bugs/2321/">Bug #2321</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scintilla543.zip">Release 5.4.3</a>
</h3>
<ul>
<li>
Released 9 March 2024.
</li>
<li>
Fix redo failure introduced with 5.4.2.
<a href="https://sourceforge.net/p/scintilla/bugs/2432/">Bug #2432</a>.
</li>
<li>
Add SC_AUTOCOMPLETE_SELECT_FIRST_ITEM option to
always selects the first item in the autocompletion list.
<a href="https://sourceforge.net/p/scintilla/bugs/2403/">Bug #2403</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scintilla542.zip">Release 5.4.2</a>
</h3>
Expand Down Expand Up @@ -12833,7 +12875,7 @@ <h3>
Pascal lexer handles comments more correctly.
</li>
<li>
C/C++/Java/JavaScipt lexer has a state for line doc comments.
C/C++/Java/JavaScript lexer has a state for line doc comments.
</li>
<li>
Error output lexer understands Sun CC messages.
Expand Down
10 changes: 5 additions & 5 deletions scintilla/doc/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." />
<meta name="Date.Modified" content="20240305" />
<meta name="Date.Modified" content="20240423" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.logo {
Expand Down Expand Up @@ -60,8 +60,8 @@
GTK, and macOS</font>
</td>
<td width="40%" align="right">
<font color="#FFCC99" size="3"> Release version 5.4.2<br />
Site last modified March 5 2024</font>
<font color="#FFCC99" size="3"> Release version 5.5.0<br />
Site last modified April 23 2024</font>
</td>
<td width="20%">
&nbsp;
Expand All @@ -76,11 +76,11 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 5.5.0 adds elements for inactive additional selections.</li>
<li>Version 5.4.3 fixes a redo bug.</li>
<li>Version 5.4.2 can save and restore undo history.</li>
<li>Version 5.4.1 adds IDocumentEditable interface to allow efficient interaction with document objects.</li>
<li>Version 5.4.0 fixes crashes on macOS 12 and older when built with Xcode 15.0.</li>
<li>Version 5.3.8 fixes excesssive memory use when deleting contiguous ranges backwards and is compatible with new macOS 14.</li>
<li>Version 5.3.7 fixes platform-specific issues on GTK, Qt, and Win32.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
Expand Down
3 changes: 3 additions & 0 deletions scintilla/include/Scintilla.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SC_ELEMENT_SELECTION_SECONDARY_BACK 15
#define SC_ELEMENT_SELECTION_INACTIVE_TEXT 16
#define SC_ELEMENT_SELECTION_INACTIVE_BACK 17
#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT 18
#define SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK 19
#define SC_ELEMENT_CARET 40
#define SC_ELEMENT_CARET_ADDITIONAL 41
#define SC_ELEMENT_CARET_LINE_BACK 50
Expand Down Expand Up @@ -462,6 +464,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SCI_AUTOCGETAUTOHIDE 2119
#define SC_AUTOCOMPLETE_NORMAL 0
#define SC_AUTOCOMPLETE_FIXED_SIZE 1
#define SC_AUTOCOMPLETE_SELECT_FIRST_ITEM 2
#define SCI_AUTOCSETOPTIONS 2638
#define SCI_AUTOCGETOPTIONS 2639
#define SCI_AUTOCSETDROPRESTOFWORD 2270
Expand Down
4 changes: 4 additions & 0 deletions scintilla/include/Scintilla.iface
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,8 @@ val SC_ELEMENT_SELECTION_SECONDARY_TEXT=14
val SC_ELEMENT_SELECTION_SECONDARY_BACK=15
val SC_ELEMENT_SELECTION_INACTIVE_TEXT=16
val SC_ELEMENT_SELECTION_INACTIVE_BACK=17
val SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_TEXT=18
val SC_ELEMENT_SELECTION_INACTIVE_ADDITIONAL_BACK=19
val SC_ELEMENT_CARET=40
val SC_ELEMENT_CARET_ADDITIONAL=41
val SC_ELEMENT_CARET_LINE_BACK=50
Expand Down Expand Up @@ -1118,6 +1120,8 @@ enu AutoCompleteOption=SC_AUTOCOMPLETE_
val SC_AUTOCOMPLETE_NORMAL=0
# Win32 specific:
val SC_AUTOCOMPLETE_FIXED_SIZE=1
# Always select the first item in the autocompletion list:
val SC_AUTOCOMPLETE_SELECT_FIRST_ITEM=2

# Set autocompletion options.
set void AutoCSetOptions=2638(AutoCompleteOption options,)
Expand Down
3 changes: 3 additions & 0 deletions scintilla/include/ScintillaTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ enum class Element {
SelectionSecondaryBack = 15,
SelectionInactiveText = 16,
SelectionInactiveBack = 17,
SelectionInactiveAdditionalText = 18,
SelectionInactiveAdditionalBack = 19,
Caret = 40,
CaretAdditional = 41,
CaretLineBack = 50,
Expand Down Expand Up @@ -249,6 +251,7 @@ enum class IndicFlag {
enum class AutoCompleteOption {
Normal = 0,
FixedSize = 1,
SelectFirstItem = 2,
};

enum class IndentView {
Expand Down
4 changes: 2 additions & 2 deletions scintilla/src/CellBuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct CountWidths {
countOtherPlanes(countOtherPlanes_) {
}
CountWidths operator-() const noexcept {
return CountWidths(-countBasePlane , -countOtherPlanes);
return CountWidths(-countBasePlane, -countOtherPlanes);
}
Sci::Position WidthUTF32() const noexcept {
// All code points take one code unit in UTF-32.
Expand Down Expand Up @@ -833,7 +833,7 @@ void CellBuffer::BasicInsertString(Sci::Position position, const char *s, Sci::P
const Sci::Line lineStart = lineInsert;

// s may not NULL-terminated, ensure *ptr == '\n' or *next == '\n' is valid.
const char * const end = s + insertLength - 1;
const char *const end = s + insertLength - 1;
const char *ptr = s;
unsigned char ch = 0;

Expand Down
19 changes: 12 additions & 7 deletions scintilla/src/CharacterCategoryMap.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4050,12 +4050,17 @@ constexpr int maskCategory = 0x1F;
// possibly for 0..0xff for most Western European text or 0..0xfff for most
// alphabetic languages.

CharacterCategory CategoriseCharacter(int character) {
CharacterCategory CategoriseCharacter(int character) noexcept {
if (character < 0 || character > maxUnicode)
return ccCn;
const int baseValue = character * (maskCategory+1) + maskCategory;
const int *placeAfter = std::lower_bound(catRanges, std::end(catRanges), baseValue);
return static_cast<CharacterCategory>(*(placeAfter-1) & maskCategory);
try {
// lower_bound will never throw with these args but its not marked noexcept so add catch to pretend.
const int *placeAfter = std::lower_bound(catRanges, std::end(catRanges), baseValue);
return static_cast<CharacterCategory>(*(placeAfter - 1) & maskCategory);
} catch (...) {
return ccCn;
}
}

// Implementation of character sets recommended for identifiers in Unicode Standard Annex #31.
Expand Down Expand Up @@ -4158,7 +4163,7 @@ bool OmitXidContinue(int character) noexcept {

// UAX #31 defines ID_Start as
// [[:L:][:Nl:][:Other_ID_Start:]--[:Pattern_Syntax:]--[:Pattern_White_Space:]]
bool IsIdStart(int character) {
bool IsIdStart(int character) noexcept {
if (IsIdPattern(character)) {
return false;
}
Expand All @@ -4173,7 +4178,7 @@ bool IsIdStart(int character) {

// UAX #31 defines ID_Continue as
// [[:ID_Start:][:Mn:][:Mc:][:Nd:][:Pc:][:Other_ID_Continue:]--[:Pattern_Syntax:]--[:Pattern_White_Space:]]
bool IsIdContinue(int character) {
bool IsIdContinue(int character) noexcept {
if (IsIdPattern(character)) {
return false;
}
Expand All @@ -4187,7 +4192,7 @@ bool IsIdContinue(int character) {
}

// XID_Start is ID_Start modified for Normalization Form KC in UAX #31
bool IsXidStart(int character) {
bool IsXidStart(int character) noexcept {
if (OmitXidStart(character)) {
return false;
} else {
Expand All @@ -4196,7 +4201,7 @@ bool IsXidStart(int character) {
}

// XID_Continue is ID_Continue modified for Normalization Form KC in UAX #31
bool IsXidContinue(int character) {
bool IsXidContinue(int character) noexcept {
if (OmitXidContinue(character)) {
return false;
} else {
Expand Down
Loading

0 comments on commit b5b214a

Please sign in to comment.