+ upd: Scintilla GitHub mirror version 4.1.5

+ add: missing HTML keywords (picture, slot, template)
This commit is contained in:
Rainer Kottenhoff 2019-04-18 14:16:57 +02:00
parent a5d613debd
commit 8da89fc25d
34 changed files with 320 additions and 279 deletions

View File

@ -1 +1 @@
1658
1672

View File

@ -1 +1 @@
"XpErImEnTaL"
"develop"

View File

@ -3,8 +3,8 @@
<assemblyIdentity
name="Notepad3"
processorArchitecture="*"
version="5.19.314.1658"
version="5.19.418.1672"
type="win32"
/>
<description>Notepad3 XpErImEnTaL</description>
<description>Notepad3 develop</description>
</assembly>

View File

@ -309,6 +309,7 @@
<ClCompile Include="src\Selection.cxx" />
<ClCompile Include="src\Style.cxx" />
<ClCompile Include="src\UniConversion.cxx" />
<ClCompile Include="src\UniqueString.cxx" />
<ClCompile Include="src\ViewStyle.cxx" />
<ClCompile Include="src\XPM.cxx" />
<ClCompile Include="win32\HanjaDic.cxx" />

View File

@ -345,6 +345,9 @@
<ClCompile Include="lexers\LexNim.cxx">
<Filter>lexers</Filter>
</ClCompile>
<ClCompile Include="src\UniqueString.cxx">
<Filter>src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\ILexer.h">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -4072,7 +4072,8 @@ struct Sci_TextToFind {
<code>SC_MARK_BACKGROUND</code>,
<code>SC_MARK_LEFTRECT</code>,
<code>SC_MARK_FULLRECT</code>,
<code>SC_MARK_BOOKMARK</code>, and
<code>SC_MARK_BOOKMARK</code>,
<code>SC_MARK_VERTICALBOOKMARK</code>, and
<code>SC_MARK_UNDERLINE</code>.
</p>
@ -6014,6 +6015,8 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<a class="message" href="#SCI_TOGGLEFOLDSHOWTEXT">SCI_TOGGLEFOLDSHOWTEXT(int line, const char *text)</a><br />
<a class="message" href="#SCI_FOLDDISPLAYTEXTSETSTYLE">SCI_FOLDDISPLAYTEXTSETSTYLE(int style)</a><br />
<a class="message" href="#SCI_FOLDDISPLAYTEXTGETSTYLE">SCI_FOLDDISPLAYTEXTGETSTYLE &rarr; int</a><br />
<a class="message" href="#SCI_SETDEFAULTFOLDDISPLAYTEXT">SCI_SETDEFAULTFOLDDISPLAYTEXT(const char *text)</a><br />
<a class="message" href="#SCI_GETDEFAULTFOLDDISPLAYTEXT">SCI_GETDEFAULTFOLDDISPLAYTEXT(&lt;unused&gt;, char *text)</a><br />
<a class="message" href="#SCI_FOLDLINE">SCI_FOLDLINE(int line, int action)</a><br />
<a class="message" href="#SCI_FOLDCHILDREN">SCI_FOLDCHILDREN(int line, int action)</a><br />
<a class="message" href="#SCI_FOLDALL">SCI_FOLDALL(int action)</a><br />
@ -6173,6 +6176,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<p>An optional text tag may be shown to the right of the folded text with the
<code class="parameter">text</code> argument to
<code>SCI_TOGGLEFOLDSHOWTEXT</code>.
The default text for all header lines can be set with <code><a class="message" href="#SCI_SETDEFAULTFOLDDISPLAYTEXT">SCI_SETDEFAULTFOLDDISPLAYTEXT</a></code>.
The text is drawn with the
<code><a class="message" href="#StyleDefinition">STYLE_FOLDDISPLAYTEXT</a></code> style.</p>
@ -6210,6 +6214,10 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
</tbody>
</table>
<p><b id="SCI_SETDEFAULTFOLDDISPLAYTEXT">SCI_SETDEFAULTFOLDDISPLAYTEXT(const char *text)</b><br />
<b id="SCI_GETDEFAULTFOLDDISPLAYTEXT">SCI_GETDEFAULTFOLDDISPLAYTEXT(&lt;unused&gt;, char *text) &rarr; int</b><br />
These messages set and get the default text displayed at the right of the folded text.</p>
<p><b id="SCI_SETFOLDEXPANDED">SCI_SETFOLDEXPANDED(int line, bool expanded)</b><br />
<b id="SCI_GETFOLDEXPANDED">SCI_GETFOLDEXPANDED(int line) &rarr; bool</b><br />
These messages set and get the expanded state of a single line. The set message has no effect
@ -7330,7 +7338,10 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);
This is sent when the user types an ordinary text character (as opposed to a command
character) that is entered into the text. The container can use this to decide to display a <a
class="jump" href="#CallTips">call tip</a> or an <a class="jump" href="#Autocompletion">auto
completion list</a>. The character is in <code>SCNotification.ch</code>.
completion list</a>. The character is in <code>SCNotification::ch</code>.
For single byte character sets, this is the byte value of the character;
for UTF-8, it is the Unicode code point;
for DBCS, it is (first byte * 256 + second byte) for 2 byte characters and the byte value for 1 byte characters.
This notification is sent before the character has been styled so processing that depends on
styling should instead be performed in the SCN_UPDATEUI notification.</p>
@ -7349,7 +7360,7 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE</a>(lineNumber);
<p><b id="SCN_KEY">SCN_KEY</b><br />
Reports all keys pressed but not consumed by Scintilla. Used on GTK+ because of
some problems with keyboard focus and is not sent by the Windows version. <code>SCNotification.ch</code> holds the key code and
some problems with keyboard focus and is not sent by the Windows version. <code>SCNotification::ch</code> holds the key code and
<code>SCNotification.modifiers</code> holds the modifiers. This notification is sent if the
modifiers include <code>SCMOD_ALT</code> or <code>SCMOD_CTRL</code> and the key code is less
than 256.</p>
@ -8438,6 +8449,9 @@ EM_SETTARGETDEVICE
When both GTK+ 2 and GTK+ 3 are present, building for GTK+ 3.x requires defining GTK3
on the command line.</p>
<p>Adding and removing source files from Scintilla may require modifying build files.
This is addressed in <a class="jump" href="AddSource.txt">AddSource.txt</a>.</p>
<h3>Static linking</h3>
<p>On Windows, Scintilla is normally used as a dynamic library as a .DLL file. If you want to

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/scintilla414.zip">
<font size="4"> <a href="https://www.scintilla.org/scintilla415.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/scintilla414.tgz">
<a href="https://www.scintilla.org/scintilla415.tgz">
GTK+/Linux</a>&nbsp;&nbsp;
</font>
</td>
@ -42,7 +42,7 @@
containing very few restrictions.
</p>
<h3>
Release 4.1.4
Release 4.1.5
</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/scintilla414.zip">zip format</a> (1700K) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla414.tgz">tgz format</a> (1500K) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/scintilla415.zip">zip format</a> (1700K) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla415.tgz">tgz format</a> (1500K) 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

@ -558,11 +558,7 @@
</h3>
<ul>
<li>
Released 7 March 2019.
</li>
<li>
Improve the styling of numbers in Nim.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1268/">Feature #1268</a>.
Released 17 April 2019.
</li>
<li>
On Win32, removed special handling of non-0 wParam to WM_PAINT.
@ -570,6 +566,14 @@
<li>
Implement high-priority idle on Win32 to make redraw smoother and more efficient.
</li>
<li>
Add vertical bookmark symbol SC_MARK_VERTICALBOOKMARK.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1276/">Feature #1276</a>.
</li>
<li>
Set default fold display text SCI_SETDEFAULTFOLDDISPLAYTEXT(text).
<a href="https://sourceforge.net/p/scintilla/feature-requests/1272/">Feature #1272</a>.
</li>
<li>
Add SCI_SETCHARACTERCATEGORYOPTIMIZATION API to optimize speed
of character category features like determining whether a character is a space or number
@ -577,13 +581,33 @@
<a href="https://sourceforge.net/p/scintilla/feature-requests/1259/">Feature #1259</a>.
</li>
<li>
Improve the styling of numbers in Nim.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1268/">Feature #1268</a>.
</li>
<li>
Fix exception when inserting DBCS text.
<a href="https://sourceforge.net/p/scintilla/bugs/2093/">Bug #2093</a>.
</li>
<li>
Improve performance of accessibility on GTK.
<a href="https://sourceforge.net/p/scintilla/bugs/2094/">Bug #2094</a>.
</li>
<li>
Fix text reported for deletion with accessibility on GTK.
<a href="https://sourceforge.net/p/scintilla/bugs/2095/">Bug #2095</a>.
</li>
<li>
Fix flicker when inserting primary selection on GTK.
<a href="https://sourceforge.net/p/scintilla/bugs/2087/">Bug #2087</a>.
</li>
<li>
Support coloured text in Windows 8.1+.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1277/">Feature #1277</a>.
</li>
<li>
Avoid potential long hangs with idle styling for huge documents on Cocoa and GTK.
</li>
<ul>
</ul>
<h3>
<a href="https://www.scintilla.org/scite414.zip">Release 4.1.4</a>
</h3>
@ -1249,7 +1273,7 @@
</li>
<li>
This is the first release of the
<a href="https://www.scintilla.org/LongTermDownload.html">long term branch</a>
<a href="https://scintilla.sourceforge.io/LongTermDownload.html">long term branch</a>
which avoids using features from C++14 or later in order to support older systems.
</li>
<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="20190307" />
<meta name="Date.Modified" content="20190417" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
#versionlist {
@ -56,8 +56,8 @@
GTK+, and OS X</font>
</td>
<td width="40%" align="right">
<font color="#FFCC99" size="3"> Release version 4.1.4<br />
Site last modified March 7 2019</font>
<font color="#FFCC99" size="3"> Release version 4.1.5<br />
Site last modified April 17 2019</font>
</td>
<td width="20%">
&nbsp;
@ -72,11 +72,12 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 4.1.5 removes special handling of non-0 wParam to WM_PAINT on Win32 and changes
clipboard operations on GTK to avoid flickering.</li>
<li>Version 4.1.4 makes calltips work on Qt and adds a lexer for .NET's Common Intermediate Language CIL.</li>
<li>Version 4.1.3 is compatible with macOS 10.14, improves performance, and adds a new lexer for Nim which will replace the "nimrod" lexer.</li>
<li>Version 4.1.2 is a minor release.</li>
<li>Version 4.1.1 adds optional indexing of line starts in UTF-8 documents by UTF-32 code points and UTF-16 code units.</li>
<li>Version 4.1.0 adds experimental support for bidirectional text as used by Arabic and Hebrew on Win32 and Cocoa.</li>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>

View File

@ -106,8 +106,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_GETIMEINTERACTION 2678
#define SCI_SETIMEINTERACTION 2679
// >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
#define SCI_ISIMEOPEN 2722
#define SCI_ISIMEMODECJK 2723
#define SCI_ISIMEOPEN 2724
#define SCI_ISIMEMODECJK 2725
// <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
#define MARKER_MAX 31
#define SC_MARK_CIRCLE 0
@ -142,6 +142,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_MARK_UNDERLINE 29
#define SC_MARK_RGBAIMAGE 30
#define SC_MARK_BOOKMARK 31
#define SC_MARK_VERTICALBOOKMARK 32
#define SC_MARK_CHARACTER 10000
#define SC_MARKNUM_FOLDEREND 25
#define SC_MARKNUM_FOLDEROPENMID 26
@ -503,6 +504,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_FOLDDISPLAYTEXT_BOXED 2
#define SCI_FOLDDISPLAYTEXTSETSTYLE 2701
#define SCI_FOLDDISPLAYTEXTGETSTYLE 2707
#define SCI_SETDEFAULTFOLDDISPLAYTEXT 2722
#define SCI_GETDEFAULTFOLDDISPLAYTEXT 2723
#define SC_FOLDACTION_CONTRACT 0
#define SC_FOLDACTION_EXPAND 1
#define SC_FOLDACTION_TOGGLE 2

View File

@ -267,8 +267,8 @@ get int GetIMEInteraction=2678(,)
set void SetIMEInteraction=2679(int imeInteraction,)
# >>>>>>>>>>>>>>> BEG NON STD SCI PATCH >>>>>>>>>>>>>>>
get bool IsIMEOpen=2722(,)
get bool IsIMEModeCJK=2723(,)
get bool IsIMEOpen=2724(,)
get bool IsIMEModeCJK=2725(,)
# <<<<<<<<<<<<<<< END NON STD SCI PATCH <<<<<<<<<<<<<<<
enu MarkerSymbol=SC_MARK_
@ -309,6 +309,7 @@ val SC_MARK_AVAILABLE=28
val SC_MARK_UNDERLINE=29
val SC_MARK_RGBAIMAGE=30
val SC_MARK_BOOKMARK=31
val SC_MARK_VERTICALBOOKMARK=32
val SC_MARK_CHARACTER=10000
@ -1247,6 +1248,12 @@ set void FoldDisplayTextSetStyle=2701(int style,)
# Get the style of fold display text.
get int FoldDisplayTextGetStyle=2707(,)
# Set the default fold display text.
fun void SetDefaultFoldDisplayText=2722(, string text)
# Get the default fold display text.
fun int GetDefaultFoldDisplayText=2723(, stringresult text)
enu FoldAction=SC_FOLDACTION_
val SC_FOLDACTION_CONTRACT=0
val SC_FOLDACTION_EXPAND=1

View File

@ -1,10 +1,10 @@
#!/usr/bin/env python
#!/usr/bin/env python3
# LexGen.py - implemented 2002 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Regenerate the Scintilla source files that list all the lexers.
# Should be run whenever a new lexer is added or removed.
# Requires Python 2.5 or later
# Requires Python 3.6 or later
# Files are regenerated in place with templates stored in comments.
# The format of generation comments is documented in FileGenerator.py.
@ -13,10 +13,12 @@ from FileGenerator import Regenerate, UpdateLineInFile, \
FindSectionInList
import ScintillaData
import HFacer
import os
import uuid
import sys
sys.path.append("../")
baseDirectory = os.path.dirname(os.path.dirname(ScintillaData.__file__))
sys.path.append(baseDirectory)
import win32.DepGen
import gtk.DepGen
@ -116,13 +118,19 @@ def RegenerateXcodeProject(path, lexers, lexerReferences):
def RegenerateAll(root):
scintillaBase = os.path.abspath(root)
sci = ScintillaData.ScintillaData(root)
Regenerate(root + "src/Catalogue.cxx", "//", sci.lexerModules)
#Regenerate(root + "win32/scintilla.mak", "#", sci.lexFiles) #commented out
startDir = os.getcwd()
os.chdir(os.path.join(scintillaBase, "win32"))
win32.DepGen.Generate()
os.chdir(os.path.join(scintillaBase, "gtk"))
gtk.DepGen.Generate()
os.chdir(startDir)
RegenerateXcodeProject(root + "cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/project.pbxproj",
sci.lexFiles, sci.lexersXcode)

View File

@ -570,7 +570,7 @@ class CaseConverter : public ICaseConverter {
enum { maxConversionLength=6 };
struct ConversionString {
char conversion[maxConversionLength+1];
ConversionString() : conversion{} {
ConversionString() noexcept : conversion{} {
}
};
// Conversions are initially store in a vector of structs but then decomposed into
@ -583,7 +583,7 @@ class CaseConverter : public ICaseConverter {
}
CharacterConversion(int character_, std::string_view conversion_) noexcept : character(character_) {
assert(conversion_.length() <= maxConversionLength);
std::copy(std::begin(conversion_), std::end(conversion_), conversion.conversion);
conversion_.copy(conversion.conversion, conversion_.length());
}
bool operator<(const CharacterConversion &other) const noexcept {
return character < other.character;
@ -596,10 +596,10 @@ class CaseConverter : public ICaseConverter {
std::vector<ConversionString> conversions;
public:
CaseConverter() {
CaseConverter() noexcept {
}
virtual ~CaseConverter() = default;
bool Initialised() const {
bool Initialised() const noexcept {
return !characters.empty();
}
void Add(int character, const char *conversion) {
@ -776,7 +776,7 @@ void SetupConversions(enum CaseConversion conversion) {
}
}
CaseConverter *ConverterForConversion(enum CaseConversion conversion) {
CaseConverter *ConverterForConversion(enum CaseConversion conversion) noexcept {
switch (conversion) {
case CaseConversionFold:
return &caseConvFold;

View File

@ -75,7 +75,6 @@ public:
bool HiddenLines() const override;
const char *GetFoldDisplayText(Sci::Line lineDoc) const override;
bool GetFoldDisplayTextShown(Sci::Line lineDoc) const override;
bool SetFoldDisplayText(Sci::Line lineDoc, const char *text) override;
bool GetExpanded(Sci::Line lineDoc) const override;
@ -277,17 +276,12 @@ const char *ContractionState<LINE>::GetFoldDisplayText(Sci::Line lineDoc) const
return foldDisplayTexts->ValueAt(lineDoc).get();
}
template <typename LINE>
bool ContractionState<LINE>::GetFoldDisplayTextShown(Sci::Line lineDoc) const {
return !GetExpanded(lineDoc) && GetFoldDisplayText(lineDoc);
}
template <typename LINE>
bool ContractionState<LINE>::SetFoldDisplayText(Sci::Line lineDoc, const char *text) {
EnsureData();
const char *foldText = foldDisplayTexts->ValueAt(lineDoc).get();
if (!foldText || !text || 0 != strcmp(text, foldText)) {
UniqueString uns = UniqueStringCopy(text);
UniqueString uns = IsNullOrEmpty(text) ? UniqueString() : UniqueStringCopy(text);
foldDisplayTexts->SetValueAt(lineDoc, std::move(uns));
Check();
return true;

View File

@ -32,7 +32,6 @@ public:
virtual bool HiddenLines() const=0;
virtual const char *GetFoldDisplayText(Sci::Line lineDoc) const=0;
virtual bool GetFoldDisplayTextShown(Sci::Line lineDoc) const=0;
virtual bool SetFoldDisplayText(Sci::Line lineDoc, const char *text)=0;
virtual bool GetExpanded(Sci::Line lineDoc) const=0;

View File

@ -10,6 +10,14 @@
namespace Scintilla {
constexpr bool IsDBCSCodePage(int codePage) noexcept {
return codePage == 932
|| codePage == 936
|| codePage == 949
|| codePage == 950
|| codePage == 1361;
}
bool DBCSIsLeadByte(int codePage, char ch) noexcept;
}

View File

@ -92,3 +92,20 @@ bool EditModel::BidirectionalEnabled() const {
bool EditModel::BidirectionalR2L() const {
return bidirectional == Bidirectional::bidiR2L;
}
void EditModel::SetDefaultFoldDisplayText(const char *text) {
defaultFoldDisplayText = IsNullOrEmpty(text) ? UniqueString() : UniqueStringCopy(text);
}
const char *EditModel::GetDefaultFoldDisplayText() const noexcept {
return defaultFoldDisplayText.get();
}
const char *EditModel::GetFoldDisplayText(Sci::Line lineDoc) const {
if (foldDisplayTextStyle == SC_FOLDDISPLAYTEXT_HIDDEN || pcs->GetExpanded(lineDoc)) {
return nullptr;
}
const char *text = pcs->GetFoldDisplayText(lineDoc);
return text ? text : defaultFoldDisplayText.get();
}

View File

@ -46,6 +46,7 @@ public:
int foldFlags;
int foldDisplayTextStyle;
UniqueString defaultFoldDisplayText;
std::unique_ptr<IContractionState> pcs;
// Hotspot support
Range hotspot;
@ -69,6 +70,9 @@ public:
virtual Range GetHotSpotRange() const noexcept = 0;
bool BidirectionalEnabled() const;
bool BidirectionalR2L() const;
void SetDefaultFoldDisplayText(const char *text);
const char *GetDefaultFoldDisplayText() const noexcept;
const char *GetFoldDisplayText(Sci::Line lineDoc) const;
};
}

View File

@ -1050,7 +1050,7 @@ void EditView::DrawEOL(Surface *surface, const EditModel &model, const ViewStyle
rcSegment.left = rcLine.left;
rcSegment.right = rcLine.right;
const bool fillRemainder = !lastSubLine || model.foldDisplayTextStyle == SC_FOLDDISPLAYTEXT_HIDDEN || !model.pcs->GetFoldDisplayTextShown(line);
const bool fillRemainder = !lastSubLine || !model.GetFoldDisplayText(line);
if (fillRemainder) {
// Fill the remainder of the line
FillLineRemainder(surface, model, vsDraw, ll, line, rcSegment, subLine);
@ -1198,11 +1198,12 @@ void EditView::DrawFoldDisplayText(Surface *surface, const EditModel &model, con
if (!lastSubLine)
return;
if ((model.foldDisplayTextStyle == SC_FOLDDISPLAYTEXT_HIDDEN) || !model.pcs->GetFoldDisplayTextShown(line))
const char *text = model.GetFoldDisplayText(line);
if (!text)
return;
PRectangle rcSegment = rcLine;
const std::string_view foldDisplayText = model.pcs->GetFoldDisplayText(line);
const std::string_view foldDisplayText(text);
FontAlias fontText = vsDraw.styles[STYLE_FOLDDISPLAYTEXT].font;
const int widthFoldDisplayText = static_cast<int>(surface->WidthText(fontText, foldDisplayText));

View File

@ -1903,6 +1903,9 @@ void Editor::FilterSelections() {
// AddCharUTF inserts an array of bytes which may or may not be in UTF-8.
void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
if (len == 0) {
return;
}
FilterSelections();
{
UndoGroup ug(pdoc, (sel.Count() > 1) || !sel.Empty() || inOverstrike);
@ -1973,12 +1976,14 @@ void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
SetLastXChosen();
}
if (treatAsDBCS) {
NotifyChar((static_cast<unsigned char>(s[0]) << 8) |
static_cast<unsigned char>(s[1]));
} else if (len > 0) {
int byte = static_cast<unsigned char>(s[0]);
if ((byte < 0xC0) || (1 == len)) {
int ch = static_cast<unsigned char>(s[0]);
if (treatAsDBCS || pdoc->dbcsCodePage != SC_CP_UTF8) {
if (len > 1) {
// DBCS code page or DBCS font character set.
ch = (ch << 8) | static_cast<unsigned char>(s[1]);
}
} else {
if ((ch < 0xC0) || (1 == len)) {
// Handles UTF-8 characters between 0x01 and 0x7F and single byte
// characters when not in UTF-8 mode.
// Also treats \0 and naked trail bytes 0x80 to 0xBF as valid
@ -1986,10 +1991,10 @@ void Editor::AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS) {
} else {
unsigned int utf32[1] = { 0 };
UTF32FromUTF8(std::string_view(s, len), utf32, std::size(utf32));
byte = utf32[0];
ch = utf32[0];
}
NotifyChar(byte);
}
NotifyChar(ch);
if (recordingMacro) {
NotifyMacroRecord(SCI_REPLACESEL, 0, reinterpret_cast<sptr_t>(s));
@ -7216,6 +7221,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_FOLDDISPLAYTEXTGETSTYLE:
return foldDisplayTextStyle;
case SCI_SETDEFAULTFOLDDISPLAYTEXT:
SetDefaultFoldDisplayText(CharPtrFromSPtr(lParam));
Redraw();
break;
case SCI_GETDEFAULTFOLDDISPLAYTEXT:
return StringResult(lParam, GetDefaultFoldDisplayText());
case SCI_TOGGLEFOLD:
FoldLine(static_cast<Sci::Line>(wParam), SC_FOLDACTION_TOGGLE);
break;

View File

@ -26,41 +26,41 @@
using namespace Scintilla;
LineMarker::~LineMarker() {
}
LineMarker::LineMarker() {
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0, 0, 0);
back = ColourDesired(0xff, 0xff, 0xff);
backSelected = ColourDesired(0xff, 0x00, 0x00);
alpha = SC_ALPHA_NOALPHA;
customDraw = nullptr;
}
LineMarker::LineMarker(const LineMarker &) {
LineMarker::LineMarker(const LineMarker &other) {
// Defined to avoid pxpm and image being blindly copied, not as a complete copy constructor.
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0, 0, 0);
back = ColourDesired(0xff, 0xff, 0xff);
backSelected = ColourDesired(0xff, 0x00, 0x00);
alpha = SC_ALPHA_NOALPHA;
pxpm.reset();
image.reset();
customDraw = nullptr;
markType = other.markType;
fore = other.fore;
back = other.back;
backSelected = other.backSelected;
alpha = other.alpha;
if (other.pxpm)
pxpm = std::make_unique<XPM>(*other.pxpm);
else
pxpm = nullptr;
if (other.image)
image = std::make_unique<RGBAImage>(*other.image);
else
image = nullptr;
customDraw = other.customDraw;
}
LineMarker &LineMarker::operator=(const LineMarker &other) {
// Defined to avoid pxpm and image being blindly copied, not as a complete assignment operator.
if (this != &other) {
markType = SC_MARK_CIRCLE;
fore = ColourDesired(0, 0, 0);
back = ColourDesired(0xff, 0xff, 0xff);
backSelected = ColourDesired(0xff, 0x00, 0x00);
alpha = SC_ALPHA_NOALPHA;
pxpm.reset();
image.reset();
customDraw = nullptr;
markType = other.markType;
fore = other.fore;
back = other.back;
backSelected = other.backSelected;
alpha = other.alpha;
if (other.pxpm)
pxpm = std::make_unique<XPM>(*other.pxpm);
else
pxpm = nullptr;
if (other.image)
image = std::make_unique<RGBAImage>(*other.image);
else
image = nullptr;
customDraw = other.customDraw;
}
return *this;
}
@ -430,6 +430,16 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
Point::FromInts(ircWhole.left, centreY + halfHeight),
};
surface->Polygon(pts, std::size(pts), fore, back);
} else if (markType == SC_MARK_VERTICALBOOKMARK) {
const int halfWidth = minDim / 3;
Point pts[] = {
Point::FromInts(centreX - halfWidth, centreY - dimOn2),
Point::FromInts(centreX + halfWidth, centreY - dimOn2),
Point::FromInts(centreX + halfWidth, centreY + dimOn2),
Point::FromInts(centreX, centreY + dimOn2 - halfWidth),
Point::FromInts(centreX - halfWidth, centreY + dimOn2),
};
surface->Polygon(pts, std::size(pts), fore, back);
} else { // SC_MARK_FULLRECT
surface->FillRectangle(rcWhole, back);
}

View File

@ -21,22 +21,26 @@ class LineMarker {
public:
enum typeOfFold { undefined, head, body, tail, headWithTail };
int markType;
ColourDesired fore;
ColourDesired back;
ColourDesired backSelected;
int alpha;
int markType = SC_MARK_CIRCLE;
ColourDesired fore = ColourDesired(0, 0, 0);
ColourDesired back = ColourDesired(0xff, 0xff, 0xff);
ColourDesired backSelected = ColourDesired(0xff, 0x00, 0x00);
int alpha = SC_ALPHA_NOALPHA;
std::unique_ptr<XPM> pxpm;
std::unique_ptr<RGBAImage> image;
/** Some platforms, notably PLAT_CURSES, do not support Scintilla's native
* Draw function for drawing line markers. Allow those platforms to override
* it instead of creating a new method(s) in the Surface class that existing
* platforms must implement as empty. */
DrawLineMarkerFn customDraw;
LineMarker();
LineMarker(const LineMarker &);
virtual ~LineMarker();
LineMarker &operator=(const LineMarker &other);
DrawLineMarkerFn customDraw = nullptr;
LineMarker() noexcept = default;
LineMarker(const LineMarker &other);
LineMarker(LineMarker &&) noexcept = default;
LineMarker &operator=(const LineMarker& other);
LineMarker &operator=(LineMarker&&) noexcept = default;
virtual ~LineMarker() = default;
void SetXPM(const char *textForm);
void SetXPM(const char *const *linesForm);
void SetRGBAImage(Point sizeRGBAImage, float scale, const unsigned char *pixelsRGBAImage);

View File

@ -32,8 +32,6 @@ protected:
idcmdSelectAll=16
};
enum { maxLenInputIME = 200 };
int displayPopupMenu;
Menu popup;
AutoComplete ac;

View File

@ -2,6 +2,8 @@
/** @file UniqueString.h
** Define UniqueString, a unique_ptr based string type for storage in containers
** and an allocator for UniqueString.
** Define UniqueStringSet which holds a set of strings, used to avoid holding many copies
** of font names.
**/
// Copyright 2017 by Neil Hodgson <neilh@scintilla.org>
// The License.txt file describes the conditions under which this software may be distributed.
@ -11,19 +13,33 @@
namespace Scintilla {
constexpr bool IsNullOrEmpty(const char *text) noexcept {
return text == nullptr || *text == '\0';
}
using UniqueString = std::unique_ptr<const char[]>;
/// Equivalent to strdup but produces a std::unique_ptr<const char[]> allocation to go
/// into collections.
inline UniqueString UniqueStringCopy(const char *text) {
if (!text) {
return UniqueString();
}
const size_t len = strlen(text);
char *sNew = new char[len + 1];
std::copy(text, text + len + 1, sNew);
return UniqueString(sNew);
}
UniqueString UniqueStringCopy(const char *text);
// A set of strings that always returns the same pointer for each string.
class UniqueStringSet {
private:
std::vector<UniqueString> strings;
public:
UniqueStringSet() noexcept;
// UniqueStringSet objects can not be copied.
UniqueStringSet(const UniqueStringSet &) = delete;
UniqueStringSet &operator=(const UniqueStringSet &) = delete;
// UniqueStringSet objects can be moved.
UniqueStringSet(UniqueStringSet &&) = default;
UniqueStringSet &operator=(UniqueStringSet &&) = default;
~UniqueStringSet();
void Clear() noexcept;
const char *Save(const char *text);
};
}

View File

@ -29,38 +29,11 @@
using namespace Scintilla;
MarginStyle::MarginStyle(int style_, int width_, int mask_) :
MarginStyle::MarginStyle(int style_, int width_, int mask_) noexcept :
style(style_), width(width_), mask(mask_), sensitive(false), cursor(SC_CURSORREVERSEARROW) {
}
// A list of the fontnames - avoids wasting space in each style
FontNames::FontNames() {
}
FontNames::~FontNames() {
Clear();
}
void FontNames::Clear() {
names.clear();
}
const char *FontNames::Save(const char *name) {
if (!name)
return nullptr;
for (const UniqueString &nm : names) {
if (strcmp(nm.get(), name) == 0) {
return nm.get();
}
}
names.push_back(UniqueStringCopy(name));
return names.back().get();
}
FontRealised::FontRealised() {
}
FontRealised::FontRealised() noexcept = default;
FontRealised::~FontRealised() {
font.Release();
@ -376,7 +349,7 @@ void ViewStyle::Refresh(Surface &surface, int tabInChars) {
textStart = marginInside ? fixedColumnWidth : leftMarginWidth;
}
void ViewStyle::ReleaseAllExtendedStyles() {
void ViewStyle::ReleaseAllExtendedStyles() noexcept {
nextExtendedStyle = 256;
}
@ -422,11 +395,11 @@ void ViewStyle::SetStyleFontName(int styleIndex, const char *name) {
styles[styleIndex].fontName = fontNames.Save(name);
}
bool ViewStyle::ProtectionActive() const {
bool ViewStyle::ProtectionActive() const noexcept {
return someStylesProtected;
}
int ViewStyle::ExternalMarginWidth() const {
int ViewStyle::ExternalMarginWidth() const noexcept {
return marginInside ? 0 : fixedColumnWidth;
}
@ -441,7 +414,7 @@ int ViewStyle::MarginFromLocation(Point pt) const {
return margin;
}
bool ViewStyle::ValidStyle(size_t styleIndex) const {
bool ViewStyle::ValidStyle(size_t styleIndex) const noexcept {
return styleIndex < styles.size();
}
@ -461,11 +434,11 @@ void ViewStyle::CalcLargestMarkerHeight() {
}
}
int ViewStyle::GetFrameWidth() const {
int ViewStyle::GetFrameWidth() const noexcept {
return std::clamp(caretLineFrame, 1, lineHeight / 3);
}
bool ViewStyle::IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const {
bool ViewStyle::IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const noexcept {
return caretLineFrame && (caretActive || alwaysShowCaretLineBackground) && showCaretLineBackground &&
(caretLineAlpha == SC_ALPHA_NOALPHA) && lineContainsCaret;
}
@ -507,16 +480,16 @@ ColourOptional ViewStyle::Background(int marksOfLine, bool caretActive, bool lin
return background;
}
bool ViewStyle::SelectionBackgroundDrawn() const {
bool ViewStyle::SelectionBackgroundDrawn() const noexcept {
return selColours.back.isSet &&
((selAlpha == SC_ALPHA_NOALPHA) || (selAdditionalAlpha == SC_ALPHA_NOALPHA));
}
bool ViewStyle::WhitespaceBackgroundDrawn() const {
bool ViewStyle::WhitespaceBackgroundDrawn() const noexcept {
return (viewWhitespace != wsInvisible) && (whitespaceColours.back.isSet);
}
bool ViewStyle::WhiteSpaceVisible(bool inIndent) const {
bool ViewStyle::WhiteSpaceVisible(bool inIndent) const noexcept {
return (!inIndent && viewWhitespace == wsVisibleAfterIndent) ||
(inIndent && viewWhitespace == wsVisibleOnlyInIndent) ||
viewWhitespace == wsVisibleAlways;
@ -529,7 +502,7 @@ ColourDesired ViewStyle::WrapColour() const {
return styles[STYLE_DEFAULT].fore;
}
bool ViewStyle::SetWrapState(int wrapState_) {
bool ViewStyle::SetWrapState(int wrapState_) noexcept {
WrapMode wrapStateWanted;
switch (wrapState_) {
case SC_WRAP_WORD:
@ -550,25 +523,25 @@ bool ViewStyle::SetWrapState(int wrapState_) {
return changed;
}
bool ViewStyle::SetWrapVisualFlags(int wrapVisualFlags_) {
bool ViewStyle::SetWrapVisualFlags(int wrapVisualFlags_) noexcept {
const bool changed = wrapVisualFlags != wrapVisualFlags_;
wrapVisualFlags = wrapVisualFlags_;
return changed;
}
bool ViewStyle::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) {
bool ViewStyle::SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) noexcept {
const bool changed = wrapVisualFlagsLocation != wrapVisualFlagsLocation_;
wrapVisualFlagsLocation = wrapVisualFlagsLocation_;
return changed;
}
bool ViewStyle::SetWrapVisualStartIndent(int wrapVisualStartIndent_) {
bool ViewStyle::SetWrapVisualStartIndent(int wrapVisualStartIndent_) noexcept {
const bool changed = wrapVisualStartIndent != wrapVisualStartIndent_;
wrapVisualStartIndent = wrapVisualStartIndent_;
return changed;
}
bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) {
bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) noexcept {
const bool changed = wrapIndentMode != wrapIndentMode_;
wrapIndentMode = wrapIndentMode_;
return changed;

View File

@ -20,30 +20,17 @@ public:
int mask;
bool sensitive;
int cursor;
MarginStyle(int style_= SC_MARGIN_SYMBOL, int width_=0, int mask_=0);
MarginStyle(int style_= SC_MARGIN_SYMBOL, int width_=0, int mask_=0) noexcept;
};
/**
*/
class FontNames {
private:
std::vector<UniqueString> names;
public:
FontNames();
// FontNames objects can not be copied.
FontNames(const FontNames &) = delete;
FontNames(FontNames &&) = delete;
FontNames &operator=(const FontNames &) = delete;
FontNames &operator=(FontNames &&) = delete;
~FontNames();
void Clear();
const char *Save(const char *name);
};
class FontRealised : public FontMeasurements {
public:
Font font;
FontRealised();
FontRealised() noexcept;
// FontRealised objects can not be copied.
FontRealised(const FontRealised &) = delete;
FontRealised(FontRealised &&) = delete;
@ -99,7 +86,7 @@ struct EdgeProperties {
/**
*/
class ViewStyle {
FontNames fontNames;
UniqueStringSet fontNames;
FontMap fonts;
public:
std::vector<Style> styles;
@ -194,31 +181,31 @@ public:
void CalculateMarginWidthAndMask();
void Init(size_t stylesSize_=256);
void Refresh(Surface &surface, int tabInChars);
void ReleaseAllExtendedStyles();
void ReleaseAllExtendedStyles() noexcept;
int AllocateExtendedStyles(int numberStyles);
void EnsureStyle(size_t index);
void ResetDefaultStyle();
void ClearStyles();
void SetStyleFontName(int styleIndex, const char *name);
bool ProtectionActive() const;
int ExternalMarginWidth() const;
bool ProtectionActive() const noexcept;
int ExternalMarginWidth() const noexcept;
int MarginFromLocation(Point pt) const;
bool ValidStyle(size_t styleIndex) const;
bool ValidStyle(size_t styleIndex) const noexcept;
void CalcLargestMarkerHeight();
int GetFrameWidth() const;
bool IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const;
int GetFrameWidth() const noexcept;
bool IsLineFrameOpaque(bool caretActive, bool lineContainsCaret) const noexcept;
ColourOptional Background(int marksOfLine, bool caretActive, bool lineContainsCaret) const;
bool SelectionBackgroundDrawn() const;
bool WhitespaceBackgroundDrawn() const;
bool SelectionBackgroundDrawn() const noexcept;
bool WhitespaceBackgroundDrawn() const noexcept;
ColourDesired WrapColour() const;
bool SetWrapState(int wrapState_);
bool SetWrapVisualFlags(int wrapVisualFlags_);
bool SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_);
bool SetWrapVisualStartIndent(int wrapVisualStartIndent_);
bool SetWrapIndentMode(int wrapIndentMode_);
bool SetWrapState(int wrapState_) noexcept;
bool SetWrapVisualFlags(int wrapVisualFlags_) noexcept;
bool SetWrapVisualFlagsLocation(int wrapVisualFlagsLocation_) noexcept;
bool SetWrapVisualStartIndent(int wrapVisualStartIndent_) noexcept;
bool SetWrapIndentMode(int wrapIndentMode_) noexcept;
bool WhiteSpaceVisible(bool inIndent) const;
bool WhiteSpaceVisible(bool inIndent) const noexcept;
enum class CaretShape { invisible, line, block, bar };
bool IsBlockCaretStyle() const noexcept;

View File

@ -25,10 +25,10 @@ class XPM {
public:
explicit XPM(const char *textForm);
explicit XPM(const char *const *linesForm);
XPM(const XPM &) = delete;
XPM(XPM &&) = delete;
XPM &operator=(const XPM &) = delete;
XPM &operator=(XPM &&) = delete;
XPM(const XPM &) = default;
XPM(XPM &&) noexcept = default;
XPM &operator=(const XPM &) = default;
XPM &operator=(XPM &&) noexcept = default;
~XPM();
void Init(const char *textForm);
void Init(const char *const *linesForm);
@ -52,11 +52,10 @@ class RGBAImage {
public:
RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_);
explicit RGBAImage(const XPM &xpm);
// Deleted so RGBAImage objects can not be copied.
RGBAImage(const RGBAImage &) = delete;
RGBAImage(RGBAImage &&) = delete;
RGBAImage &operator=(const RGBAImage &) = delete;
RGBAImage &operator=(RGBAImage &&) = delete;
RGBAImage(const RGBAImage &) = default;
RGBAImage(RGBAImage &&) noexcept = default;
RGBAImage &operator=(const RGBAImage &) = default;
RGBAImage &operator=(RGBAImage &&) noexcept = default;
virtual ~RGBAImage();
int GetHeight() const { return height; }
int GetWidth() const { return width; }

View File

@ -1 +1 @@
414+
415

View File

@ -67,6 +67,7 @@ IDWriteFactory *pIDWriteFactory = nullptr;
ID2D1Factory *pD2DFactory = nullptr;
IDWriteRenderingParams *defaultRenderingParams = nullptr;
IDWriteRenderingParams *customClearTypeRenderingParams = nullptr;
D2D1_DRAW_TEXT_OPTIONS d2dDrawTextOptions = D2D1_DRAW_TEXT_OPTIONS_NONE;
static HMODULE hDLLD2D {};
static HMODULE hDLLDWrite {};
@ -105,9 +106,20 @@ bool LoadD2D() {
if (hDLLDWrite) {
DWriteCFSig fnDWCF = reinterpret_cast<DWriteCFSig>(::GetProcAddress(hDLLDWrite, "DWriteCreateFactory"));
if (fnDWCF) {
fnDWCF(DWRITE_FACTORY_TYPE_SHARED,
__uuidof(IDWriteFactory),
const GUID IID_IDWriteFactory2 = // 0439fc60-ca44-4994-8dee-3a9af7b732ec
{ 0x0439fc60, 0xca44, 0x4994, { 0x8d, 0xee, 0x3a, 0x9a, 0xf7, 0xb7, 0x32, 0xec } };
const HRESULT hr = fnDWCF(DWRITE_FACTORY_TYPE_SHARED,
IID_IDWriteFactory2,
reinterpret_cast<IUnknown**>(&pIDWriteFactory));
if (SUCCEEDED(hr)) {
// D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT
d2dDrawTextOptions = static_cast<D2D1_DRAW_TEXT_OPTIONS>(0x00000004);
} else {
fnDWCF(DWRITE_FACTORY_TYPE_SHARED,
__uuidof(IDWriteFactory),
reinterpret_cast<IUnknown**>(&pIDWriteFactory));
}
}
}
@ -1186,7 +1198,7 @@ void SurfaceD2D::SetFont(Font &font_) {
yDescent = pfm->yDescent;
yInternalLeading = pfm->yInternalLeading;
codePageText = codePage;
if (pfm->characterSet) {
if (!unicodeMode && pfm->characterSet) {
codePageText = Scintilla::CodePageFromCharSet(pfm->characterSet, codePage);
}
if (pRenderTarget) {
@ -1898,7 +1910,7 @@ void SurfaceD2D::DrawTextCommon(PRectangle rc, Font &font_, XYPOSITION ybase, st
rc.Width(), rc.Height(), &pTextLayout);
if (SUCCEEDED(hr)) {
D2D1_POINT_2F origin = {rc.left, ybase-yAscent};
pRenderTarget->DrawTextLayout(origin, pTextLayout, pBrush, D2D1_DRAW_TEXT_OPTIONS_NONE);
pRenderTarget->DrawTextLayout(origin, pTextLayout, pBrush, d2dDrawTextOptions);
pTextLayout->Release();
}
@ -2013,7 +2025,7 @@ void SurfaceD2D::MeasureWidths(Font &font_, std::string_view text, XYPOSITION *p
while (i<text.length()) {
positions[i++] = lastPos;
}
} else if (codePageText == 0) {
} else if (!IsDBCSCodePage(codePageText)) {
// One char per position
PLATFORM_ASSERT(text.length() == static_cast<size_t>(tbuf.tlen));

View File

@ -403,7 +403,6 @@ class ScintillaWin :
static int MouseModifiers(uptr_t wParam) noexcept;
Sci::Position TargetAsUTF8(char *text) const;
void AddCharUTF16(wchar_t const *wcs, unsigned int wclen);
Sci::Position EncodedFromUTF8(const char *utf8, char *encoded) const;
sptr_t WndPaint(uptr_t wParam);
@ -420,7 +419,7 @@ class ScintillaWin :
void SelectionToHangul();
void EscapeHanja();
void ToggleHanja();
void AddWString(const std::wstring &wcs);
void AddWString(std::wstring_view wsv);
UINT CodePageOfDocument() const;
bool ValidCodePage(int codePage) const noexcept override;
@ -852,31 +851,31 @@ inline int WideCharLenFromMultiByte(UINT codePage, std::string_view sv) noexcept
return WideCharFromMultiByte(codePage, sv, nullptr, 0);
}
std::string StringEncode(const std::wstring &s, int codePage) {
const int cchMulti = s.length() ? MultiByteLenFromWideChar(codePage, s) : 0;
std::string StringEncode(std::wstring_view wsv, int codePage) {
const int cchMulti = wsv.length() ? MultiByteLenFromWideChar(codePage, wsv) : 0;
std::string sMulti(cchMulti, 0);
if (cchMulti) {
MultiByteFromWideChar(codePage, s, sMulti.data(), cchMulti);
MultiByteFromWideChar(codePage, wsv, sMulti.data(), cchMulti);
}
return sMulti;
}
std::wstring StringDecode(const std::string &s, int codePage) {
const int cchWide = s.length() ? WideCharLenFromMultiByte(codePage, s) : 0;
std::wstring StringDecode(std::string_view sv, int codePage) {
const int cchWide = sv.length() ? WideCharLenFromMultiByte(codePage, sv) : 0;
std::wstring sWide(cchWide, 0);
if (cchWide) {
WideCharFromMultiByte(codePage, s, sWide.data(), cchWide);
WideCharFromMultiByte(codePage, sv, sWide.data(), cchWide);
}
return sWide;
}
std::wstring StringMapCase(const std::wstring &ws, DWORD mapFlags) {
std::wstring StringMapCase(std::wstring_view wsv, DWORD mapFlags) {
const int charsConverted = ::LCMapStringW(LOCALE_SYSTEM_DEFAULT, mapFlags,
ws.c_str(), static_cast<int>(ws.length()), nullptr, 0);
wsv.data(), static_cast<int>(wsv.length()), nullptr, 0);
std::wstring wsConverted(charsConverted, 0);
if (charsConverted) {
::LCMapStringW(LOCALE_SYSTEM_DEFAULT, mapFlags,
ws.c_str(), static_cast<int>(ws.length()), wsConverted.data(), charsConverted);
wsv.data(), static_cast<int>(wsv.length()), wsConverted.data(), charsConverted);
}
return wsConverted;
}
@ -930,27 +929,6 @@ Sci::Position ScintillaWin::EncodedFromUTF8(const char *utf8, char *encoded) con
}
}
// Add one character from a UTF-16 string, by converting to either UTF-8 or
// the current codepage. Code is similar to HandleCompositionWindowed().
void ScintillaWin::AddCharUTF16(wchar_t const *wcs, unsigned int wclen) {
if (IsUnicodeMode()) {
const std::wstring_view wsv(wcs, wclen);
size_t len = UTF8Length(wsv);
char utfval[maxLenInputIME * 3];
UTF8FromUTF16(wsv, utfval, len);
utfval[len] = '\0';
AddCharUTF(utfval, static_cast<unsigned int>(len));
} else {
const UINT cpDest = CodePageOfDocument();
char inBufferCP[maxLenInputIME * 2];
const int size = MultiByteFromWideChar(cpDest,
std::wstring_view(wcs, wclen), inBufferCP, sizeof(inBufferCP) - 1);
for (int i = 0; i < size; i++) {
AddChar(inBufferCP[i]);
}
}
}
sptr_t ScintillaWin::WndPaint(uptr_t wParam) {
//ElapsedPeriod ep;
@ -1201,15 +1179,14 @@ std::vector<int> MapImeIndicators(const std::vector<BYTE> &inputStyle) {
}
void ScintillaWin::AddWString(const std::wstring &wcs) {
if (wcs.empty())
void ScintillaWin::AddWString(std::wstring_view wsv) {
if (wsv.empty())
return;
const int codePage = CodePageOfDocument();
for (size_t i = 0; i < wcs.size(); ) {
const size_t ucWidth = UTF16CharLength(wcs[i]);
const std::wstring uniChar(wcs, i, ucWidth);
std::string docChar = StringEncode(uniChar, codePage);
for (size_t i = 0; i < wsv.size(); ) {
const size_t ucWidth = UTF16CharLength(wsv[i]);
const std::string docChar = StringEncode(wsv.substr(i, ucWidth), codePage);
AddCharUTF(docChar.c_str(), static_cast<unsigned int>(docChar.size()));
i += ucWidth;
@ -1241,7 +1218,7 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
if (lParam & GCS_COMPSTR) {
const std::wstring wcs = imc.GetCompositionString(GCS_COMPSTR);
if (wcs.empty() || (wcs.size() >= maxLenInputIME)) {
if (wcs.empty()) {
ShowCaretAtCurrentPosition();
return 0;
}
@ -1255,10 +1232,10 @@ sptr_t ScintillaWin::HandleCompositionInline(uptr_t, sptr_t lParam) {
const bool tmpRecordingMacro = recordingMacro;
recordingMacro = false;
const int codePage = CodePageOfDocument();
for (size_t i = 0; i < wcs.size(); ) {
const size_t ucWidth = UTF16CharLength(wcs[i]);
const std::wstring uniChar(wcs, i, ucWidth);
std::string docChar = StringEncode(uniChar, codePage);
const std::wstring_view wsv = wcs;
for (size_t i = 0; i < wsv.size(); ) {
const size_t ucWidth = UTF16CharLength(wsv[i]);
const std::string docChar = StringEncode(wsv.substr(i, ucWidth), codePage);
AddCharUTF(docChar.c_str(), static_cast<unsigned int>(docChar.size()));
@ -1642,7 +1619,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
lastHighSurrogateChar = 0;
wclen = 2;
}
AddCharUTF16(wcs, wclen);
AddWString(std::wstring_view(wcs, wclen));
}
return 0;
@ -1654,7 +1631,7 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam
} else {
wchar_t wcs[3] = { 0 };
const unsigned int wclen = UTF16FromUTF32Character(static_cast<unsigned int>(wParam), wcs);
AddCharUTF16(wcs, wclen);
AddWString(std::wstring_view(wcs, wclen));
return FALSE;
}

View File

@ -25,12 +25,12 @@ KEYWORDLIST KeyWords_HTML = {
"onoffline ononline onpagehide onpageshow onpause onplay onplaying onpopstate onprogress "
"onratechange onreadystatechange onredo onreset onresize onscroll onseeked onseeking onselect "
"onshow onstalled onstorage onsubmit onsuspend ontimeupdate onundo onunload onvolumechange "
"onwaiting open optgroup optimum option output p param password pattern ping placeholder poster "
"onwaiting open optgroup optimum option output p param password pattern picture ping placeholder poster "
"pre prefix preload profile progress prompt property pubdate public q radio radiogroup readonly rel "
"required reset rev reversed role rows rowspan rp rt ruby rules s samp sandbox scheme scope scoped script "
"scrolling seamless section select selected shape size sizes small source span spellcheck src "
"scrolling seamless section select selected shape size sizes slot small source span spellcheck src "
"srcdoc srclang standby start step strike strong style sub submit summary sup tabindex table "
"target tbody td text textarea tfoot th thead time title topmargin tr track translate tt type "
"target tbody td template text textarea tfoot th thead time title topmargin tr track translate tt type "
"typemustmatch u ul usemap valign value valuetype var version video vlink vspace wbr width wrap xml "
"xmlns",
"abstract boolean break byte case catch char class const continue debugger default delete do "
@ -117,31 +117,5 @@ SCLEX_HTML, IDS_LEX_WEB_SRC, L"Web Source Code", L"html; htm; asp; aspx; shtml;
{ {SCE_HBA_IDENTIFIER}, IDS_LEX_STR_63186, L"ASP VBS Identifier", L"", L"" },
{ {MULTI_STYLE(SCE_HBA_STRING,SCE_HBA_STRINGEOL,0,0)}, IDS_LEX_STR_63185, L"ASP VBS String", L"fore:#008000", L"" },
{ {SCE_HBA_NUMBER}, IDS_LEX_STR_63183, L"ASP VBS Number", L"fore:#FF0000", L"" },
//{ {SCE_HP_START}, L"Phyton Start", L"", L"" },
//{ {SCE_HP_DEFAULT}, L"Phyton Default", L"", L"" },
//{ {SCE_HP_COMMENTLINE}, L"Phyton Comment Line", L"", L"" },
//{ {SCE_HP_NUMBER}, L"Phyton Number", L"", L"" },
//{ {SCE_HP_STRING}, L"Phyton String", L"", L"" },
//{ {SCE_HP_CHARACTER}, L"Phyton Character", L"", L"" },
//{ {SCE_HP_WORD}, L"Phyton Keyword", L"", L"" },
//{ {SCE_HP_TRIPLE}, L"Phyton Triple", L"", L"" },
//{ {SCE_HP_TRIPLEDOUBLE}, L"Phyton Triple Double", L"", L"" },
//{ {SCE_HP_CLASSNAME}, L"Phyton Class Name", L"", L"" },
//{ {SCE_HP_DEFNAME}, L"Phyton Def Name", L"", L"" },
//{ {SCE_HP_OPERATOR}, L"Phyton Operator", L"", L"" },
//{ {SCE_HP_IDENTIFIER}, L"Phyton Identifier", L"", L"" },
//{ {SCE_HPA_START}, L"ASP Phyton Start", L"", L"" },
//{ {SCE_HPA_DEFAULT}, L"ASP Phyton Default", L"", L"" },
//{ {SCE_HPA_COMMENTLINE}, L"ASP Phyton Comment Line", L"", L"" },
//{ {SCE_HPA_NUMBER}, L"ASP Phyton Number", L"", L"" },
//{ {SCE_HPA_STRING}, L"ASP Phyton String", L"", L"" },
//{ {SCE_HPA_CHARACTER}, L"ASP Phyton Character", L"", L"" },
//{ {SCE_HPA_WORD}, L"ASP Phyton Keyword", L"", L"" },
//{ {SCE_HPA_TRIPLE}, L"ASP Phyton Triple", L"", L"" },
//{ {SCE_HPA_TRIPLEDOUBLE}, L"ASP Phyton Triple Double", L"", L"" },
//{ {SCE_HPA_CLASSNAME}, L"ASP Phyton Class Name", L"", L"" },
//{ {SCE_HPA_DEFNAME}, L"ASP Phyton Def Name", L"", L"" },
//{ {SCE_HPA_OPERATOR}, L"ASP Phyton Operator", L"", L"" },
//{ {SCE_HPA_IDENTIFIER}, L"ASP Phyton Identifier", L"", L"" },
EDITLEXER_SENTINEL } };

View File

@ -62,15 +62,9 @@
#if defined(_MSC_VER)
#if (_MSC_VER >= 1920)
#if(_MSC_FULL_VER >= 192027508)
#define VER_CPL MS Visual C++ 2019 16.0.0 & Prev(4.3-5.0)
#elif(_MSC_FULL_VER >= 192027404)
#define VER_CPL MS Visual C++ 2019 16.0.0 Prev 4.(0-2)
#elif(_MSC_FULL_VER >= 192027323)
#define VER_CPL MS Visual C++ 2019 16.0.0 Prev 3.0
#elif(_MSC_FULL_VER >= 192027305)
#define VER_CPL MS Visual C++ 2019 16.0.0 Prev 2.(0-2)
#define VER_CPL MS Visual C++ 2019 v16.0.(0-1)
#elif(_MSC_FULL_VER >= 192027027)
#define VER_CPL MS Visual C++ 2019 16.0.0 Prev 1.0
#define VER_CPL MS Visual C++ 2019 v16.0.Prev(1-4)
#endif
#elif (_MSC_VER >= 1916)
#if(_MSC_FULL_VER >= 191627027)

View File

@ -7,8 +7,8 @@
#define SAPPNAME "Notepad3"
#define VERSION_MAJOR 5
#define VERSION_MINOR 19
#define VERSION_REV 314
#define VERSION_BUILD 1658
#define SCINTILLA_VER 414+
#define VERSION_REV 418
#define VERSION_BUILD 1672
#define SCINTILLA_VER 415
#define ONIGMO_REGEX_VER 6.2.0
#define VERSION_PATCH XpErImEnTaL
#define VERSION_PATCH develop