Skip to content

Commit

Permalink
update to Scintilla 5.5.3 and Lexilla 5.4.1 and add styling for Dart,…
Browse files Browse the repository at this point in the history
… Nix, Zig, Troff and Toml languages
  • Loading branch information
stefankueng committed Nov 4, 2024
1 parent 0f69d77 commit 5d7c368
Show file tree
Hide file tree
Showing 35 changed files with 598 additions and 142 deletions.
4 changes: 2 additions & 2 deletions ext/scintilla/.hg_archival.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repo: bdf8c3ef2fb01ea24578e726337888e706d10b92
node: e175dbd62e6b83cfb77f57bc13661421946323e4
node: 71d4ce5533b402cf13c9ea2b188a8c01cd67dad0
branch: default
latesttag: rel-5-5-1
latesttag: rel-5-5-3
latesttagdistance: 1
changessincelatesttag: 1
2 changes: 2 additions & 0 deletions ext/scintilla/.hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,5 @@ d5477c63f5f60a2869a1b46cafb1687c020701f9 rel-5-4-0
c171b756efc76359f0795ca0a1bfb7eb16d4c04b rel-5-4-3
3a219b13a5d88a9e1bfe6ff76c91a07e08e59003 rel-5-5-0
26e6c52345337236815c1221c99a4540c78596c5 rel-5-5-1
8d3fb4e5905454cc46a33141d07654dddfeb3b44 rel-5-5-2
7bc37e9e9de31baf3725e083ee1b937e54856856 rel-5-5-3
2 changes: 1 addition & 1 deletion ext/scintilla/README
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Mingw-w64 is known to work. Other compilers will probably not work.
Only Scintilla will build with GTK+ on Windows. SciTE will not work.

Make builds both a static library version of Scintilla with lexers (scintilla.a) and
a shared library without lexers (libscintilla.so or or libscintilla.dll).
a shared library without lexers (libscintilla.so or libscintilla.dll).

To build Scintilla, make in the scintilla/gtk directory
cd scintilla\gtk
Expand Down
5 changes: 5 additions & 0 deletions ext/scintilla/Scintilla.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
<ClCompile Include="..\lexilla\lexers\LexCsound.cxx" />
<ClCompile Include="..\lexilla\lexers\LexCSS.cxx" />
<ClCompile Include="..\lexilla\lexers\LexD.cxx" />
<ClCompile Include="..\lexilla\lexers\LexDart.cxx" />
<ClCompile Include="..\lexilla\lexers\LexDataflex.cxx" />
<ClCompile Include="..\lexilla\lexers\LexDiff.cxx" />
<ClCompile Include="..\lexilla\lexers\LexDMAP.cxx" />
Expand Down Expand Up @@ -295,6 +296,7 @@
<ClCompile Include="..\lexilla\lexers\LexMySQL.cxx" />
<ClCompile Include="..\lexilla\lexers\LexNim.cxx" />
<ClCompile Include="..\lexilla\lexers\LexNimrod.cxx" />
<ClCompile Include="..\lexilla\lexers\LexNix.cxx" />
<ClCompile Include="..\lexilla\lexers\LexNsis.cxx" />
<ClCompile Include="..\lexilla\lexers\LexNull.cxx" />
<ClCompile Include="..\lexilla\lexers\LexOpal.cxx" />
Expand Down Expand Up @@ -333,13 +335,16 @@
<ClCompile Include="..\lexilla\lexers\LexTCL.cxx" />
<ClCompile Include="..\lexilla\lexers\LexTCMD.cxx" />
<ClCompile Include="..\lexilla\lexers\LexTeX.cxx" />
<ClCompile Include="..\lexilla\lexers\LexTOML.cxx" />
<ClCompile Include="..\lexilla\lexers\LexTroff.cxx" />
<ClCompile Include="..\lexilla\lexers\LexTxt2tags.cxx" />
<ClCompile Include="..\lexilla\lexers\LexVB.cxx" />
<ClCompile Include="..\lexilla\lexers\LexVerilog.cxx" />
<ClCompile Include="..\lexilla\lexers\LexVHDL.cxx" />
<ClCompile Include="..\lexilla\lexers\LexVisualProlog.cxx" />
<ClCompile Include="..\lexilla\lexers\LexX12.cxx" />
<ClCompile Include="..\lexilla\lexers\LexYAML.cxx" />
<ClCompile Include="..\lexilla\lexers\LexZig.cxx" />
<ClCompile Include="..\lexilla\lexlib\Accessor.cxx" />
<ClCompile Include="..\lexilla\lexlib\CharacterCategory.cxx" />
<ClCompile Include="..\lexilla\lexlib\CharacterSet.cxx" />
Expand Down
15 changes: 15 additions & 0 deletions ext/scintilla/Scintilla.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,21 @@
<ClCompile Include="..\lexilla\lexlib\InList.cxx">
<Filter>Lexilla\lexlib</Filter>
</ClCompile>
<ClCompile Include="..\lexilla\lexers\LexDart.cxx">
<Filter>Lexilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\lexilla\lexers\LexNix.cxx">
<Filter>Lexilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\lexilla\lexers\LexTOML.cxx">
<Filter>Lexilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\lexilla\lexers\LexTroff.cxx">
<Filter>Lexilla\lexers</Filter>
</ClCompile>
<ClCompile Include="..\lexilla\lexers\LexZig.cxx">
<Filter>Lexilla\lexers</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\lexilla\include\LexicalStyles.iface">
Expand Down
32 changes: 32 additions & 0 deletions ext/scintilla/call/ScintillaCall.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,14 @@ bool ScintillaCall::StyleGetCheckMonospaced(int style) {
return Call(Message::StyleGetCheckMonospaced, style);
}

void ScintillaCall::StyleSetStretch(int style, Scintilla::FontStretch stretch) {
Call(Message::StyleSetStretch, style, static_cast<intptr_t>(stretch));
}

FontStretch ScintillaCall::StyleGetStretch(int style) {
return static_cast<Scintilla::FontStretch>(Call(Message::StyleGetStretch, style));
}

void ScintillaCall::StyleSetInvisibleRepresentation(int style, const char *representation) {
CallString(Message::StyleSetInvisibleRepresentation, style, representation);
}
Expand Down Expand Up @@ -799,6 +807,10 @@ void ScintillaCall::EndUndoAction() {
Call(Message::EndUndoAction);
}

int ScintillaCall::UndoSequence() {
return static_cast<int>(Call(Message::GetUndoSequence));
}

int ScintillaCall::UndoActions() {
return static_cast<int>(Call(Message::GetUndoActions));
}
Expand Down Expand Up @@ -1975,10 +1987,18 @@ void ScintillaCall::Tab() {
Call(Message::Tab);
}

void ScintillaCall::LineIndent() {
Call(Message::LineIndent);
}

void ScintillaCall::BackTab() {
Call(Message::BackTab);
}

void ScintillaCall::LineDedent() {
Call(Message::LineDedent);
}

void ScintillaCall::NewLine() {
Call(Message::NewLine);
}
Expand Down Expand Up @@ -2723,6 +2743,18 @@ void ScintillaCall::CutAllowLine() {
Call(Message::CutAllowLine);
}

void ScintillaCall::SetCopySeparator(const char *separator) {
CallString(Message::SetCopySeparator, 0, separator);
}

int ScintillaCall::CopySeparator(char *separator) {
return static_cast<int>(CallPointer(Message::GetCopySeparator, 0, separator));
}

std::string ScintillaCall::CopySeparator() {
return CallReturnString(Message::GetCopySeparator, 0);
}

void *ScintillaCall::CharacterPointer() {
return reinterpret_cast<void *>(Call(Message::GetCharacterPointer));
}
Expand Down
27 changes: 9 additions & 18 deletions ext/scintilla/cppcheck.suppress
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
// File to suppress cppcheck warnings for files that will not be fixed.
// Does not suppress warnings where an additional occurrence of the warning may be of interest.
// Configured for cppcheck 2.11
// Configured for cppcheck 2.15

// Just a report of how many checkers are run
checkersReport

// This just warns that cppcheck isn't exhaustive and it still appears in exhaustive mode
normalCheckLevelMaxBranches

// Coding style is to use assignments in constructor when there are many
// members to initialize or the initialization is complex or has comments.
Expand Down Expand Up @@ -37,12 +43,6 @@ 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

// DLL entry points are unused inside Scintilla
unusedFunction:scintilla/win32/ScintillaDLL.cxx

// ScintillaDocument is providing an API and there are no consumers of the API inside Scintilla
unusedFunction:scintilla/qt/ScintillaEdit/ScintillaDocument.cpp

// Doesn't understand changing dropWentOutside in Editor
knownConditionTrueFalse:scintilla/win32/ScintillaWin.cxx

Expand All @@ -53,19 +53,10 @@ constParameterPointer:scintilla/win32/ScintillaWin.cxx
knownConditionTrueFalse:scintilla/src/Editor.cxx
knownConditionTrueFalse:scintilla/src/EditView.cxx

// cppcheck seems to believe that unique_ptr<T *[]>::get returns void* instead of T**
arithOperationsOnVoidPointer:scintilla/src/PerLine.cxx
arithOperationsOnVoidPointer:scintilla/src/PositionCache.cxx

// G_DEFINE_TYPE is too complex to pass to cppcheck
unknownMacro:scintilla/gtk/PlatGTK.cxx

// maskSmooth set depending on preprocessor allowing Wayland definition
badBitmaskCheck:scintilla/gtk/ScintillaGTK.cxx

// Changing events to const pointers changes signature and would require casts when hooking up
constParameterPointer:scintilla/gtk/ScintillaGTK.cxx
constParameterCallback:scintilla/gtk/ScintillaGTK.cxx
// G_END_DECLS
unknownMacro:scintilla/gtk/scintilla-marshal.h

// Difficult to test accessibility so don't change
constParameterPointer:scintilla/gtk/ScintillaGTKAccessible.cxx
Expand Down
92 changes: 90 additions & 2 deletions ext/scintilla/doc/ScintillaDoc.html
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,8 @@ <h2 id="CutCopyAndPaste">Cut, copy and paste</h2>
<a class="message" href="#SCI_CUTALLOWLINE">SCI_CUTALLOWLINE</a><br />
<a class="message" href="#SCI_SETPASTECONVERTENDINGS">SCI_SETPASTECONVERTENDINGS(bool convert)</a><br />
<a class="message" href="#SCI_GETPASTECONVERTENDINGS">SCI_GETPASTECONVERTENDINGS &rarr; bool</a><br />
<a class="message" href="#SCI_SETCOPYSEPARATOR">SCI_SETCOPYSEPARATOR(&lt;unused&gt;, const char *separator)</a><br />
<a class="message" href="#SCI_GETCOPYSEPARATOR">SCI_GETCOPYSEPARATOR(&lt;unused&gt;, char *separator) &rarr; int</a><br />
<a class="message" href="#SCI_REPLACERECTANGULAR">SCI_REPLACERECTANGULAR(position length, const char *text)</a><br />
</code>

Expand Down Expand Up @@ -1905,6 +1907,11 @@ <h2 id="CutCopyAndPaste">Cut, copy and paste</h2>
<a class="seealso" href="#SCI_SETEOLMODE">SCI_SETEOLMODE</a>.
Defaults to true.</p>

<p><b id="SCI_SETCOPYSEPARATOR">SCI_SETCOPYSEPARATOR(&lt;unused&gt;, const char *separator)</b><br />
<b id="SCI_GETCOPYSEPARATOR">SCI_GETCOPYSEPARATOR(&lt;unused&gt;, char *separator) &rarr; int</b><br />
When a multiple selection is copied, this string property is added between each part.
Defaults to empty.</p>

<p><b id="SCI_REPLACERECTANGULAR">SCI_REPLACERECTANGULAR(position length, const char *text)</b><br/>
Replaces the selected text or empty selection with the given text.
The insertion is performed similarly to rectangular pastes: new lines in the given text are interpreted as
Expand All @@ -1929,6 +1936,7 @@ <h2 id="UndoAndRedo">Undo and Redo</h2>
<a class="message" href="#SCI_GETUNDOCOLLECTION">SCI_GETUNDOCOLLECTION &rarr; bool</a><br />
<a class="message" href="#SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</a><br />
<a class="message" href="#SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</a><br />
<a class="message" href="#SCI_GETUNDOSEQUENCE">SCI_GETUNDOSEQUENCE &rarr; int</a><br />
<a class="message" href="#SCI_ADDUNDOACTION">SCI_ADDUNDOACTION(int token, int flags)</a><br />
</code>

Expand Down Expand Up @@ -1972,11 +1980,17 @@ <h2 id="UndoAndRedo">Undo and Redo</h2>

<p><b id="SCI_BEGINUNDOACTION">SCI_BEGINUNDOACTION</b><br />
<b id="SCI_ENDUNDOACTION">SCI_ENDUNDOACTION</b><br />
Send these two messages to Scintilla to mark the beginning and end of a set of operations that
Send these two messages to Scintilla to mark the beginning and end of a sequence of operations that
you want to undo all as one operation but that you have to generate as several operations.
Alternatively, you can use these to mark a set of operations that you do not want to have
combined with the preceding or following operations if they are undone.</p>

<p><b id="SCI_GETUNDOSEQUENCE">SCI_GETUNDOSEQUENCE &rarr; int</b><br />
Determine if an undo sequence is active with a positive value indicating that a sequence is active and 0 that there is no current sequence.
The value returned is the nesting depth of the sequence, that is, the number of times <code>SCI_BEGINUNDOACTION</code>
was called without a correspnding <code>SCI_ENDUNDOACTION</code>.
A negative value indicates an error.</p>

<p><b id="SCI_ADDUNDOACTION">SCI_ADDUNDOACTION(int token, int flags)</b><br />
The container can add its own actions into the undo stack by calling
<code>SCI_ADDUNDOACTION</code> and an <code>SCN_MODIFIED</code>
Expand Down Expand Up @@ -3334,6 +3348,8 @@ <h2 id="StyleDefinition">Style definition</h2>
<a class="message" href="#SCI_STYLESETWEIGHT">SCI_STYLESETWEIGHT(int style, int
weight)</a><br />
<a class="message" href="#SCI_STYLEGETWEIGHT">SCI_STYLEGETWEIGHT(int style) &rarr; int</a><br />
<a class="message" href="#SCI_STYLESETSTRETCH">SCI_STYLESETSTRETCH(int style, int stretch)</a><br />
<a class="message" href="#SCI_STYLEGETSTRETCH">SCI_STYLEGETSTRETCH(int style) &rarr; int</a><br />
<a class="message" href="#SCI_STYLESETITALIC">SCI_STYLESETITALIC(int style, bool
italic)</a><br />
<a class="message" href="#SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int style) &rarr; bool</a><br />
Expand Down Expand Up @@ -3393,6 +3409,8 @@ <h2 id="StyleDefinition">Style definition</h2>
<b id="SCI_STYLEGETBOLD">SCI_STYLEGETBOLD(int style) &rarr; bool</b><br />
<b id="SCI_STYLESETWEIGHT">SCI_STYLESETWEIGHT(int style, int weight)</b><br />
<b id="SCI_STYLEGETWEIGHT">SCI_STYLEGETWEIGHT(int style) &rarr; int</b><br />
<b id="SCI_STYLESETSTRETCH">SCI_STYLESETSTRETCH(int style, int stretch)</b><br />
<b id="SCI_STYLEGETSTRETCH">SCI_STYLEGETSTRETCH(int style) &rarr; int</b><br />
<b id="SCI_STYLESETITALIC">SCI_STYLESETITALIC(int style, bool italic)</b><br />
<b id="SCI_STYLEGETITALIC">SCI_STYLEGETITALIC(int style) &rarr; bool</b><br />
These messages (plus <a class="message"
Expand Down Expand Up @@ -3421,6 +3439,68 @@ <h2 id="StyleDefinition">Style definition</h2>
The <code>SCI_STYLESETBOLD</code> message takes a boolean argument with 0 choosing <code>SC_WEIGHT_NORMAL</code>
and 1 <code>SC_WEIGHT_BOLD</code>.
</p>
<p>The stretch of a font can be set with <code>SCI_STYLESETSTRETCH</code> which can produce condensed or expanded text.
The weight is a number between 1 and 9 which corresponds to a horizontal magnification between 50% and 200%
with 1 being very condensed, 5 normal, and 9 very expanded.
While any value can be used, fonts and platforms often only support between 2 and 3 stretches.
The best supported and useful values are
<code>SC_STRETCH_CONDENSED</code>,
<code>SC_STRETCH_NORMAL</code>, and
<code>SC_STRETCH_EXPANDED</code>.
The Inconsolata variable font supports many stretch values and can be useful for experimenting.
Condensed text can be used to display more text in a narrower window and expanded text may be used
for clearer text that is easier to read.
The API is based on the Cascading Style Sheets font-stretch property.
</p>
<table class="standard" summary="Stretch">
<tbody valign="top">
<tr>
<th align="left"><code>SC_STRETCH_ULTRA_CONDENSED</code></th>
<td>1</td>
<td>50%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_EXTRA_CONDENSED</code></th>
<td>2</td>
<td>62.5%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_CONDENSED</code></th>
<td>3</td>
<td>75%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_SEMI_CONDENSED</code></th>
<td>4</td>
<td>87.5%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_NORMAL</code></th>
<td>5</td>
<td>100%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_SEMI_EXPANDED</code></th>
<td>6</td>
<td>112.5%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_EXPANDED</code></th>
<td>7</td>
<td>125%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_EXTRA_EXPANDED</code></th>
<td>8</td>
<td>150%</td>
</tr>
<tr>
<th align="left"><code>SC_STRETCH_ULTRA_EXPANDED</code></th>
<td>9</td>
<td>200%</td>
</tr>
</tbody>
</table>

<p><b id="SCI_STYLESETUNDERLINE">SCI_STYLESETUNDERLINE(int style, bool
underline)</b><br />
Expand Down Expand Up @@ -6288,6 +6368,8 @@ <h2 id="Autocompletion">Autocompletion</h2>
<a class="message" href="#SCI_AUTOCGETMAXHEIGHT">SCI_AUTOCGETMAXHEIGHT &rarr; int</a><br />
<a class="message" href="#SCI_AUTOCSETMAXWIDTH">SCI_AUTOCSETMAXWIDTH(int characterCount)</a><br />
<a class="message" href="#SCI_AUTOCGETMAXWIDTH">SCI_AUTOCGETMAXWIDTH &rarr; int</a><br />
<a class="message" href="#SCI_AUTOCSETSTYLE">SCI_AUTOCSETSTYLE(int style)</a><br />
<a class="message" href="#SCI_AUTOCGETSTYLE">SCI_AUTOCGETSTYLE &rarr; int</a><br />
<a class="element" href="#SC_ELEMENT_LIST">SC_ELEMENT_LIST : colouralpha</a><br />
<a class="element" href="#SC_ELEMENT_LIST_BACK">SC_ELEMENT_LIST_BACK : colouralpha</a><br />
<a class="element" href="#SC_ELEMENT_LIST_SELECTED">SC_ELEMENT_LIST_SELECTED : colouralpha</a><br />
Expand Down Expand Up @@ -6510,7 +6592,7 @@ <h2 id="Autocompletion">Autocompletion</h2>
</p>

<p>
<b id="SCI_AUTOCSETSTYLE">SCI_AUTOCSETSTYLE</b><br />
<b id="SCI_AUTOCSETSTYLE">SCI_AUTOCSETSTYLE(int style)</b><br />
<b id="SCI_AUTOCGETSTYLE">SCI_AUTOCGETSTYLE &rarr; int</b><br />

Get or set the style used by autocompletion lists to determine the font facename, size and character set used to display characters. Defaults
Expand Down Expand Up @@ -6913,6 +6995,9 @@ <h2 id="KeyboardCommands">Keyboard commands</h2>

<td><code>SCI_VERTICALCENTRECARET</code></td>

<td><code>SCI_LINEINDENT</code></td>

<td><code>SCI_LINEDEDENT</code></td>
</tr>

<tr>
Expand Down Expand Up @@ -6955,6 +7040,9 @@ <h2 id="KeyboardCommands">Keyboard commands</h2>
as appropriate for <code>SCI_[[VC]HOME|LINEEND]*</code>.
</p>

<p>The <code>SCI_LINE[INDENT|DEDENT]</code> commands are like <code>SCI_[BACK]TAB</code> but force the
multiline behaviour of the second.</p>

<p>The <code>SCI_SCROLLTO[START|END]</code> commands scroll the document to the start
or end without changing the selection. These commands match macOS platform conventions for the behaviour of the
<code>home</code> and <code>end</code> keys. Scintilla can be made to match macOS applications
Expand Down
10 changes: 5 additions & 5 deletions ext/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/scintilla551.zip">
<font size="4"> <a href="https://www.scintilla.org/scintilla553.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/scintilla551.tgz">
<a href="https://www.scintilla.org/scintilla553.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
Expand All @@ -42,16 +42,16 @@ <h2>
containing very few restrictions.
</p>
<h3>
Release 5.5.1
Release 5.5.3
</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/scintilla551.zip">zip format</a> (1.8M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla551.tgz">tgz format</a> (1.7M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/scintilla553.zip">zip format</a> (1.8M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla553.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
Loading

2 comments on commit 5d7c368

@wmjordan
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you forgotten to update the sub-modules?

@stefankueng
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I did

Please sign in to comment.