Commit 00166e79 authored by Andreas Rönnquist's avatar Andreas Rönnquist

New upstream version 4.2.0

parent a45d860b
......@@ -80,7 +80,7 @@ public:
void PenColour(ColourDesired fore) override;
/** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */
CGImageRef GetImage();
CGImageRef CreateImage();
void CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect);
int LogPixelsY() override;
......
......@@ -483,8 +483,8 @@ void SurfaceImpl::FillColour(const ColourDesired &back) {
//--------------------------------------------------------------------------------------------------
CGImageRef SurfaceImpl::GetImage() {
// For now, assume that GetImage can only be called on PixMap surfaces.
CGImageRef SurfaceImpl::CreateImage() {
// For now, assume that CreateImage can only be called on PixMap surfaces.
if (!bitmapData)
return NULL;
......@@ -655,7 +655,7 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) {
SurfaceImpl &patternSurface = static_cast<SurfaceImpl &>(surfacePattern);
// For now, assume that copy can only be called on PixMap surfaces. Shows up black.
CGImageRef image = patternSurface.GetImage();
CGImageRef image = patternSurface.CreateImage();
if (image == NULL) {
FillRectangle(rc, ColourDesired(0));
return;
......@@ -970,7 +970,7 @@ void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)
void SurfaceImpl::CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect) {
SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource);
CGImageRef image = source.GetImage();
CGImageRef image = source.CreateImage();
CGRect src = PRectangleToCGRect(srcRect);
CGRect dst = PRectangleToCGRect(dstRect);
......@@ -1002,7 +1002,7 @@ void SurfaceImpl::Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSou
SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource);
// Get the CGImageRef
CGImageRef image = source.GetImage();
CGImageRef image = source.CreateImage();
// If we could not get an image reference, fill the rectangle black
if (image == NULL) {
FillRectangle(rc, ColourDesired(0));
......@@ -1471,7 +1471,7 @@ static NSImage *ImageFromXPM(XPM *pxpm) {
SurfaceImpl *surfaceIXPM = static_cast<SurfaceImpl *>(surfaceXPM.get());
CGContextClearRect(surfaceIXPM->GetContext(), CGRectMake(0, 0, width, height));
pxpm->Draw(surfaceXPM.get(), rcxpm);
CGImageRef imageRef = surfaceIXPM->GetImage();
CGImageRef imageRef = surfaceIXPM->CreateImage();
img = [[NSImage alloc] initWithCGImage: imageRef size: NSZeroSize];
CGImageRelease(imageRef);
}
......
......@@ -197,7 +197,7 @@ public:
void ObserverRemove();
void IdleWork() override;
void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) override;
ptrdiff_t InsertText(NSString *input);
ptrdiff_t InsertText(NSString *input, CharacterSource charSource);
NSRange PositionsFromCharacters(NSRange rangeCharacters) const;
NSRange CharactersFromPositions(NSRange rangePositions) const;
NSString *RangeTextAsString(NSRange rangePositions) const;
......
......@@ -1409,7 +1409,7 @@ void ScintillaCocoa::StartDrag() {
// the full rectangle which may include non-selected text.
NSBitmapImageRep *bitmap = NULL;
CGImageRef imagePixmap = pixmap.GetImage();
CGImageRef imagePixmap = pixmap.CreateImage();
if (imagePixmap)
bitmap = [[NSBitmapImageRep alloc] initWithCGImage: imagePixmap];
CGImageRelease(imagePixmap);
......@@ -2175,26 +2175,39 @@ bool ScintillaCocoa::KeyboardInput(NSEvent *event) {
/**
* Used to insert already processed text provided by the Cocoa text input system.
*/
ptrdiff_t ScintillaCocoa::InsertText(NSString *input) {
CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
vs.styles[STYLE_DEFAULT].characterSet);
std::string encoded = EncodedBytesString((__bridge CFStringRef)input, encoding);
if (encoded.length() > 0) {
if (encoding == kCFStringEncodingUTF8) {
// There may be multiple characters in input so loop over them
std::string_view sv = encoded;
while (sv.length()) {
const unsigned char leadByte = sv[0];
const unsigned int bytesInCharacter = UTF8BytesOfLead[leadByte];
AddCharUTF(sv.data(), bytesInCharacter, false);
sv.remove_prefix(bytesInCharacter);
}
} else {
AddCharUTF(encoded.c_str(), static_cast<unsigned int>(encoded.length()), false);
ptrdiff_t ScintillaCocoa::InsertText(NSString *input, CharacterSource charSource) {
if ([input length] == 0) {
return 0;
}
// There may be multiple characters in input so loop over them
if (IsUnicodeMode()) {
// There may be non-BMP characters as 2 elements in NSString so
// convert to UTF-8 and use UTF8BytesOfLead.
std::string encoded = EncodedBytesString((__bridge CFStringRef)input,
kCFStringEncodingUTF8);
std::string_view sv = encoded;
while (sv.length()) {
const unsigned char leadByte = sv[0];
const unsigned int bytesInCharacter = UTF8BytesOfLead[leadByte];
InsertCharacter(sv.substr(0, bytesInCharacter), charSource);
sv.remove_prefix(bytesInCharacter);
}
return encoded.length();
} else {
const CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(),
vs.styles[STYLE_DEFAULT].characterSet);
ptrdiff_t lengthInserted = 0;
for (NSInteger i = 0; i < [input length]; i++) {
NSString *character = [input substringWithRange:NSMakeRange(i, 1)];
std::string encoded = EncodedBytesString((__bridge CFStringRef)character,
encoding);
lengthInserted += encoded.length();
InsertCharacter(encoded, charSource);
}
return lengthInserted;
}
return encoded.length();
}
//--------------------------------------------------------------------------------------------------
......@@ -2274,7 +2287,7 @@ void ScintillaCocoa::CompositionStart() {
*/
void ScintillaCocoa::CompositionCommit() {
pdoc->TentativeCommit();
pdoc->DecorationSetCurrentIndicator(INDIC_IME);
pdoc->DecorationSetCurrentIndicator(INDICATOR_IME);
pdoc->DecorationFillRange(0, 0, pdoc->Length());
}
......
......@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>4.1.7</string>
<string>4.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>4.1.7</string>
<string>4.2.0</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
......
......@@ -233,6 +233,7 @@
F437405F9F32C7DEFCA38C11 /* LexIndent.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */; };
FDC7442CAD70B9A67EF1639D /* LexSAS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = A95147A1AB7CADB00DAFE724 /* LexSAS.cxx */; };
AE894E1CB7328CAE5B2EF47E /* LexX12.cxx in Sources */ = {isa = PBXBuildFile; fileRef = ADA64364A443F3E3F02D294E /* LexX12.cxx */; };
902B40FE926FE48538B168F1 /* LexDataflex.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 362E48F5A7F79598CB0B037D /* LexDataflex.cxx */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
......@@ -469,6 +470,7 @@
A95147A1AB7CADB00DAFE724 /* LexSAS.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexSAS.cxx; path = ../../lexers/LexSAS.cxx; sourceTree = SOURCE_ROOT; };
D2F7E79907B2D74100F64583 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
ADA64364A443F3E3F02D294E /* LexX12.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexX12.cxx; path = ../../lexers/LexX12.cxx; sourceTree = SOURCE_ROOT; };
362E48F5A7F79598CB0B037D /* LexDataflex.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LexDataflex.cxx; path = ../../lexers/LexDataflex.cxx; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -594,6 +596,7 @@
114B6ED111FA7526004FB6AB /* LexCsound.cxx */,
114B6ED211FA7526004FB6AB /* LexCSS.cxx */,
114B6ED311FA7526004FB6AB /* LexD.cxx */,
362E48F5A7F79598CB0B037D /* LexDataflex.cxx */,
28B647071B54C0720009DC49 /* LexDiff.cxx */,
11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */,
28064A04190F12E100E6E47F /* LexDMIS.cxx */,
......@@ -1134,6 +1137,7 @@
0ED84236A703D57578EBFD2F /* LexNim.cxx in Sources */,
00724A59981D34F11A3D162F /* LexCIL.cxx in Sources */,
AE894E1CB7328CAE5B2EF47E /* LexX12.cxx in Sources */,
902B40FE926FE48538B168F1 /* LexDataflex.cxx in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -415,7 +415,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
}
[mOwner message: SCI_SETTARGETRANGE wParam: posRange.location lParam: NSMaxRange(posRange)];
std::string text([mOwner message: SCI_TARGETASUTF8] + 1, 0);
std::string text([mOwner message: SCI_TARGETASUTF8], 0);
[mOwner message: SCI_TARGETASUTF8 wParam: 0 lParam: reinterpret_cast<sptr_t>(&text[0])];
text = FixInvalidUTF8(text);
NSString *result = @(text.c_str());
......@@ -425,12 +425,14 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
// SCI_GETSTYLEAT reports a signed byte but want an unsigned to index into styles
const char styleByte = static_cast<char>([mOwner message: SCI_GETSTYLEAT wParam: posRange.location]);
const long style = static_cast<unsigned char>(styleByte);
std::string fontName([mOwner message: SCI_STYLEGETFONT wParam: style lParam: 0] + 1, 0);
std::string fontName([mOwner message: SCI_STYLEGETFONT wParam: style lParam: 0], 0);
[mOwner message: SCI_STYLEGETFONT wParam: style lParam: (sptr_t)&fontName[0]];
const CGFloat fontSize = [mOwner message: SCI_STYLEGETSIZEFRACTIONAL wParam: style] / 100.0f;
NSString *sFontName = @(fontName.c_str());
NSFont *font = [NSFont fontWithName: sFontName size: fontSize];
[asResult addAttribute: NSFontAttributeName value: font range: rangeAS];
if (font) {
[asResult addAttribute: NSFontAttributeName value: font range: rangeAS];
}
return asResult;
}
......@@ -527,7 +529,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
else if ([aString isKindOfClass: [NSAttributedString class]])
newText = (NSString *) [aString string];
mOwner.backend->InsertText(newText);
mOwner.backend->InsertText(newText, EditModel::CharacterSource::directInput);
}
//--------------------------------------------------------------------------------------------------
......@@ -620,11 +622,11 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
NSRange posRangeCurrent = mOwner.backend->PositionsFromCharacters(NSMakeRange(replacementRange.location, 0));
// Note: Scintilla internally works almost always with bytes instead chars, so we need to take
// this into account when determining selection ranges and such.
ptrdiff_t lengthInserted = mOwner.backend->InsertText(newText);
ptrdiff_t lengthInserted = mOwner.backend->InsertText(newText, EditModel::CharacterSource::tentativeInput);
posRangeCurrent.length = lengthInserted;
mMarkedTextRange = mOwner.backend->CharactersFromPositions(posRangeCurrent);
// Mark the just inserted text. Keep the marked range for later reset.
[mOwner setGeneralProperty: SCI_SETINDICATORCURRENT value: INDIC_IME];
[mOwner setGeneralProperty: SCI_SETINDICATORCURRENT value: INDICATOR_IME];
[mOwner setGeneralProperty: SCI_INDICATORFILLRANGE
parameter: posRangeCurrent.location
value: posRangeCurrent.length];
......@@ -1374,11 +1376,11 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
* input composition, depending on language, keyboard etc.
*/
- (void) updateIndicatorIME {
[self setColorProperty: SCI_INDICSETFORE parameter: INDIC_IME fromHTML: @"#FF0000"];
[self setColorProperty: SCI_INDICSETFORE parameter: INDICATOR_IME fromHTML: @"#FF0000"];
const bool drawInBackground = [self message: SCI_GETPHASESDRAW] != 0;
[self setGeneralProperty: SCI_INDICSETUNDER parameter: INDIC_IME value: drawInBackground];
[self setGeneralProperty: SCI_INDICSETSTYLE parameter: INDIC_IME value: INDIC_PLAIN];
[self setGeneralProperty: SCI_INDICSETALPHA parameter: INDIC_IME value: 100];
[self setGeneralProperty: SCI_INDICSETUNDER parameter: INDICATOR_IME value: drawInBackground];
[self setGeneralProperty: SCI_INDICSETSTYLE parameter: INDICATOR_IME value: INDIC_PLAIN];
[self setGeneralProperty: SCI_INDICSETALPHA parameter: INDICATOR_IME value: 100];
}
//--------------------------------------------------------------------------------------------------
......@@ -1963,9 +1965,9 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
- (void) insertText: (id) aString {
if ([aString isKindOfClass: [NSString class]])
mBackend->InsertText(aString);
mBackend->InsertText(aString, EditModel::CharacterSource::directInput);
else if ([aString isKindOfClass: [NSAttributedString class]])
mBackend->InsertText([aString string]);
mBackend->InsertText([aString string], EditModel::CharacterSource::directInput);
}
//--------------------------------------------------------------------------------------------------
......
......@@ -38,6 +38,7 @@ variableScope:scintilla/lexers/LexBash.cxx
variableScope:scintilla/lexers/LexBatch.cxx
variableScope:scintilla/lexers/LexCmake.cxx
variableScope:scintilla/lexers/LexCSS.cxx
variableScope:scintilla/lexers/LexDataflex.cxx
variableScope:scintilla/lexers/LexErlang.cxx
variableScope:scintilla/lexers/LexGui4Cli.cxx
variableScope:scintilla/lexers/LexInno.cxx
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -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/scintilla417.zip">
<font size="4"> <a href="https://www.scintilla.org/scintilla420.zip">
Windows</a>&nbsp;&nbsp;
<a href="https://www.scintilla.org/scintilla417.tgz">
<a href="https://www.scintilla.org/scintilla420.tgz">
GTK/Linux</a>&nbsp;&nbsp;
</font>
</td>
......@@ -42,7 +42,7 @@
containing very few restrictions.
</p>
<h3>
Release 4.1.7
Release 4.2.0
</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/scintilla417.zip">zip format</a> (1700K) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla417.tgz">tgz format</a> (1500K) commonly used on Linux and compatible operating systems</li>
<li><a href="https://www.scintilla.org/scintilla420.zip">zip format</a> (1.7M) commonly used on Windows</li>
<li><a href="https://www.scintilla.org/scintilla420.tgz">tgz format</a> (1.4M) 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>
......
......@@ -542,6 +542,9 @@
<td>Jad Altahan</td>
<td>Andrea Ricchi</td>
<td>Juarez Rudsatz</td>
<td>Wil van Antwerpen</td>
</tr><tr>
<td>Hodong Kim</td>
</tr>
</table>
<p>
......@@ -553,6 +556,60 @@
Icons</a> Copyright(C) 1998 by Dean S. Jones<br />
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scite420.zip">Release 4.2.0</a>
</h3>
<ul>
<li>
Released 5 July 2019.
</li>
<li>
Scintilla.iface adds line and pointer types, increases use of the position type, uses enumeration
types in methods and properties, and adds enumeration aliases to produce better CamelCase
identifiers.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1297/">Feature #1297</a>.
</li>
<li>
Source of input (direct / IME composition / IME result) reported in SCN_CHARADDED so applications
can treat temporary IME composition input differently.
<a href="https://sourceforge.net/p/scintilla/bugs/2038/">Bug #2038</a>.
</li>
<li>
Lexer added for DataFlex.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1295/">Feature #1295</a>.
</li>
<li>
Matlab lexer now treats keywords as case-sensitive.
<a href="https://sourceforge.net/p/scintilla/bugs/2112/">Bug #2112</a>.
</li>
<li>
SQL lexer fixes single quoted strings where '" (quote, double quote) was seen as continuing the string.
<a href="https://sourceforge.net/p/scintilla/bugs/2098/">Bug #2098</a>.
</li>
<li>
Platform layers should use InsertCharacter method to perform keyboard and IME input, replacing
AddCharUTF method.
<a href="https://sourceforge.net/p/scintilla/feature-requests/1293/">Feature #1293</a>.
</li>
<li>
Add CARETSTYLE_BLOCK_AFTER option to always display block caret after selection.
<a href="https://sourceforge.net/p/scintilla/bugs/1924/">Bug #1924</a>.
</li>
<li>
On Win32, limit text returned from WM_GETTEXT to the length specified in wParam.
This could cause failures when using assistive technologies like NVDA.
<a href="https://sourceforge.net/p/scintilla/bugs/2110/">Bug #2110</a>,
<a href="https://sourceforge.net/p/scintilla/bugs/2114/">Bug #2114</a>.
</li>
<li>
Fix deletion of isolated invalid bytes.
<a href="https://sourceforge.net/p/scintilla/bugs/2116/">Bug #2116</a>.
</li>
<li>
Fix position of line caret when overstrike caret set to block.
<a href="https://sourceforge.net/p/scintilla/bugs/2106/">Bug #2106</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/scite417.zip">Release 4.1.7</a>
</h3>
......
......@@ -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="20190613" />
<meta name="Date.Modified" content="20190705" />
<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.7<br />
Site last modified June 13 2019</font>
<font color="#FFCC99" size="3"> Release version 4.2.0<br />
Site last modified July 5 2019</font>
</td>
<td width="20%">
&nbsp;
......@@ -72,14 +72,12 @@
</tr>
</table>
<ul id="versionlist">
<li>Version 4.2.0 adds new types to Scintilla.iface.</li>
<li>Version 4.1.7 is just to match a bug-fix release of SciTE and changes nothing in Scintilla.</li>
<li>Version 4.1.6 adds an X12 lexer and improves performance on huge files.</li>
<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>
</ul>
<ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
......
......@@ -91,10 +91,10 @@
#define IS_WIDGET_REALIZED(w) (gtk_widget_get_realized(GTK_WIDGET(w)))
#define IS_WIDGET_MAPPED(w) (gtk_widget_get_mapped(GTK_WIDGET(w)))
#define SC_INDICATOR_INPUT INDIC_IME
#define SC_INDICATOR_TARGET INDIC_IME+1
#define SC_INDICATOR_CONVERTED INDIC_IME+2
#define SC_INDICATOR_UNKNOWN INDIC_IME_MAX
#define SC_INDICATOR_INPUT INDICATOR_IME
#define SC_INDICATOR_TARGET INDICATOR_IME+1
#define SC_INDICATOR_CONVERTED INDICATOR_IME+2
#define SC_INDICATOR_UNKNOWN INDICATOR_IME_MAX
static GdkWindow *WindowFromWidget(GtkWidget *w) noexcept {
return gtk_widget_get_window(w);
......@@ -2259,9 +2259,9 @@ void ScintillaGTK::MoveImeCarets(int pos) {
void ScintillaGTK::DrawImeIndicator(int indicator, int len) {
// Emulate the visual style of IME characters with indicators.
// Draw an indicator on the character before caret by the character bytes of len
// so it should be called after addCharUTF().
// so it should be called after InsertCharacter().
// It does not affect caret positions.
if (indicator < 8 || indicator > INDIC_MAX) {
if (indicator < 8 || indicator > INDICATOR_MAX) {
return;
}
pdoc->DecorationSetCurrentIndicator(indicator);
......@@ -2351,7 +2351,7 @@ void ScintillaGTK::CommitThis(char *commitStr) {
if (!IsUnicodeMode())
docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true);
AddCharUTF(docChar.c_str(), docChar.size());
InsertCharacter(docChar, CharacterSource::directInput);
}
g_free(uniStr);
ShowCaretAtCurrentPosition();
......@@ -2403,8 +2403,6 @@ void ScintillaGTK::PreeditChangedInlineThis() {
std::vector<int> indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str);
const bool tmpRecordingMacro = recordingMacro;
recordingMacro = false;
for (glong i = 0; i < preeditStr.uniStrLen; i++) {
gchar u8Char[UTF8MaxBytes+2] = {0};
const gint u8CharLen = g_unichar_to_utf8(preeditStr.uniStr[i], u8Char);
......@@ -2412,11 +2410,10 @@ void ScintillaGTK::PreeditChangedInlineThis() {
if (!IsUnicodeMode())
docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true);
AddCharUTF(docChar.c_str(), docChar.size());
InsertCharacter(docChar, CharacterSource::tentativeInput);
DrawImeIndicator(indicator[i], docChar.size());
}
recordingMacro = tmpRecordingMacro;
// Move caret to ime cursor position.
const int imeEndToImeCaretU32 = preeditStr.cursor_pos - preeditStr.uniStrLen;
......
......@@ -914,6 +914,18 @@ LexD.o: \
../lexlib/LexerModule.h \
../lexlib/OptionSet.h \
../lexlib/DefaultLexer.h
LexDataflex.o: \
../lexers/LexDataflex.cxx \
../include/ILexer.h \
../include/Sci_Position.h \
../include/Scintilla.h \
../include/SciLexer.h \
../lexlib/WordList.h \
../lexlib/LexAccessor.h \
../lexlib/Accessor.h \
../lexlib/StyleContext.h \
../lexlib/CharacterSet.h \
../lexlib/LexerModule.h
LexDiff.o: \
../lexers/LexDiff.cxx \
../include/ILexer.h \
......
......@@ -57,10 +57,7 @@ vpath %.c $(srcdir)
vpath %.cxx $(srcdir) $(srcdir)/../src $(srcdir)/../lexlib $(srcdir)/../lexers
INCLUDEDIRS=-I $(srcdir)/../include -I $(srcdir)/../src -I $(srcdir)/../lexlib
ifdef CHECK_DEPRECATED
DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
endif
CXXBASEFLAGS=$(CXXWARNFLAGS) $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
CXXBASEFLAGS=$(CXXWARNFLAGS) $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS)
ifdef NOTHREADS
THREADFLAGS=-DG_THREADS_IMPL_NONE
......
......@@ -141,6 +141,7 @@
#define SCLEX_NIM 126
#define SCLEX_CIL 127
#define SCLEX_X12 128
#define SCLEX_DATAFLEX 129
#define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1
......@@ -1895,6 +1896,21 @@
#define SCE_X12_SEGMENTEND 6
#define SCE_X12_SEP_ELEMENT 7
#define SCE_X12_SEP_SUBELEMENT 8
#define SCE_DF_DEFAULT 0
#define SCE_DF_IDENTIFIER 1
#define SCE_DF_METATAG 2
#define SCE_DF_IMAGE 3
#define SCE_DF_COMMENTLINE 4
#define SCE_DF_PREPROCESSOR 5
#define SCE_DF_PREPROCESSOR2 6
#define SCE_DF_NUMBER 7
#define SCE_DF_HEXNUMBER 8
#define SCE_DF_WORD 9
#define SCE_DF_STRING 10
#define SCE_DF_STRINGEOL 11
#define SCE_DF_SCOPEWORD 12
#define SCE_DF_OPERATOR 13
#define SCE_DF_ICODE 14
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */
#endif
......@@ -293,14 +293,14 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define INDIC_POINTCHARACTER 19
#define INDIC_GRADIENT 20
#define INDIC_GRADIENTCENTRE 21
#define INDIC_CONTAINER 8
#define INDIC_IME 32
#define INDIC_IME_MAX 35
#define INDIC_MAX 35
#define INDIC_CONTAINER 8
#define INDIC0_MASK 0x20
#define INDIC1_MASK 0x40
#define INDIC2_MASK 0x80
#define INDICS_MASK 0xE0
#define INDICATOR_CONTAINER 8
#define INDICATOR_IME 32
#define INDICATOR_IME_MAX 35
#define INDICATOR_MAX 35
#define SCI_INDICSETSTYLE 2080
#define SCI_INDICGETSTYLE 2081
#define SCI_INDICSETFORE 2082
......@@ -399,6 +399,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_PRINT_SCREENCOLOURS 5
#define SCI_SETPRINTCOLOURMODE 2148
#define SCI_GETPRINTCOLOURMODE 2149
#define SCFIND_NONE 0x0
#define SCFIND_WHOLEWORD 0x2
#define SCFIND_MATCHCASE 0x4
#define SCFIND_WORDSTART 0x00100000
......@@ -834,8 +835,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define CARETSTYLE_LINE 1
#define CARETSTYLE_BLOCK 2
#define CARETSTYLE_OVERSTRIKE_BAR 0
#define CARETSTYLE_OVERSTRIKE_BLOCK 16
#define CARETSTYLE_OVERSTRIKE_BLOCK 0x10
#define CARETSTYLE_INS_MASK 0xF
#define CARETSTYLE_BLOCK_AFTER 0x100
#define SCI_SETCARETSTYLE 2512
#define SCI_GETCARETSTYLE 2513
#define SCI_SETINDICATORCURRENT 2500
......@@ -894,6 +896,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_ANNOTATIONGETSTYLEOFFSET 2551
#define SCI_RELEASEALLEXTENDEDSTYLES 2552
#define SCI_ALLOCATEEXTENDEDSTYLES 2553
#define UNDO_NONE 0
#define UNDO_MAY_COALESCE 1
#define SCI_ADDUNDOACTION 2560
#define SCI_CHARPOSITIONFROMPOINT 2561
......@@ -1026,6 +1029,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_NAMEOFSTYLE 4030
#define SCI_TAGSOFSTYLE 4031
#define SCI_DESCRIPTIONOFSTYLE 4032
#define SC_MOD_NONE 0x0
#define SC_MOD_INSERTTEXT 0x1
#define SC_MOD_DELETETEXT 0x2
#define SC_MOD_CHANGESTYLE 0x4
......@@ -1087,6 +1091,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_AC_TAB 3
#define SC_AC_NEWLINE 4
#define SC_AC_COMMAND 5
#define SC_CHARACTERSOURCE_DIRECT_INPUT 0
#define SC_CHARACTERSOURCE_TENTATIVE_INPUT 1
#define SC_CHARACTERSOURCE_IME_RESULT 2
#define SCN_STYLENEEDED 2000
#define SCN_CHARADDED 2001
#define SCN_SAVEPOINTREACHED 2002
......@@ -1229,6 +1236,7 @@ struct SCNotification {
int updated; /* SCN_UPDATEUI */
int listCompletionMethod;
/* SCN_AUTOCSELECTION, SCN_AUTOCCOMPLETED, SCN_USERLISTSELECTION, */
int characterSource; /* SCN_CHARADDED */
};
#ifdef INCLUDE_DEPRECATED_FEATURES
......@@ -1249,6 +1257,11 @@ struct SCNotification {
#define SCI_GETSTYLEBITS 2091
#define SCI_GETSTYLEBITSNEEDED 4011
#define INDIC0_MASK 0x20
#define INDIC1_MASK 0x40
#define INDIC2_MASK 0x80
#define INDICS_MASK 0xE0
#endif
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -155,7 +155,7 @@ static void ColouriseMatlabOctaveDoc(
} else if (sc.state == SCE_MATLAB_KEYWORD) {
if (!isalnum(sc.ch) && sc.ch != '_') {
char s[100];
sc.GetCurrentLowered(s, sizeof(s));
sc.GetCurrent(s, sizeof(s));
if (keywords.InList(s)) {
if (strcmp ("end", s) == 0 && allow_end_op) {
......
......@@ -339,8 +339,8 @@ public :
}
Sci_Position SCI_METHOD WordListSet(int n, const char *wl) override;
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override;
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position lengthDoc, int initStyle, IDocument *pAccess) override;
void SCI_METHOD Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
void SCI_METHOD Fold(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) override;
void * SCI_METHOD PrivateCall(int, void *) override {
return 0;
......@@ -442,9 +442,8 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i
LexAccessor styler(pAccess);
StyleContext sc(startPos, length, initStyle, styler);
int styleBeforeDCKeyword = SCE_SQL_DEFAULT;
Sci_Position offset = 0;
for (; sc.More(); sc.Forward(), offset++) {
for (; sc.More(); sc.Forward()) {
// Determine if the current state should terminate.
switch (sc.state) {
case SCE_SQL_OPERATOR:
......@@ -537,7 +536,7 @@ void SCI_METHOD LexerSQL::Lex(Sci_PositionU startPos, Sci_Position length, int i
if (options.sqlBackslashEscapes && sc.ch == '\\') {
sc.Forward();
} else if (sc.ch == '\'') {
if (sc.chNext == '\"') {
if (sc.chNext == '\'') {
sc.Forward();
} else {
sc.ForwardSetState(SCE_SQL_DEFAULT);
......
......@@ -65,6 +65,9 @@ public:
#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#if !defined(__clang__) && (__GNUC__ >= 8)
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#endif
#endif /* SCINTILLAEDIT_H */
......@@ -12,7 +12,7 @@ TEMPLATE = lib
CONFIG += lib_bundle
CONFIG += c++1z
VERSION = 4.1.7
VERSION = 4.2.0
SOURCES += \
ScintillaEdit.cpp \
......
......@@ -39,6 +39,8 @@ def normalisedName(s, options, role=None):
typeAliases = {
"position": "int",
"line": "int",
"pointer": "int",
"colour": "int",
"keymod": "int",
"string": "const char *",
......@@ -49,21 +51,26 @@ typeAliases = {
def cppAlias(s):
if s in typeAliases:
return typeAliases[s]
elif Face.IsEnumeration(s):
return "int"
else:
return s
understoodTypes = ["", "void", "int", "bool", "position",
understoodTypes = ["", "void", "int", "bool", "position", "line", "pointer",
"colour", "keymod", "string", "stringresult", "cells"]
def understoodType(t):
return t in understoodTypes or Face.IsEnumeration(t)
def checkTypes(name, v):
understandAllTypes = True
if v["ReturnType"] not in understoodTypes:
if not understoodType(v["ReturnType"]):
#~ print("Do not understand", v["ReturnType"], "for", name)
understandAllTypes = False
if v["Param1Type"] not in understoodTypes:
if not understoodType(v["Param1Type"]):
#~ print("Do not understand", v["Param1Type"], "for", name)
understandAllTypes = False
if v["Param2Type"] not in understoodTypes:
if not understoodType(v["Param2Type"]):
#~ print("Do not understand", v["Param2Type"], "for", name)