+upd: Scintilla v5.3.6

+chg: "Dot matches all" -> "Dot matches line-breaks" (like NP++)
This commit is contained in:
METANEOCORTEX\Kotti 2023-09-13 17:36:02 +02:00
parent 8ee22b6ae3
commit f9df6977a1
19 changed files with 285 additions and 170 deletions

View File

@ -96,7 +96,7 @@ BEGIN
CONTROL "Nur Wort-Anf&änge",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,110,10
CONTROL "&Transformiere Backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,73,100,10
CONTROL "&Regulärer Ausdruck",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,96,10
CONTROL "&Punkt ersetzt Alle",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,70,10
CONTROL "&Punkt ersetzt Zeilenumbruch",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,100,10
CONTROL "&Kein Wrap-Around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,37,75,10
CONTROL "Schließe nach Fund",IDC_FINDCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,49,75,10
CONTROL "&Markiere Auftreten",IDC_ALL_OCCURRENCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,61,75,10
@ -130,7 +130,7 @@ BEGIN
CONTROL "Nur Wort-Anf&änge",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,110,10
CONTROL "&Transformiere Backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,100,10
CONTROL "&Regulärer Ausdruck",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,114,96,10
CONTROL "&Punkt ersetzt Alle",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,125,70,10
CONTROL "&Punkt ersetzt Zeilenumbruch",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,125,100,10
CONTROL "&Kein Wrap-Around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,66,75,10
CONTROL "Schließe nach Fund",IDC_FINDCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,78,77,10
CONTROL "&Markiere Auftreten",IDC_ALL_OCCURRENCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,90,73,10

View File

@ -96,7 +96,7 @@ BEGIN
CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,61,110,10
CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,73,85,10
CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,85,96,10
CONTROL "Dot &matches all",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,65,10
CONTROL "Dot &matches line-breaks",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,96,90,10
CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,37,75,10
CONTROL "C&lose after find",IDC_FINDCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,49,65,10
CONTROL "Mar&k Occurrences",IDC_ALL_OCCURRENCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,61,73,10
@ -130,7 +130,7 @@ BEGIN
CONTROL "Match &beginning of word only",IDC_FINDSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,90,110,10
CONTROL "&Transform backslashes",IDC_FINDTRANSFORMBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,102,89,10
CONTROL "Regular &expression search",IDC_FINDREGEXP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,114,97,10
CONTROL "Dot &matches all",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,125,65,10
CONTROL "Dot &matches line-breaks",IDC_DOT_MATCH_ALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,125,90,10
CONTROL "&Don't wrap around",IDC_NOWRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,66,75,10
CONTROL "C&lose after replace",IDC_FINDCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,78,77,10
CONTROL "Mar&k Occurrences",IDC_ALL_OCCURRENCES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,125,90,73,10

View File

@ -1,5 +1,6 @@
// 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
// Coding style is to use assignments in constructor when there are many
// members to initialize or the initialization is complex or has comments.
@ -13,6 +14,12 @@ useStlAlgorithm
// Written with variable for consistency
knownArgument:scintilla/src/SparseVector.h
// cppcheck 2.11 can't find system headers on Win32.
missingIncludeSystem
// cppcheck 2.11 limits checking of complex functions unless --check-level=exhaustive
checkLevelNormal:scintilla/src/Editor.cxx
// The cast converts from 'unsigned char ' to 'char' so isn't unused.
// Redundant code: Found unused cast of expression 'leadByte'
constStatement:scintilla/src/Document.cxx
@ -30,31 +37,42 @@ unusedFunction:scintilla/win32/ScintillaDLL.cxx
unusedFunction:scintilla/qt/ScintillaEdit/ScintillaDocument.cpp
// Doesn't understand changing dropWentOutside in Editor
knownConditionTrueFalse:scintilla/qt/ScintillaEditBase/ScintillaQt.cpp
knownConditionTrueFalse:scintilla/win32/ScintillaWin.cxx
// GetData is implementing interface so shouldn't add const
constParameterPointer:scintilla/win32/ScintillaWin.cxx
// Doesn't handle intptr_t (long long) being signed
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
// Cppcheck wrongly assumes string_view::remove_prefix can not empty the view
knownConditionTrueFalse:scintilla/src/CallTip.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
// Difficult to test accessibility so don't change
constVariable:scintilla/gtk/ScintillaGTKAccessible.cxx
// Have no way of testing ScintillaEdit so don't fix even simple warnings
cstyleCast:scintilla/qt/ScintillaEdit/ScintillaEdit.cpp
shadowFunction:scintilla/qt/ScintillaEdit/ScintillaEdit.cpp
// cppcheck fails emit from Qt
shadowFunction:scintilla/qt/ScintillaEditBase/ScintillaQt.cpp
shadowFunction:scintilla/qt/ScintillaEditBase/ScintillaEditBase.cpp
constParameterPointer:scintilla/gtk/ScintillaGTKAccessible.cxx
constVariableReference:scintilla/gtk/ScintillaGTKAccessible.cxx
constVariablePointer:scintilla/gtk/ScintillaGTKAccessible.cxx
// moc_ files show #error as they are not built with standard context
preprocessorErrorDirective:scintilla/qt/*.cpp
// moc_ files are not understood by cppcheck
noValidConfiguration
// Doesn't understand Qt slots macro
unknownMacro:scintilla/qt/ScintillaEditBase/*.h
// The performance cost of by-value passing is often small and using a reference decreases
// code legibility.

View File

@ -1347,7 +1347,7 @@ struct Sci_TextToFindFull {
Coalescing treats coalescible container actions as transparent so will still only group together insertions that
look like typing or deletions that look like multiple uses of the Backspace or Delete keys.
</p>
<h2 id="ChangeHistory">Change history</h2>
<p>Scintilla can display document changes (modified, saved, ...) in the margin or in the text.</p>
@ -3366,114 +3366,114 @@ struct Sci_TextToFindFull {
<tbody>
<tr>
<td><code>SC_CHARSET_ANSI</code></td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003; (8859-1)</td></tr>
<td>&check;</td>
<td>&check;</td>
<td>&check; (8859-1)</td></tr>
<tr>
<td><code>SC_CHARSET_ARABIC</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_BALTIC</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_CHINESEBIG5</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_DEFAULT</code></td>
<td>&#10003;</td>
<td>&#10003; (8859-1)</td>
<td>&#10003; (8859-1)</td></tr>
<td>&check;</td>
<td>&check; (8859-1)</td>
<td>&check; (8859-1)</td></tr>
<tr>
<td><code>SC_CHARSET_EASTEUROPE</code></td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003;</td></tr>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_GB2312</code></td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003;</td></tr>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_GREEK</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_HANGUL</code></td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003;</td></tr>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_HEBREW</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_JOHAB</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_MAC</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_OEM</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_RUSSIAN</code></td>
<td>&#10003; (cp1251)</td>
<td>&#10003; (koi8-r)</td>
<td>&#10003; (cp1251)</td></tr>
<td>&check; (cp1251)</td>
<td>&check; (koi8-r)</td>
<td>&check; (cp1251)</td></tr>
<tr>
<td><code>SC_CHARSET_SHIFTJIS</code></td>
<td>&#10003;</td>
<td>&#10003;</td>
<td>&#10003;</td></tr>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_SYMBOL</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_THAI</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_TURKISH</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_VIETNAMESE</code></td>
<td>&#10003;</td>
<td>&check;</td>
<td></td>
<td>&#10003;</td></tr>
<td>&check;</td></tr>
<tr>
<td><code>SC_CHARSET_OEM866</code></td>
<td></td>
<td>&#10003; (cp866)</td>
<td>&check; (cp866)</td>
<td></td></tr>
<tr>
<td><code>SC_CHARSET_CYRILLIC</code></td>
<td></td>
<td>&#10003; (cp1251)</td>
<td>&#10003; (cp1251)</td></tr>
<td>&check; (cp1251)</td>
<td>&check; (cp1251)</td></tr>
<tr>
<td><code>SC_CHARSET_8859_15</code></td>
<td></td>
<td>&#10003;</td>
<td>&#10003;</td></tr>
<td>&check;</td>
<td>&check;</td></tr>
</tbody></table>
<p><b id="SCI_STYLESETCASE">SCI_STYLESETCASE(int style, int caseVisible)</b><br />
@ -4882,12 +4882,12 @@ struct Sci_TextToFindFull {
rectangular and multiple selection, with IME interactions such as retrieve-surrounding or reconversion feature.</p>
<table class="standard" summary="IME input method">
<caption>IME input method support (O=present, X=absent)</caption>
<caption>IME input method support</caption>
<thead align="left">
<tr>
<th>IME input method</th>
<th>Windows</th>
<th>Gtk</th>
<th>GTK</th>
<th>Qt</th>
<th>macOS</th>
</tr>
@ -4895,17 +4895,17 @@ struct Sci_TextToFindFull {
<tbody valign="top">
<tr>
<th align="left"><code>SC_IME_WINDOWED</code></th>
<td>O</td>
<td>O</td>
<td>X</td>
<td>X</td>
<td>&check;</td>
<td>&check;</td>
<td> </td>
<td> </td>
</tr>
<tr>
<th align="left"><code>SC_IME_INLINE</code></th>
<td>O</td>
<td>O</td>
<td>O</td>
<td>O</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
</tr>
</tbody>
</table>
@ -4917,7 +4917,7 @@ struct Sci_TextToFindFull {
<tr>
<th>IME interaction</th>
<th>Windows</th>
<th>Gtk</th>
<th>GTK</th>
<th>Qt</th>
<th>macOS</th>
</tr>
@ -4925,24 +4925,24 @@ struct Sci_TextToFindFull {
<tbody valign="top">
<tr>
<th align="left">Retrieve Surrounding</th>
<td>O</td>
<td>O</td>
<td>O</td>
<td>O</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
</tr>
<tr>
<th align="left">Reconversion</th>
<td>O</td>
<td>O</td>
<td>O</td>
<td>O</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
</tr>
<tr>
<th align="left">Delete Surrounding</th>
<td>O</td>
<td>O</td>
<td>X</td>
<td>O</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
<td>&check;</td>
</tr>
</tbody>
</table>
@ -4979,7 +4979,7 @@ struct Sci_TextToFindFull {
</p>
<p>Opaque selection drawing (<a class="seealso" href="#SCI_SETSELECTIONLAYER">SCI_SETSELECTIONLAYER(SC_LAYER_BASE)</a>)
is not supported in bidirectional mode.
Use <code>SC_LAYER_UNDER_TEXT</code> or <code>SC_LAYER_OVER_TEXT</code> instead.
Use <code>SC_LAYER_UNDER_TEXT</code> or <code>SC_LAYER_OVER_TEXT</code> instead.
</p>
</div>
@ -9683,7 +9683,7 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
<td align="center">6</td>
<td>There was only a single choice in the list and 'choose single' mode was active as set by
<td>There was only a single choice in the list and 'choose single' mode was active as set by
<code>
<a class="seealso" href="#SCI_AUTOCSETCHOOSESINGLE">SCI_AUTOCSETCHOOSESINGLE</a></code>. ch is 0.</td>

View File

@ -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/scintilla535.zip">
<font size="4"> <a href="https://www.scintilla.org/scintilla536.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/scintilla535.tgz">
<a href="https://www.scintilla.org/scintilla536.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
@ -42,7 +42,7 @@
containing very few restrictions.
</p>
<h3>
Release 5.3.5
Release 5.3.6
</h3>
<h4>
Source Code
@ -50,8 +50,8 @@
The source code package contains all of the source code for Scintilla but no binary
executable code and is available in
<ul>
<li><a href="https://www.scintilla.org/scintilla535.zip">zip format</a> (1.4M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla535.tgz">tgz format</a> (1.3M) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/scintilla536.zip">zip format</a> (1.4M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla536.tgz">tgz format</a> (1.3M) 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>

View File

@ -578,15 +578,44 @@
<td>Enrico Tröger</td>
</tr><tr>
<td>Chengzhi Li</td>
<td>Gary James</td>
<td>Tsuyoshi Miyake</td>
</tr>
</table>
<h2>Releases</h2>
<h3>
<a href="https://www.scintilla.org/scintilla537.zip">Release 5.3.7</a>
</h3>
<ul>
<li>
Released 26 July 2023.
</li>
<li>
For GTK on macOS, fix popup window behaviour by setting type hints.
<a href="https://sourceforge.net/p/scintilla/bugs/2401/">Bug #2401</a>.
</li>
<li>
For GTK, fix assertion failure on some systems when an INDIC_SQUIGGLEPIXMAP drawn
for a zero-width character.
</li>
<li>
For Qt, allow parent window to handle context menu events by setting as ignored.
<a href="https://sourceforge.net/p/scintilla/bugs/2395/">Bug #2395</a>.
</li>
<li>
For Qt, fix potential crash when using IME with large amount of text selected.
</li>
<li>
For Windows, fix building with non-English environment.
<a href="https://sourceforge.net/p/scintilla/bugs/2400/">Bug #2400</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scintilla536.zip">Release 5.3.6</a>
</h3>
<ul>
<li>
Released 31 May 2023.
Released 26 July 2023.
</li>
<li>
Redraw calltip after showing as didn't update when size of new text exactly same as
@ -594,10 +623,22 @@
<a href="https://sourceforge.net/p/scintilla/feature-requests/1486/">Feature #1486</a>.
</li>
<li>
On Win32 fix reverse arrow cursor when scaled.
<a href="https://sourceforge.net/p/scintilla/bugs/2382/">Bug #2382</a>.
</li>
<li>
On Win32 hide cursor when typing if that system preference has been chosen.
<a href="https://sourceforge.net/p/scintilla/bugs/2333/">Bug #2333</a>.
</li>
<li>
On Win32 and Qt, stop aligning IME candidate window to target.
It is now always aligned to start of composition string.
This undoes part of feature #1300.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1488/">Feature #1488</a>,
<a href="https://sourceforge.net/p/scintilla/bugs/2391/">Bug #2391</a>,
<a href="https://sourceforge.net/p/scintilla/feature-requests/1300/">Feature #1300</a>.
</li>
<li>
On Qt, for IMEs, update micro focus when selection changes.
This may move the location of IME popups to align with the caret.
</li>

View File

@ -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="20230531" />
<meta name="Date.Modified" content="20230726" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
.logo {
@ -60,8 +60,8 @@
GTK, and macOS</font>
</td>
<td width="40%" align="right">
<font color="#FFCC99" size="3"> Release version 5.3.5<br />
Site last modified May 31 2023</font>
<font color="#FFCC99" size="3"> Release version 5.3.6<br />
Site last modified July 26 2023</font>
</td>
<td width="20%">
&nbsp;
@ -76,12 +76,11 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 5.3.6 improves cursor behaviour on Win32 and IME support on Win32 and Qt.</li>
<li>Version 5.3.5 improves IME support on Win32 and Qt.</li>
<li>Version 5.3.4 adds multithreaded wrapping.</li>
<li>Version 5.3.3 fixes minor bugs in APIs and platform layers.</li>
<li>Version 5.3.2 adds SCI_REPLACETARGETMINIMAL to modify text without marking unchanged start and end text in change history.</li>
<li>Version 5.3.1 can represent invisible text with a character to simplify editing and provide summarized views.</li>
<li>Version 5.3.0 adds change history.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>

View File

@ -171,7 +171,7 @@ class LineVector : public ILineVector {
return static_cast<POS>(pos);
}
// line_from_pos_cast(): return 32-bit or 64-bit value as Sci::Line
// line_from_pos_cast(): return 32-bit or 64-bit value as Sci::Line
// This avoids warnings from Visual C++ Code Analysis and shortens code
static constexpr Sci::Line line_from_pos_cast(POS line) noexcept {
return static_cast<Sci::Line>(line);

View File

@ -209,7 +209,7 @@ void ChangeLog::SetSavePoint() {
}
startRun = endRun;
}
for (Sci::Position positionDeletion = 0; positionDeletion <= length;) {
const EditionSetOwned &editions = deleteEdition.ValueAt(positionDeletion);
if (editions) {

View File

@ -911,7 +911,7 @@ SelectionPosition Editor::MovePositionSoVisible(Sci::Position pos, int moveDir)
}
Point Editor::PointMainCaret() {
return LocationFromPosition(sel.Range(sel.Main()).caret);
return LocationFromPosition(sel.RangeMain().caret);
}
/**
@ -3274,7 +3274,7 @@ void Editor::CursorUpOrDown(int direction, Selection::SelTypes selt) {
if ((selt == Selection::SelTypes::none) && sel.MoveExtends()) {
selt = !sel.IsRectangular() ? Selection::SelTypes::stream : Selection::SelTypes::rectangle;
}
SelectionPosition caretToUse = sel.Range(sel.Main()).caret;
SelectionPosition caretToUse = sel.RangeMain().caret;
if (sel.IsRectangular()) {
if (selt == Selection::SelTypes::none) {
caretToUse = (direction > 0) ? sel.Limits().end : sel.Limits().start;
@ -3298,7 +3298,7 @@ void Editor::CursorUpOrDown(int direction, Selection::SelTypes selt) {
// Calculate new caret position and call SetSelection(), which will ensure whole lines are selected.
const SelectionPosition posNew = MovePositionSoVisible(
PositionUpOrDown(caretToUse, direction, -1), direction);
SetSelection(posNew, sel.Range(sel.Main()).anchor);
SetSelection(posNew, sel.RangeMain().anchor);
} else {
InvalidateWholeSelection();
if (!additionalSelectionTyping || (sel.IsRectangular())) {

View File

@ -539,7 +539,7 @@ bool LineTabstops::AddTabstop(Sci::Line line, int x) {
int LineTabstops::GetNextTabstop(Sci::Line line, int x) const noexcept {
if (line < tabstops.Length()) {
TabstopList *tl = tabstops[line].get();
const TabstopList *tl = tabstops[line].get();
if (tl) {
for (const int i : *tl) {
if (i > x) {

View File

@ -1 +1 @@
535
536

View File

@ -99,7 +99,7 @@ class HanjaDic {
IHanjaDic *instance = nullptr;
hr = CoCreateInstance(CLSID_HanjaDic, nullptr,
CLSCTX_INPROC_SERVER, IID_IHanjaDic,
(LPVOID *)&instance);
reinterpret_cast<LPVOID *>(&instance));
if (SUCCEEDED(hr) && instance) {
HJinterface.reset(instance);
hr = instance->OpenMainDic();

View File

@ -177,6 +177,9 @@ GetWindowDpiAwarenessContextSig fnGetWindowDpiAwarenessContext = nullptr;
using GetScaleFactorForMonitorSig = HRESULT(WINAPI *)(HMONITOR, DEVICE_SCALE_FACTOR *);
GetScaleFactorForMonitorSig fnGetScaleFactorForMonitor = nullptr;
using GetThreadDpiAwarenessContextSig = DPI_AWARENESS_CONTEXT(WINAPI *)();
GetThreadDpiAwarenessContextSig fnGetThreadDpiAwarenessContext = nullptr;
using SetThreadDpiAwarenessContextSig = DPI_AWARENESS_CONTEXT(WINAPI *)(DPI_AWARENESS_CONTEXT);
SetThreadDpiAwarenessContextSig fnSetThreadDpiAwarenessContext = nullptr;
@ -185,6 +188,7 @@ void LoadDpiForWindow() noexcept {
fnGetDpiForWindow = DLLFunction<GetDpiForWindowSig>(user32, "GetDpiForWindow");
fnGetSystemMetricsForDpi = DLLFunction<GetSystemMetricsForDpiSig>(user32, "GetSystemMetricsForDpi");
fnAdjustWindowRectExForDpi = DLLFunction<AdjustWindowRectExForDpiSig>(user32, "AdjustWindowRectExForDpi");
fnGetThreadDpiAwarenessContext = DLLFunction<GetThreadDpiAwarenessContextSig>(user32, "GetThreadDpiAwarenessContext");
fnSetThreadDpiAwarenessContext = DLLFunction<SetThreadDpiAwarenessContextSig>(user32, "SetThreadDpiAwarenessContext");
using GetDpiForSystemSig = UINT(WINAPI *)(void);
@ -527,7 +531,7 @@ HMONITOR MonitorFromWindowHandleScaling(HWND hWnd) noexcept {
return monitor;
}
int GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept {
float GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept {
if (fnAreDpiAwarenessContextsEqual) {
PLATFORM_ASSERT(fnGetWindowDpiAwarenessContext && fnGetScaleFactorForMonitor);
if (fnAreDpiAwarenessContextsEqual(DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED, fnGetWindowDpiAwarenessContext(hWnd))) {
@ -535,10 +539,10 @@ int GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept {
const HMONITOR hMonitor = MonitorFromWindowHandleScaling(hRootWnd);
DEVICE_SCALE_FACTOR deviceScaleFactor;
if (S_OK == fnGetScaleFactorForMonitor(hMonitor, &deviceScaleFactor))
return (static_cast<int>(deviceScaleFactor) + 99) / 100; // increase to first integral multiple of 1
return static_cast<float>(deviceScaleFactor) / 100.f;
}
}
return 1;
return 1.f;
}
@ -630,7 +634,7 @@ class VarBuffer {
T bufferStandard[lengthStandard];
public:
T *buffer;
explicit VarBuffer(size_t length) : buffer(nullptr) {
explicit VarBuffer(size_t length) : bufferStandard{{}}, buffer(nullptr) {
if (length > lengthStandard) {
buffer = new T[length];
} else {
@ -3002,56 +3006,102 @@ void Window::InvalidateRectangle(PRectangle rc) {
::InvalidateRect(HwndFromWindowID(wid), &rcw, FALSE);
}
namespace {
void FlipBitmap(HBITMAP bitmap, int width, int height) noexcept {
HDC hdc = ::CreateCompatibleDC({});
if (hdc) {
HBITMAP prevBmp = SelectBitmap(hdc, bitmap);
::StretchBlt(hdc, width - 1, 0, -width, height, hdc, 0, 0, width, height, SRCCOPY);
SelectBitmap(hdc, prevBmp);
::DeleteDC(hdc);
}
}
}
HCURSOR LoadReverseArrowCursor(UINT dpi) noexcept {
HCURSOR reverseArrowCursor {};
bool created = false;
HCURSOR cursor = ::LoadCursor({}, IDC_ARROW);
if (dpi != uSystemDPI) {
const int width = SystemMetricsForDpi(SM_CXCURSOR, dpi);
const int height = SystemMetricsForDpi(SM_CYCURSOR, dpi);
HCURSOR copy = static_cast<HCURSOR>(::CopyImage(cursor, IMAGE_CURSOR, width, height, LR_COPYFROMRESOURCE | LR_COPYRETURNORG));
if (copy) {
created = copy != cursor;
cursor = copy;
class CursorHelper {
public:
ICONINFO info{};
BITMAP bmp{};
bool HasBitmap() const noexcept {
return bmp.bmWidth > 0;
}
}
ICONINFO info;
if (::GetIconInfo(cursor, &info)) {
BITMAP bmp {};
if (::GetObject(info.hbmMask, sizeof(bmp), &bmp)) {
FlipBitmap(info.hbmMask, bmp.bmWidth, bmp.bmHeight);
CursorHelper(const HCURSOR cursor) noexcept {
Init(cursor);
}
~CursorHelper() {
CleanUp();
}
CursorHelper &operator=(const HCURSOR cursor) noexcept {
CleanUp();
Init(cursor);
return *this;
}
bool MatchesSize(const int width, const int height) noexcept {
return bmp.bmWidth == width && bmp.bmHeight == height;
}
HCURSOR CreateFlippedCursor() noexcept {
if (info.hbmMask)
FlipBitmap(info.hbmMask, bmp.bmWidth, bmp.bmHeight);
if (info.hbmColor)
FlipBitmap(info.hbmColor, bmp.bmWidth, bmp.bmHeight);
info.xHotspot = bmp.bmWidth - 1 - info.xHotspot;
reverseArrowCursor = ::CreateIconIndirect(&info);
return ::CreateIconIndirect(&info);
}
::DeleteObject(info.hbmMask);
if (info.hbmColor)
::DeleteObject(info.hbmColor);
private:
void Init(const HCURSOR &cursor) noexcept {
if (::GetIconInfo(cursor, &info)) {
::GetObject(info.hbmMask, sizeof(bmp), &bmp);
PLATFORM_ASSERT(HasBitmap());
}
}
void CleanUp() noexcept {
if (info.hbmMask)
::DeleteObject(info.hbmMask);
if (info.hbmColor)
::DeleteObject(info.hbmColor);
info = {};
bmp = {};
}
static void FlipBitmap(const HBITMAP bitmap, const int width, const int height) noexcept {
HDC hdc = ::CreateCompatibleDC({});
if (hdc) {
HBITMAP prevBmp = SelectBitmap(hdc, bitmap);
::StretchBlt(hdc, width - 1, 0, -width, height, hdc, 0, 0, width, height, SRCCOPY);
SelectBitmap(hdc, prevBmp);
::DeleteDC(hdc);
}
}
};
HCURSOR reverseArrowCursor {};
const int width = SystemMetricsForDpi(SM_CXCURSOR, dpi);
const int height = SystemMetricsForDpi(SM_CYCURSOR, dpi);
DPI_AWARENESS_CONTEXT oldContext = nullptr;
if (fnAreDpiAwarenessContextsEqual && fnAreDpiAwarenessContextsEqual(fnGetThreadDpiAwarenessContext(), DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED)) {
oldContext = fnSetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
PLATFORM_ASSERT(oldContext != nullptr);
}
if (created) {
::DestroyCursor(cursor);
const HCURSOR cursor = static_cast<HCURSOR>(::LoadImage({}, IDC_ARROW, IMAGE_CURSOR, width, height, LR_SHARED));
if (cursor) {
CursorHelper cursorHelper(cursor);
if (cursorHelper.HasBitmap() && !cursorHelper.MatchesSize(width, height)) {
const HCURSOR copy = static_cast<HCURSOR>(::CopyImage(cursor, IMAGE_CURSOR, width, height, LR_COPYFROMRESOURCE | LR_COPYRETURNORG));
if (copy) {
cursorHelper = copy;
::DestroyCursor(copy);
}
}
if (cursorHelper.HasBitmap()) {
reverseArrowCursor = cursorHelper.CreateFlippedCursor();
}
}
if (oldContext) {
fnSetThreadDpiAwarenessContext(oldContext);
}
return reverseArrowCursor;
}

View File

@ -46,7 +46,7 @@ void SetWindowPointer(HWND hWnd, void *ptr) noexcept;
HMONITOR MonitorFromWindowHandleScaling(HWND hWnd) noexcept;
UINT DpiForWindow(WindowID wid) noexcept;
int GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept;
float GetDeviceScaleFactorWhenGdiScalingActive(HWND hWnd) noexcept;
int SystemMetricsForDpi(int nIndex, UINT dpi) noexcept;

View File

@ -6,8 +6,8 @@
#include <windows.h>
#define VERSION_SCINTILLA "5.3.5"
#define VERSION_WORDS 5, 3, 5, 0
#define VERSION_SCINTILLA "5.3.6"
#define VERSION_WORDS 5, 3, 6, 0
VS_VERSION_INFO VERSIONINFO
FILEVERSION VERSION_WORDS

View File

@ -366,7 +366,10 @@ class ScintillaWin :
static ATOM scintillaClassAtom;
static ATOM callClassAtom;
int deviceScaleFactor = 1;
float deviceScaleFactor = 1.f;
int GetFirstIntegralMultipleDeviceScaleFactor() const noexcept {
return static_cast<int>(std::ceil(deviceScaleFactor));
}
#if defined(USE_D2D)
ID2D1RenderTarget *pRenderTarget;
@ -733,14 +736,15 @@ void ScintillaWin::EnsureRenderTarget(HDC hdc) {
}
} else {
drtp.dpiX = 96.f * deviceScaleFactor;
drtp.dpiY = 96.f * deviceScaleFactor;
const int integralDeviceScaleFactor = GetFirstIntegralMultipleDeviceScaleFactor();
drtp.dpiX = 96.f * integralDeviceScaleFactor;
drtp.dpiY = 96.f * integralDeviceScaleFactor;
drtp.pixelFormat = D2D1::PixelFormat(DXGI_FORMAT_UNKNOWN,
D2D1_ALPHA_MODE_UNKNOWN);
D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp {};
dhrtp.hwnd = hw;
dhrtp.pixelSize = ::GetSizeUFromRect(rc, deviceScaleFactor);
dhrtp.pixelSize = ::GetSizeUFromRect(rc, integralDeviceScaleFactor);
dhrtp.presentOptions = (technology == Technology::DirectWriteRetain) ?
D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS : D2D1_PRESENT_OPTIONS_NONE;
@ -785,7 +789,7 @@ void ScintillaWin::DisplayCursor(Window::Cursor c) {
c = static_cast<Window::Cursor>(cursorMode);
}
if (c == Window::Cursor::reverseArrow) {
::SetCursor(reverseArrowCursor.Load(dpi));
::SetCursor(reverseArrowCursor.Load(static_cast<UINT>(dpi * deviceScaleFactor)));
} else {
wMain.SetCursor(c);
}
@ -1330,11 +1334,6 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
const Sci::Position imeCaretPosDoc = pdoc->GetRelativePositionUTF16(currentPos, imeEndToImeCaretU16);
MoveImeCarets(-currentPos + imeCaretPosDoc);
if (std::find(imeIndicator.begin(), imeIndicator.end(), IndicatorTarget) != imeIndicator.end()) {
// set candidate window left aligned to beginning of target string.
SetCandidateWindowPos();
}
}
}
@ -3077,7 +3076,7 @@ void ScintillaWin::ImeStartComposition() {
// Move IME Window to current caret position
IMContext imc(MainHWND());
const Point pos = PointMainCaret();
COMPOSITIONFORM CompForm;
COMPOSITIONFORM CompForm {};
CompForm.dwStyle = CFS_POINT;
CompForm.ptCurrentPos = POINTFromPoint(pos);
@ -3703,7 +3702,7 @@ LRESULT PASCAL ScintillaWin::CTWndProc(
surfaceWindow->Init(ps.hdc, hWnd);
} else {
#if defined(USE_D2D)
const int scaleFactor = sciThis->deviceScaleFactor;
const int scaleFactor = sciThis->GetFirstIntegralMultipleDeviceScaleFactor();
// Create a Direct2D render target.
D2D1_HWND_RENDER_TARGET_PROPERTIES dhrtp {};

View File

@ -36,7 +36,7 @@ SUBSYSTEM=-SUBSYSTEM:WINDOWS,10.00
!ENDIF
CRTFLAGS=$(ADD_DEFINE)
CXXFLAGS=-Zi -TP -MP -W4 -EHsc -std:c++17 $(CRTFLAGS)
CXXFLAGS=-Zi -TP -MP -W4 -EHsc -std:c++17 -utf-8 $(CRTFLAGS)
CXXDEBUG=-Od -MTd -DDEBUG
CXXNDEBUG=-O2 -MT -DNDEBUG -GL
NAME=-Fo

View File

@ -215,7 +215,15 @@ inline LPCWSTR _Win10BuildToReleaseId(const DWORD build)
#define VER_CPL MS Visual C++ 2022 v17.0.(0-1)
#endif
#elif (_MSC_VER == 1929)
#if (_MSC_FULL_VER >= 192930148)
#if (_MSC_FULL_VER >= 192930152)
#define VER_CPL MS Visual C++ 2019 v16.11.30
#elif (_MSC_FULL_VER >= 192930151)
#define VER_CPL MS Visual C++ 2019 v16.11.29
#elif (_MSC_FULL_VER >= 192930150)
#define VER_CPL MS Visual C++ 2019 v16.11.28
#elif (_MSC_FULL_VER >= 192930149)
#define VER_CPL MS Visual C++ 2019 v16.11.(26-27)
#elif (_MSC_FULL_VER >= 192930148)
#define VER_CPL MS Visual C++ 2019 v16.11.(24-25)
#elif (_MSC_FULL_VER >= 192930147)
#define VER_CPL MS Visual C++ 2019 v16 .11.(21-23)