• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28965 (tree)
Zeit2020-09-16 02:09:03
Autorstefankueng

Log Message

update to Scintilla 4.4.5

Ändern Zusammenfassung

Diff

--- trunk/ext/scintilla/.hg_archival.txt (revision 28964)
+++ trunk/ext/scintilla/.hg_archival.txt (revision 28965)
@@ -1,6 +1,6 @@
11 repo: bdf8c3ef2fb01ea24578e726337888e706d10b92
2-node: 5fbdb19e6cee93d98a2894cbf7f080d640cb71be
2+node: a4107157801b54d9c8cd0f627d0196a3089c3df1
33 branch: default
4-latesttag: rel-4-4-4
4+latesttag: rel-4-4-5
55 latesttagdistance: 1
66 changessincelatesttag: 1
--- trunk/ext/scintilla/doc/ScintillaDoc.html (revision 28964)
+++ trunk/ext/scintilla/doc/ScintillaDoc.html (revision 28965)
@@ -119,7 +119,7 @@
119119
120120 <h1>Scintilla Documentation</h1>
121121
122- <p>Last edited 29 March 2020 NH</p>
122+ <p>Last edited 9 September 2020 NH</p>
123123
124124 <p>There is <a class="jump" href="Design.html">an overview of the internal design of
125125 Scintilla</a>.<br />
@@ -289,6 +289,16 @@
289289 As the protocol only supports object lexers, an additional function <code>CreateLexer(const char *name)</code>
290290 is exposed which will create a lexer object (ILexer5 *) for any object lexer or function lexer.
291291 </p>
292+
293+ <p>Lexer libraries that provide the same functions as Lexilla may provide lexers for use by Scintilla,
294+ augmenting or replacing those provided by Lexilla.
295+ To allow initialisation of lexer libraries, a <code>SetLibraryProperty(const char *key, const char *value)</code>
296+ may optionally be implemented. For example, a lexer library that uses XML based lexer definitions may
297+ be provided with a directory to search for such definitions.
298+ Lexer libraries should ignore any properties that they do not understand.
299+ The set of properties supported by a lexer library is specified as a '\n' separated list of property names by
300+ an optional <code>const char *GetLibraryPropertyNames()</code> function.
301+ </p>
292302
293303 <p>A lexer created by Lexilla may be used in Scintilla by calling
294304 <a class="seealso" href="#SCI_SETILEXER">SCI_SETILEXER</a>.</p>
@@ -6856,6 +6866,8 @@
68566866 <br />
68576867 <a class="message" href="#SCI_MULTIEDGEADDLINE">SCI_MULTIEDGEADDLINE(position column, colour edgeColour)</a><br />
68586868 <a class="message" href="#SCI_MULTIEDGECLEARALL">SCI_MULTIEDGECLEARALL</a><br />
6869+ <a class="message" href="#SCI_GETMULTIEDGECOLUMN">SCI_GETMULTIEDGECOLUMN(int which)</a>
6870+ <br />
68596871 </code>
68606872
68616873 <p><b id="SCI_SETEDGEMODE">SCI_SETEDGEMODE(int edgeMode)</b><br />
@@ -6933,10 +6945,13 @@
69336945 <p><b id="SCI_MULTIEDGEADDLINE">SCI_MULTIEDGEADDLINE(position column,
69346946 <a class="jump" href="#colour">colour</a> edgeColour)</b><br />
69356947 <b id="SCI_MULTIEDGECLEARALL">SCI_MULTIEDGECLEARALL</b><br />
6948+ <b id="SCI_GETMULTIEDGECOLUMN">SCI_GETMULTIEDGECOLUMN(int which)</b><br />
69366949 <code>SCI_MULTIEDGEADDLINE</code> adds a new vertical edge to the view. The edge will be
69376950 displayed at the given column number. The resulting edge position depends on the metric
69386951 of a space character in <code>STYLE_DEFAULT</code>. All the edges can be cleared with
6939- <code>SCI_MULTIEDGECLEARALL</code>.</p>
6952+ <code>SCI_MULTIEDGECLEARALL</code>. <code>SCI_GETMULTIEDGECOLUMN</code> returns the column of the
6953+ Nth vertical edge (indexed from 0). If <code class="parameter">which</code> is greater or equal
6954+ to the number of vertical edges, this returns -1.</p>
69406955
69416956 <h2 id="Accessibility">Accessibility</h2>
69426957
--- trunk/ext/scintilla/doc/ScintillaDownload.html (revision 28964)
+++ trunk/ext/scintilla/doc/ScintillaDownload.html (revision 28965)
@@ -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/scintilla444.zip">
29+ <font size="4"> <a href="https://www.scintilla.org/scintilla445.zip">
3030 Windows</a>&nbsp;&nbsp;
31- <a href="https://www.scintilla.org/scintilla444.tgz">
31+ <a href="https://www.scintilla.org/scintilla445.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.4.4
45+ Release 4.4.5
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/scintilla444.zip">zip format</a> (1.8M) commonly used on Windows</li>
54- <li><a href="https://www.scintilla.org/scintilla444.tgz">tgz format</a> (1.6M) commonly used on Linux and compatible operating systems</li>
53+ <li><a href="https://www.scintilla.org/scintilla445.zip">zip format</a> (1.8M) commonly used on Windows</li>
54+ <li><a href="https://www.scintilla.org/scintilla445.tgz">tgz format</a> (1.6M) 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>
--- trunk/ext/scintilla/doc/ScintillaHistory.html (revision 28964)
+++ trunk/ext/scintilla/doc/ScintillaHistory.html (revision 28965)
@@ -558,6 +558,9 @@
558558 <td>Prakash Sahni</td>
559559 </tr><tr>
560560 <td>Michel Sauvard</td>
561+ <td>uhf7</td>
562+ <td>gnombat</td>
563+ <td>Derek Brown</td>
561564 </tr>
562565 </table>
563566 <p>
@@ -570,6 +573,75 @@
570573 </li>
571574 </ul>
572575 <h3>
576+ <a href="https://www.scintilla.org/scite445.zip">Release 4.4.5</a>
577+ </h3>
578+ <ul>
579+ <li>
580+ Released 11 September 2020.
581+ </li>
582+ <li>
583+ Lexilla interface supports setting initialisation properties on lexer libraries with
584+ SetLibraryProperty and GetLibraryPropertyNames functions.
585+ These are called by SciTE which will forward properties to lexer libraries that are prefixed with
586+ "lexilla.context.".
587+ </li>
588+ <li>
589+ Allow cross-building for GTK by choosing pkg-config.
590+ <a href="https://sourceforge.net/p/scintilla/bugs/2189/">Bug #2189</a>.
591+ </li>
592+ <li>
593+ On GTK, allow setting CPPFLAGS (and LDFLAGS for SciTE) to support hardening.
594+ <a href="https://sourceforge.net/p/scintilla/bugs/2191/">Bug #2191</a>.
595+ </li>
596+ <li>
597+ Changed SciTE's indent.auto mode to set tab size to indent size when file uses tabs for indentation.
598+ <a href="https://sourceforge.net/p/scintilla/bugs/2198/">Bug #2198</a>.
599+ </li>
600+ <li>
601+ Fix position of marker symbols for SC_MARGIN_RTEXT which were being moved based on
602+ width of text.
603+ </li>
604+ <li>
605+ Fixed bug on Win32 where cursor was flickering between hand and text over an
606+ indicator with hover style.
607+ <a href="https://sourceforge.net/p/scintilla/bugs/2170/">Bug #2170</a>.
608+ </li>
609+ <li>
610+ Fixed bug where hovered indicator was not returning to non-hover
611+ appearance when mouse moved out of window or into margin.
612+ <a href="https://sourceforge.net/p/scintilla/bugs/2193/">Bug #2193</a>.
613+ </li>
614+ <li>
615+ Fixed bug where a hovered INDIC_TEXTFORE indicator was not applying the hover
616+ colour to the whole range.
617+ <a href="https://sourceforge.net/p/scintilla/bugs/2199/">Bug #2199</a>.
618+ </li>
619+ <li>
620+ Fixed bug where gradient indicators were not showing hovered appearance.
621+ </li>
622+ <li>
623+ Fixed bug where layout caching was ineffective.
624+ <a href="https://sourceforge.net/p/scintilla/bugs/2197/">Bug #2197</a>.
625+ </li>
626+ <li>
627+ For SciTE, don't show the output pane for quiet jobs.
628+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1365/">Feature #1365</a>.
629+ </li>
630+ <li>
631+ Support command.quiet for SciTE on GTK.
632+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1365/">Feature #1365</a>.
633+ </li>
634+ <li>
635+ Fixed a bug in SciTE with stack balance when a syntax error in the Lua startup script
636+ caused continuing failures to find functions after the syntax error was corrected.
637+ <a href="https://sourceforge.net/p/scintilla/bugs/2176/">Bug #2176</a>.
638+ </li>
639+ <li>
640+ Added method for iterating through multiple vertical edges: SCI_GETMULTIEDGECOLUMN.
641+ <a href="https://sourceforge.net/p/scintilla/feature-requests/1350/">Feature #1350</a>.
642+ </li>
643+ </ul>
644+ <h3>
573645 <a href="https://www.scintilla.org/scite444.zip">Release 4.4.4</a>
574646 </h3>
575647 <ul>
--- trunk/ext/scintilla/doc/index.html (revision 28964)
+++ trunk/ext/scintilla/doc/index.html (revision 28965)
@@ -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="20200721" />
12+ <meta name="Date.Modified" content="20200911" />
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.4.4<br />
60- Site last modified July 21 2020</font>
59+ <font color="#FFCC99" size="3"> Release version 4.4.5<br />
60+ Site last modified September 11 2020</font>
6161 </td>
6262 <td width="20%">
6363 &nbsp;
@@ -72,12 +72,12 @@
7272 </tr>
7373 </table>
7474 <ul id="versionlist">
75+ <li>Version 4.4.5 fixes bugs with indicators, margin text, and ineffective layout caching.</li>
7576 <li>Version 4.4.4 implements end of line annotations.</li>
7677 <li>Version 4.4.3 was released just to fix SciTE.</li>
7778 <li>Version 4.4.2 fixes Lexilla build problems with Xcode and as a static library on Win32.</li>
7879 <li>Version 4.4.0 builds Scintilla without lexers as a shared library for GTK,
7980 and adds Xcode projects for Scintilla without lexers and Lexilla on macOS.</li>
80- <li>Version 4.3.3 adds methods for iterating marker handles and marker numbers on a line.</li>
8181 </ul>
8282 <ul id="menu">
8383 <li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
--- trunk/ext/scintilla/include/Scintilla.h (revision 28964)
+++ trunk/ext/scintilla/include/Scintilla.h (revision 28965)
@@ -703,6 +703,7 @@
703703 #define SCI_SETEDGECOLOUR 2365
704704 #define SCI_MULTIEDGEADDLINE 2694
705705 #define SCI_MULTIEDGECLEARALL 2695
706+#define SCI_GETMULTIEDGECOLUMN 2749
706707 #define SCI_SEARCHANCHOR 2366
707708 #define SCI_SEARCHNEXT 2367
708709 #define SCI_SEARCHPREV 2368
@@ -1172,8 +1173,6 @@
11721173
11731174 #endif
11741175
1175-#define SCN_GETBKCOLOR 5000
1176-
11771176 /* These structures are defined to be exactly the same shape as the Win32
11781177 * CHARRANGE, TEXTRANGE, FINDTEXTEX, FORMATRANGE, and NMHDR structs.
11791178 * So older code that treats Scintilla as a RichEdit will work. */
--- trunk/ext/scintilla/lexilla/scripts/LexillaGen.py (revision 28964)
+++ trunk/ext/scintilla/lexilla/scripts/LexillaGen.py (revision 28965)
@@ -117,7 +117,7 @@
117117
118118 lexerReferences = ScintillaData.FindLexersInXcode(lexillaXcodeProject)
119119
120- UpdateLineInPlistFile(lexillaXcode / "Lexilla" / "Info.plist",
120+ UpdateLineInPlistFile(lexillaXcode / "Info.plist",
121121 "CFBundleShortVersionString", versionDotted)
122122
123123 ReplaceREInFile(lexillaXcodeProject, "CURRENT_PROJECT_VERSION = [0-9.]+;",
--- trunk/ext/scintilla/lexilla/src/Lexilla/Lexilla/Info.plist (revision 28964)
+++ trunk/ext/scintilla/lexilla/src/Lexilla/Lexilla/Info.plist (nonexistent)
@@ -1,24 +0,0 @@
1-<?xml version="1.0" encoding="UTF-8"?>
2-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3-<plist version="1.0">
4-<dict>
5- <key>CFBundleDevelopmentRegion</key>
6- <string>$(DEVELOPMENT_LANGUAGE)</string>
7- <key>CFBundleExecutable</key>
8- <string>$(EXECUTABLE_NAME)</string>
9- <key>CFBundleIdentifier</key>
10- <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11- <key>CFBundleInfoDictionaryVersion</key>
12- <string>6.0</string>
13- <key>CFBundleName</key>
14- <string>$(PRODUCT_NAME)</string>
15- <key>CFBundlePackageType</key>
16- <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17- <key>CFBundleShortVersionString</key>
18- <string>4.4.3</string>
19- <key>CFBundleVersion</key>
20- <string>$(CURRENT_PROJECT_VERSION)</string>
21- <key>NSHumanReadableCopyright</key>
22- <string>Copyright © 2020 Neil Hodgson. All rights reserved.</string>
23-</dict>
24-</plist>
--- trunk/ext/scintilla/lexilla/version.txt (revision 28964)
+++ trunk/ext/scintilla/lexilla/version.txt (revision 28965)
@@ -1 +1 @@
1-444
1+445
--- trunk/ext/scintilla/src/Document.cxx (revision 28964)
+++ trunk/ext/scintilla/src/Document.cxx (revision 28965)
@@ -2366,10 +2366,12 @@
23662366 }
23672367
23682368 void Document::AnnotationSetStyle(Sci::Line line, int style) {
2369- Annotations()->SetStyle(line, style);
2370- const DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line),
2371- 0, 0, 0, line);
2372- NotifyModified(mh);
2369+ if (line >= 0 && line < LinesTotal()) {
2370+ Annotations()->SetStyle(line, style);
2371+ const DocModification mh(SC_MOD_CHANGEANNOTATION, LineStart(line),
2372+ 0, 0, 0, line);
2373+ NotifyModified(mh);
2374+ }
23732375 }
23742376
23752377 void Document::AnnotationSetStyles(Sci::Line line, const unsigned char *styles) {
@@ -2406,10 +2408,12 @@
24062408 }
24072409
24082410 void Document::EOLAnnotationSetStyle(Sci::Line line, int style) {
2409- EOLAnnotations()->SetStyle(line, style);
2410- const DocModification mh(SC_MOD_CHANGEEOLANNOTATION, LineStart(line),
2411- 0, 0, 0, line);
2412- NotifyModified(mh);
2411+ if (line >= 0 && line < LinesTotal()) {
2412+ EOLAnnotations()->SetStyle(line, style);
2413+ const DocModification mh(SC_MOD_CHANGEEOLANNOTATION, LineStart(line),
2414+ 0, 0, 0, line);
2415+ NotifyModified(mh);
2416+ }
24132417 }
24142418
24152419 void Document::EOLAnnotationClearAll() {
--- trunk/ext/scintilla/src/EditView.cxx (revision 28964)
+++ trunk/ext/scintilla/src/EditView.cxx (revision 28965)
@@ -56,7 +56,6 @@
5656 #include "MarginView.h"
5757 #include "EditView.h"
5858 #include "ElapsedPeriod.h"
59-#include "Editor.h"
6059
6160 using namespace Scintilla;
6261
@@ -182,7 +181,6 @@
182181 tabArrowHeight = 4;
183182 customDrawTabArrow = nullptr;
184183 customDrawWrapMarker = nullptr;
185- editor = NULL;
186184 }
187185
188186 EditView::~EditView() {
@@ -389,6 +387,9 @@
389387 if (posLineEnd >(posLineStart + ll->maxLineLength)) {
390388 posLineEnd = posLineStart + ll->maxLineLength;
391389 }
390+ // Hard to cope when too narrow, so just assume there is space
391+ width = std::max(width, 20);
392+
392393 if (ll->validity == LineLayout::ValidLevel::checkTextAndStyle) {
393394 Sci::Position lineLength = posLineEnd - posLineStart;
394395 if (!vstyle.viewEOL) {
@@ -398,23 +399,21 @@
398399 // See if chars, styles, indicators, are all the same
399400 bool allSame = true;
400401 // Check base line layout
401- int styleByte = 0;
402- int numCharsInLine = 0;
403402 char chPrevious = 0;
404- while (numCharsInLine < lineLength) {
403+ for (Sci::Position numCharsInLine = 0; numCharsInLine < lineLength; numCharsInLine++) {
405404 const Sci::Position charInDoc = numCharsInLine + posLineStart;
406405 const char chDoc = model.pdoc->CharAt(charInDoc);
407- styleByte = model.pdoc->StyleIndexAt(charInDoc);
406+ const int styleByte = model.pdoc->StyleIndexAt(charInDoc);
408407 allSame = allSame &&
409408 (ll->styles[numCharsInLine] == styleByte);
410409 allSame = allSame &&
411410 (ll->chars[numCharsInLine] == CaseForce(vstyle.styles[styleByte].caseForce, chDoc, chPrevious));
412411 chPrevious = chDoc;
413- numCharsInLine++;
414412 }
415- allSame = allSame && (ll->styles[numCharsInLine] == styleByte); // For eolFilled
413+ const int styleByteLast = (posLineEnd > posLineStart) ? model.pdoc->StyleIndexAt(posLineEnd - 1) : 0;
414+ allSame = allSame && (ll->styles[lineLength] == styleByteLast); // For eolFilled
416415 if (allSame) {
417- ll->validity = LineLayout::ValidLevel::positions;
416+ ll->validity = (ll->widthLine != width) ? LineLayout::ValidLevel::positions : LineLayout::ValidLevel::lines;
418417 } else {
419418 ll->validity = LineLayout::ValidLevel::invalid;
420419 }
@@ -508,10 +507,6 @@
508507 ll->numCharsBeforeEOL = numCharsBeforeEOL;
509508 ll->validity = LineLayout::ValidLevel::positions;
510509 }
511- // Hard to cope when too narrow, so just assume there is space
512- if (width < 20) {
513- width = 20;
514- }
515510 if ((ll->validity == LineLayout::ValidLevel::positions) || (ll->widthLine != width)) {
516511 ll->widthLine = width;
517512 if (width == LineLayout::wrapWidthInfinite) {
@@ -1900,9 +1895,12 @@
19001895 const int indicatorValue = deco->ValueAt(ts.start + posLineStart);
19011896 if (indicatorValue) {
19021897 const Indicator &indicator = vsDraw.indicators[deco->Indicator()];
1903- const bool hover = indicator.IsDynamic() &&
1904- ((model.hoverIndicatorPos >= ts.start + posLineStart) &&
1905- (model.hoverIndicatorPos <= ts.end() + posLineStart));
1898+ bool hover = false;
1899+ if (indicator.IsDynamic()) {
1900+ const Sci::Position startPos = ts.start + posLineStart;
1901+ const Range rangeRun(deco->StartRun(startPos), deco->EndRun(startPos));
1902+ hover = rangeRun.ContainsCharacter(model.hoverIndicatorPos);
1903+ }
19061904 if (hover) {
19071905 if (indicator.sacHover.style == INDIC_TEXTFORE) {
19081906 textFore = indicator.sacHover.fore;
@@ -2110,17 +2108,7 @@
21102108 }
21112109
21122110 // See if something overrides the line background colour.
2113- ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
2114- SCNotification scn = { 0 };
2115- scn.nmhdr.code = SCN_GETBKCOLOR;
2116- scn.line = line;
2117- scn.lParam = -1;
2118- if (editor)
2119- ((Editor*)editor)->NotifyParent(&scn);
2120- if (scn.lParam != -1)
2121- {
2122- background = ColourOptional(true, scn.lParam);
2123- }
2111+ const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
21242112
21252113 const Sci::Position posLineStart = model.pdoc->LineStart(line);
21262114
--- trunk/ext/scintilla/src/EditView.h (revision 28964)
+++ trunk/ext/scintilla/src/EditView.h (revision 28965)
@@ -77,7 +77,6 @@
7777 std::unique_ptr<Surface> pixmapLine;
7878 std::unique_ptr<Surface> pixmapIndentGuide;
7979 std::unique_ptr<Surface> pixmapIndentGuideHighlight;
80- void *editor;
8180
8281 LineLayoutCache llc;
8382 PositionCache posCache;
--- trunk/ext/scintilla/src/Editor.cxx (revision 28964)
+++ trunk/ext/scintilla/src/Editor.cxx (revision 28965)
@@ -110,7 +110,6 @@
110110 }
111111
112112 Editor::Editor() : durationWrapOneLine(0.00001, 0.000001, 0.0001) {
113- view.editor = this;
114113 ctrlID = 0;
115114
116115 stylesValid = false;
@@ -4437,7 +4436,8 @@
44374436 }
44384437
44394438 void Editor::LineSelection(Sci::Position lineCurrentPos_, Sci::Position lineAnchorPos_, bool wholeLine) {
4440- Sci::Position selCurrentPos, selAnchorPos;
4439+ Sci::Position selCurrentPos;
4440+ Sci::Position selAnchorPos;
44414441 if (wholeLine) {
44424442 const Sci::Line lineCurrent_ = pdoc->SciLineFromPosition(lineCurrentPos_);
44434443 const Sci::Line lineAnchor_ = pdoc->SciLineFromPosition(lineAnchorPos_);
@@ -4507,6 +4507,7 @@
45074507
45084508 void Editor::MouseLeave() {
45094509 SetHotSpotRange(nullptr);
4510+ SetHoverIndicatorPosition(Sci::invalidPosition);
45104511 if (!HaveMouseCapture()) {
45114512 ptMouseLast = Point(-1, -1);
45124513 DwellEnd(true);
@@ -4586,7 +4587,8 @@
45864587 charPos = MovePositionOutsideChar(charPos, -1);
45874588 }
45884589
4589- Sci::Position startWord, endWord;
4590+ Sci::Position startWord;
4591+ Sci::Position endWord;
45904592 if ((sel.MainCaret() >= originalAnchorPos) && !pdoc->IsLineEndPosition(charPos)) {
45914593 startWord = pdoc->ExtendWordSelect(pdoc->MovePositionOutsideChar(charPos + 1, 1), -1);
45924594 endWord = pdoc->ExtendWordSelect(charPos, 1);
@@ -4875,6 +4877,7 @@
48754877 if (PointInSelMargin(pt)) {
48764878 DisplayCursor(GetMarginCursor(pt));
48774879 SetHotSpotRange(nullptr);
4880+ SetHoverIndicatorPosition(Sci::invalidPosition);
48784881 return; // No need to test for selection
48794882 }
48804883 }
@@ -4881,6 +4884,7 @@
48814884 // Display regular (drag) cursor over selection
48824885 if (PointInSelection(pt) && !SelectionEmpty()) {
48834886 DisplayCursor(Window::cursorArrow);
4887+ SetHoverIndicatorPosition(Sci::invalidPosition);
48844888 } else {
48854889 SetHoverIndicatorPoint(pt);
48864890 if (PointIsHotspot(pt)) {
@@ -5616,7 +5620,7 @@
56165620 targetRange.end = targetRange.start;
56175621
56185622 // Realize virtual space of target start
5619- Sci::Position startAfterSpaceInsertion = RealizeVirtualSpace(targetRange.start.Position(), targetRange.start.VirtualSpace());
5623+ const Sci::Position startAfterSpaceInsertion = RealizeVirtualSpace(targetRange.start.Position(), targetRange.start.VirtualSpace());
56205624 targetRange.start.SetPosition(startAfterSpaceInsertion);
56215625 targetRange.end = targetRange.start;
56225626
@@ -5763,6 +5767,9 @@
57635767 }
57645768
57655769 void Editor::SetSelectionNMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
5770+ if (wParam >= sel.Count()) {
5771+ return;
5772+ }
57665773 InvalidateRange(sel.Range(wParam).Start().Position(), sel.Range(wParam).End().Position());
57675774
57685775 switch (iMessage) {
@@ -7698,7 +7705,7 @@
76987705 break;
76997706
77007707 case SCI_MULTIEDGEADDLINE:
7701- vs.theMultiEdge.push_back(EdgeProperties(wParam, lParam));
7708+ vs.AddMultiEdge(wParam, lParam);
77027709 InvalidateStyleRedraw();
77037710 break;
77047711
@@ -7707,6 +7714,15 @@
77077714 InvalidateStyleRedraw();
77087715 break;
77097716
7717+ case SCI_GETMULTIEDGECOLUMN: {
7718+ const size_t which = wParam;
7719+ // size_t is unsigned so this also handles negative inputs.
7720+ if (which >= vs.theMultiEdge.size()) {
7721+ return -1;
7722+ }
7723+ return vs.theMultiEdge[which].column;
7724+ }
7725+
77107726 case SCI_GETACCESSIBILITY:
77117727 return SC_ACCESSIBILITY_DISABLED;
77127728
--- trunk/ext/scintilla/src/Editor.h (revision 28964)
+++ trunk/ext/scintilla/src/Editor.h (revision 28965)
@@ -623,7 +623,6 @@
623623 public:
624624 ~Editor() override;
625625
626- virtual void NotifyParent(SCNotification * scn) = 0;
627626 // Public so the COM thunks can access it.
628627 bool IsUnicodeMode() const noexcept;
629628 // Public so scintilla_send_message can use it.
--- trunk/ext/scintilla/src/Indicator.cxx (revision 28964)
+++ trunk/ext/scintilla/src/Indicator.cxx (revision 28965)
@@ -172,8 +172,8 @@
172172 rcBox.top = rcLine.top + 1;
173173 rcBox.bottom = rcLine.bottom;
174174 const Surface::GradientOptions options = Surface::GradientOptions::topToBottom;
175- const ColourAlpha start(sacNormal.fore, fillAlpha);
176- const ColourAlpha end(sacNormal.fore, 0);
175+ const ColourAlpha start(sacDraw.fore, fillAlpha);
176+ const ColourAlpha end(sacDraw.fore, 0);
177177 std::vector<ColourStop> stops;
178178 switch (sacDraw.style) {
179179 case INDIC_GRADIENT:
--- trunk/ext/scintilla/src/MarginView.cxx (revision 28964)
+++ trunk/ext/scintilla/src/MarginView.cxx (revision 28965)
@@ -365,9 +365,11 @@
365365
366366 marks &= vs.ms[margin].mask;
367367
368- PRectangle rcMarker = rcSelMargin;
369- rcMarker.top = static_cast<XYPOSITION>(yposScreen);
370- rcMarker.bottom = static_cast<XYPOSITION>(yposScreen + vs.lineHeight);
368+ PRectangle rcMarker(
369+ rcSelMargin.left,
370+ static_cast<XYPOSITION>(yposScreen),
371+ rcSelMargin.right,
372+ static_cast<XYPOSITION>(yposScreen + vs.lineHeight));
371373 if (vs.ms[margin].style == SC_MARGIN_NUMBER) {
372374 if (firstSubLine) {
373375 std::string sNumber;
@@ -413,11 +415,12 @@
413415 if (firstSubLine) {
414416 surface->FillRectangle(rcMarker,
415417 vs.styles[stMargin.StyleAt(0) + vs.marginStyleOffset].back);
418+ PRectangle rcText = rcMarker;
416419 if (vs.ms[margin].style == SC_MARGIN_RTEXT) {
417420 const int width = WidestLineWidth(surface, vs, vs.marginStyleOffset, stMargin);
418- rcMarker.left = rcMarker.right - width - 3;
421+ rcText.left = rcText.right - width - 3;
419422 }
420- DrawStyledText(surface, vs, vs.marginStyleOffset, rcMarker,
423+ DrawStyledText(surface, vs, vs.marginStyleOffset, rcText,
421424 stMargin, 0, stMargin.length, drawAll);
422425 } else {
423426 // if we're displaying annotation lines, colour the margin to match the associated document line
--- trunk/ext/scintilla/src/RESearch.cxx (revision 28964)
+++ trunk/ext/scintilla/src/RESearch.cxx (revision 28965)
@@ -780,7 +780,7 @@
780780 lp++;
781781 if (lp >= endp) /* if EOS, fail, else fall through. */
782782 return 0;
783- // Falls through.
783+ [[fallthrough]];
784784 default: /* regular matching all the way. */
785785 while (lp < endp) {
786786 ep = PMatch(ci, lp, endp, ap);
--- trunk/ext/scintilla/src/ViewStyle.cxx (revision 28964)
+++ trunk/ext/scintilla/src/ViewStyle.cxx (revision 28965)
@@ -504,6 +504,17 @@
504504 return styles[STYLE_DEFAULT].fore;
505505 }
506506
507+// Insert new edge in sorted order.
508+void ViewStyle::AddMultiEdge(uptr_t wParam, sptr_t lParam) {
509+ const int column = static_cast<int>(wParam);
510+ theMultiEdge.insert(
511+ std::upper_bound(theMultiEdge.begin(), theMultiEdge.end(), column,
512+ [](const EdgeProperties &a, const EdgeProperties &b) {
513+ return a.column < b.column;
514+ }),
515+ EdgeProperties(column, lParam));
516+}
517+
507518 bool ViewStyle::SetWrapState(int wrapState_) noexcept {
508519 WrapMode wrapStateWanted;
509520 switch (wrapState_) {
--- trunk/ext/scintilla/src/ViewStyle.h (revision 28964)
+++ trunk/ext/scintilla/src/ViewStyle.h (revision 28965)
@@ -193,6 +193,8 @@
193193 bool WhitespaceBackgroundDrawn() const noexcept;
194194 ColourDesired WrapColour() const noexcept;
195195
196+ void AddMultiEdge(uptr_t wParam, sptr_t lParam);
197+
196198 bool SetWrapState(int wrapState_) noexcept;
197199 bool SetWrapVisualFlags(int wrapVisualFlags_) noexcept;
198200 bool SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) noexcept;
--- trunk/ext/scintilla/version.txt (revision 28964)
+++ trunk/ext/scintilla/version.txt (revision 28965)
@@ -1 +1 @@
1-444
1+445
--- trunk/ext/scintilla/win32/PlatWin.cxx (revision 28964)
+++ trunk/ext/scintilla/win32/PlatWin.cxx (revision 28965)
@@ -978,7 +978,7 @@
978978 ::BitBlt(hdc,
979979 static_cast<int>(rc.left), static_cast<int>(rc.top),
980980 static_cast<int>(rc.Width()), static_cast<int>(rc.Height()),
981- static_cast<SurfaceGDI &>(surfaceSource).hdc,
981+ dynamic_cast<SurfaceGDI &>(surfaceSource).hdc,
982982 static_cast<int>(from.x), static_cast<int>(from.y), SRCCOPY);
983983 }
984984
@@ -1176,6 +1176,7 @@
11761176
11771177 void Clear() noexcept;
11781178 void SetFont(const Font &font_) noexcept;
1179+ HRESULT GetBitmap(ID2D1Bitmap **ppBitmap);
11791180
11801181 public:
11811182 SurfaceD2D() noexcept;
@@ -1332,6 +1333,11 @@
13321333 SetDBCSMode(psurfOther->codePage);
13331334 }
13341335
1336+HRESULT SurfaceD2D::GetBitmap(ID2D1Bitmap **ppBitmap) {
1337+ PLATFORM_ASSERT(pBitmapRenderTarget);
1338+ return pBitmapRenderTarget->GetBitmap(ppBitmap);
1339+}
1340+
13351341 void SurfaceD2D::PenColour(ColourDesired fore) {
13361342 D2DPenColour(fore);
13371343 }
@@ -1434,11 +1440,8 @@
14341440 void SurfaceD2D::Polygon(Point *pts, size_t npts, ColourDesired fore, ColourDesired back) {
14351441 PLATFORM_ASSERT(pRenderTarget && (npts > 2));
14361442 if (pRenderTarget) {
1437- ID2D1Factory *pFactory = nullptr;
1438- pRenderTarget->GetFactory(&pFactory);
1439- PLATFORM_ASSERT(pFactory);
14401443 ID2D1PathGeometry *geometry = nullptr;
1441- HRESULT hr = pFactory->CreatePathGeometry(&geometry);
1444+ HRESULT hr = pD2DFactory->CreatePathGeometry(&geometry);
14421445 PLATFORM_ASSERT(geometry);
14431446 if (SUCCEEDED(hr) && geometry) {
14441447 ID2D1GeometrySink *sink = nullptr;
@@ -1483,10 +1486,10 @@
14831486
14841487 void SurfaceD2D::FillRectangle(PRectangle rc, Surface &surfacePattern) {
14851488 SurfaceD2D *psurfOther = dynamic_cast<SurfaceD2D *>(&surfacePattern);
1486- PLATFORM_ASSERT(psurfOther && psurfOther->pBitmapRenderTarget);
1489+ PLATFORM_ASSERT(psurfOther);
14871490 psurfOther->FlushDrawing();
14881491 ID2D1Bitmap *pBitmap = nullptr;
1489- HRESULT hr = psurfOther->pBitmapRenderTarget->GetBitmap(&pBitmap);
1492+ HRESULT hr = psurfOther->GetBitmap(&pBitmap);
14901493 if (SUCCEEDED(hr) && pBitmap) {
14911494 ID2D1BitmapBrush *pBitmapBrush = nullptr;
14921495 const D2D1_BITMAP_BRUSH_PROPERTIES brushProperties =
@@ -1639,14 +1642,11 @@
16391642 }
16401643
16411644 void SurfaceD2D::Copy(PRectangle rc, Point from, Surface &surfaceSource) {
1642- SurfaceD2D &surfOther = static_cast<SurfaceD2D &>(surfaceSource);
1645+ SurfaceD2D &surfOther = dynamic_cast<SurfaceD2D &>(surfaceSource);
16431646 surfOther.FlushDrawing();
1644- ID2D1BitmapRenderTarget *pCompatibleRenderTarget = reinterpret_cast<ID2D1BitmapRenderTarget *>(
1645- surfOther.pRenderTarget);
1646- PLATFORM_ASSERT(pCompatibleRenderTarget);
16471647 ID2D1Bitmap *pBitmap = nullptr;
1648- HRESULT hr = pCompatibleRenderTarget->GetBitmap(&pBitmap);
1649- if (SUCCEEDED(hr)) {
1648+ HRESULT hr = surfOther.GetBitmap(&pBitmap);
1649+ if (SUCCEEDED(hr) && pBitmap) {
16501650 const D2D1_RECT_F rcDestination = RectangleFromPRectangle(rc);
16511651 D2D1_RECT_F rcSource = {from.x, from.y, from.x + rc.Width(), from.y + rc.Height()};
16521652 pRenderTarget->DrawBitmap(pBitmap, rcDestination, 1.0f,
--- trunk/ext/scintilla/win32/ScintillaWin.cxx (revision 28964)
+++ trunk/ext/scintilla/win32/ScintillaWin.cxx (revision 28965)
@@ -424,7 +424,6 @@
424424 void SetCtrlID(int identifier) override;
425425 int GetCtrlID() override;
426426 void NotifyParent(SCNotification scn) override;
427- virtual void NotifyParent(SCNotification * scn);
428427 void NotifyDoubleClick(Point pt, int modifiers) override;
429428 CaseFolder *CaseFolderForEncoding() override;
430429 std::string CaseMapString(const std::string &s, int caseMapping) override;
@@ -450,7 +449,7 @@
450449 void ChangeScrollPos(int barType, Sci::Position pos);
451450 sptr_t GetTextLength();
452451 sptr_t GetText(uptr_t wParam, sptr_t lParam);
453- Window::Cursor ContextCursor();
452+ Window::Cursor ContextCursor(Point pt);
454453 sptr_t ShowContextMenu(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
455454 void SizeWindow();
456455 sptr_t MouseMessage(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
@@ -1364,19 +1363,20 @@
13641363 }
13651364 }
13661365
1367-Window::Cursor ScintillaWin::ContextCursor() {
1366+Window::Cursor ScintillaWin::ContextCursor(Point pt) {
13681367 if (inDragDrop == ddDragging) {
13691368 return Window::cursorUp;
13701369 } else {
13711370 // Display regular (drag) cursor over selection
1372- POINT pt;
1373- if (0 != ::GetCursorPos(&pt)) {
1374- ::ScreenToClient(MainHWND(), &pt);
1375- if (PointInSelMargin(PointFromPOINT(pt))) {
1376- return GetMarginCursor(PointFromPOINT(pt));
1377- } else if (PointInSelection(PointFromPOINT(pt)) && !SelectionEmpty()) {
1378- return Window::cursorArrow;
1379- } else if (PointIsHotspot(PointFromPOINT(pt))) {
1371+ if (PointInSelMargin(pt)) {
1372+ return GetMarginCursor(pt);
1373+ } else if (!SelectionEmpty() && PointInSelection(pt)) {
1374+ return Window::cursorArrow;
1375+ } else if (PointIsHotspot(pt)) {
1376+ return Window::cursorHand;
1377+ } else if (hoverIndicatorPos != Sci::invalidPosition) {
1378+ const Sci::Position pos = PositionFromLocation(pt, true, true);
1379+ if (pos != Sci::invalidPosition) {
13801380 return Window::cursorHand;
13811381 }
13821382 }
@@ -1920,7 +1920,11 @@
19201920
19211921 case WM_SETCURSOR:
19221922 if (LOWORD(lParam) == HTCLIENT) {
1923- DisplayCursor(ContextCursor());
1923+ POINT pt;
1924+ if (::GetCursorPos(&pt)) {
1925+ ::ScreenToClient(MainHWND(), &pt);
1926+ DisplayCursor(ContextCursor(PointFromPOINT(pt)));
1927+ }
19241928 return TRUE;
19251929 } else {
19261930 return ::DefWindowProc(MainHWND(), iMessage, wParam, lParam);
@@ -2280,13 +2284,6 @@
22802284 GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
22812285 }
22822286
2283-void ScintillaWin::NotifyParent(SCNotification * scn) {
2284- scn->nmhdr.hwndFrom = MainHWND();
2285- scn->nmhdr.idFrom = GetCtrlID();
2286- ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
2287- GetCtrlID(), reinterpret_cast<LPARAM>(scn));
2288-}
2289-
22902287 void ScintillaWin::NotifyDoubleClick(Point pt, int modifiers) {
22912288 //Platform::DebugPrintf("ScintillaWin Double click 0\n");
22922289 ScintillaBase::NotifyDoubleClick(pt, modifiers);
Show on old repository browser