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: ...@@ -80,7 +80,7 @@ public:
void PenColour(ColourDesired fore) override; void PenColour(ColourDesired fore) override;
/** Returns a CGImageRef that represents the surface. Returns NULL if this is not possible. */ /** 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); void CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect);
int LogPixelsY() override; int LogPixelsY() override;
......
...@@ -483,8 +483,8 @@ void SurfaceImpl::FillColour(const ColourDesired &back) { ...@@ -483,8 +483,8 @@ void SurfaceImpl::FillColour(const ColourDesired &back) {
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
CGImageRef SurfaceImpl::GetImage() { CGImageRef SurfaceImpl::CreateImage() {
// For now, assume that GetImage can only be called on PixMap surfaces. // For now, assume that CreateImage can only be called on PixMap surfaces.
if (!bitmapData) if (!bitmapData)
return NULL; return NULL;
...@@ -655,7 +655,7 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) { ...@@ -655,7 +655,7 @@ void SurfaceImpl::FillRectangle(PRectangle rc, Surface &surfacePattern) {
SurfaceImpl &patternSurface = static_cast<SurfaceImpl &>(surfacePattern); SurfaceImpl &patternSurface = static_cast<SurfaceImpl &>(surfacePattern);
// For now, assume that copy can only be called on PixMap surfaces. Shows up black. // 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) { if (image == NULL) {
FillRectangle(rc, ColourDesired(0)); FillRectangle(rc, ColourDesired(0));
return; return;
...@@ -970,7 +970,7 @@ void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back) ...@@ -970,7 +970,7 @@ void SurfaceImpl::Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)
void SurfaceImpl::CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect) { void SurfaceImpl::CopyImageRectangle(Surface &surfaceSource, PRectangle srcRect, PRectangle dstRect) {
SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource); SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource);
CGImageRef image = source.GetImage(); CGImageRef image = source.CreateImage();
CGRect src = PRectangleToCGRect(srcRect); CGRect src = PRectangleToCGRect(srcRect);
CGRect dst = PRectangleToCGRect(dstRect); CGRect dst = PRectangleToCGRect(dstRect);
...@@ -1002,7 +1002,7 @@ void SurfaceImpl::Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSou ...@@ -1002,7 +1002,7 @@ void SurfaceImpl::Copy(PRectangle rc, Scintilla::Point from, Surface &surfaceSou
SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource); SurfaceImpl &source = static_cast<SurfaceImpl &>(surfaceSource);
// Get the CGImageRef // Get the CGImageRef
CGImageRef image = source.GetImage(); CGImageRef image = source.CreateImage();
// If we could not get an image reference, fill the rectangle black // If we could not get an image reference, fill the rectangle black
if (image == NULL) { if (image == NULL) {
FillRectangle(rc, ColourDesired(0)); FillRectangle(rc, ColourDesired(0));
...@@ -1471,7 +1471,7 @@ static NSImage *ImageFromXPM(XPM *pxpm) { ...@@ -1471,7 +1471,7 @@ static NSImage *ImageFromXPM(XPM *pxpm) {
SurfaceImpl *surfaceIXPM = static_cast<SurfaceImpl *>(surfaceXPM.get()); SurfaceImpl *surfaceIXPM = static_cast<SurfaceImpl *>(surfaceXPM.get());
CGContextClearRect(surfaceIXPM->GetContext(), CGRectMake(0, 0, width, height)); CGContextClearRect(surfaceIXPM->GetContext(), CGRectMake(0, 0, width, height));
pxpm->Draw(surfaceXPM.get(), rcxpm); pxpm->Draw(surfaceXPM.get(), rcxpm);
CGImageRef imageRef = surfaceIXPM->GetImage(); CGImageRef imageRef = surfaceIXPM->CreateImage();
img = [[NSImage alloc] initWithCGImage: imageRef size: NSZeroSize]; img = [[NSImage alloc] initWithCGImage: imageRef size: NSZeroSize];
CGImageRelease(imageRef); CGImageRelease(imageRef);
} }
......
...@@ -197,7 +197,7 @@ public: ...@@ -197,7 +197,7 @@ public:
void ObserverRemove(); void ObserverRemove();
void IdleWork() override; void IdleWork() override;
void QueueIdleWork(WorkNeeded::workItems items, Sci::Position upTo) 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 PositionsFromCharacters(NSRange rangeCharacters) const;
NSRange CharactersFromPositions(NSRange rangePositions) const; NSRange CharactersFromPositions(NSRange rangePositions) const;
NSString *RangeTextAsString(NSRange rangePositions) const; NSString *RangeTextAsString(NSRange rangePositions) const;
......
...@@ -1409,7 +1409,7 @@ void ScintillaCocoa::StartDrag() { ...@@ -1409,7 +1409,7 @@ void ScintillaCocoa::StartDrag() {
// the full rectangle which may include non-selected text. // the full rectangle which may include non-selected text.
NSBitmapImageRep *bitmap = NULL; NSBitmapImageRep *bitmap = NULL;
CGImageRef imagePixmap = pixmap.GetImage(); CGImageRef imagePixmap = pixmap.CreateImage();
if (imagePixmap) if (imagePixmap)
bitmap = [[NSBitmapImageRep alloc] initWithCGImage: imagePixmap]; bitmap = [[NSBitmapImageRep alloc] initWithCGImage: imagePixmap];
CGImageRelease(imagePixmap); CGImageRelease(imagePixmap);
...@@ -2175,26 +2175,39 @@ bool ScintillaCocoa::KeyboardInput(NSEvent *event) { ...@@ -2175,26 +2175,39 @@ bool ScintillaCocoa::KeyboardInput(NSEvent *event) {
/** /**
* Used to insert already processed text provided by the Cocoa text input system. * Used to insert already processed text provided by the Cocoa text input system.
*/ */
ptrdiff_t ScintillaCocoa::InsertText(NSString *input) { ptrdiff_t ScintillaCocoa::InsertText(NSString *input, CharacterSource charSource) {
CFStringEncoding encoding = EncodingFromCharacterSet(IsUnicodeMode(), if ([input length] == 0) {
vs.styles[STYLE_DEFAULT].characterSet); return 0;
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 // 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; std::string_view sv = encoded;
while (sv.length()) { while (sv.length()) {
const unsigned char leadByte = sv[0]; const unsigned char leadByte = sv[0];
const unsigned int bytesInCharacter = UTF8BytesOfLead[leadByte]; const unsigned int bytesInCharacter = UTF8BytesOfLead[leadByte];
AddCharUTF(sv.data(), bytesInCharacter, false); InsertCharacter(sv.substr(0, bytesInCharacter), charSource);
sv.remove_prefix(bytesInCharacter); sv.remove_prefix(bytesInCharacter);
} }
return encoded.length();
} else { } else {
AddCharUTF(encoded.c_str(), static_cast<unsigned int>(encoded.length()), false); 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() { ...@@ -2274,7 +2287,7 @@ void ScintillaCocoa::CompositionStart() {
*/ */
void ScintillaCocoa::CompositionCommit() { void ScintillaCocoa::CompositionCommit() {
pdoc->TentativeCommit(); pdoc->TentativeCommit();
pdoc->DecorationSetCurrentIndicator(INDIC_IME); pdoc->DecorationSetCurrentIndicator(INDICATOR_IME);
pdoc->DecorationFillRange(0, 0, pdoc->Length()); pdoc->DecorationFillRange(0, 0, pdoc->Length());
} }
......
...@@ -17,11 +17,11 @@ ...@@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>FMWK</string> <string>FMWK</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>4.1.7</string> <string>4.2.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4.1.7</string> <string>4.2.0</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string></string> <string></string>
</dict> </dict>
......
...@@ -233,6 +233,7 @@ ...@@ -233,6 +233,7 @@
F437405F9F32C7DEFCA38C11 /* LexIndent.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */; }; F437405F9F32C7DEFCA38C11 /* LexIndent.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 282E41F3B9E2BFEDD6A05BE7 /* LexIndent.cxx */; };
FDC7442CAD70B9A67EF1639D /* LexSAS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = A95147A1AB7CADB00DAFE724 /* LexSAS.cxx */; }; FDC7442CAD70B9A67EF1639D /* LexSAS.cxx in Sources */ = {isa = PBXBuildFile; fileRef = A95147A1AB7CADB00DAFE724 /* LexSAS.cxx */; };
AE894E1CB7328CAE5B2EF47E /* LexX12.cxx in Sources */ = {isa = PBXBuildFile; fileRef = ADA64364A443F3E3F02D294E /* LexX12.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 */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
...@@ -469,6 +470,7 @@ ...@@ -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; }; 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>"; }; 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; }; 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 */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -594,6 +596,7 @@ ...@@ -594,6 +596,7 @@
114B6ED111FA7526004FB6AB /* LexCsound.cxx */, 114B6ED111FA7526004FB6AB /* LexCsound.cxx */,
114B6ED211FA7526004FB6AB /* LexCSS.cxx */, 114B6ED211FA7526004FB6AB /* LexCSS.cxx */,
114B6ED311FA7526004FB6AB /* LexD.cxx */, 114B6ED311FA7526004FB6AB /* LexD.cxx */,
362E48F5A7F79598CB0B037D /* LexDataflex.cxx */,
28B647071B54C0720009DC49 /* LexDiff.cxx */, 28B647071B54C0720009DC49 /* LexDiff.cxx */,
11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */, 11FF3FE11810EB3900E13F13 /* LexDMAP.cxx */,
28064A04190F12E100E6E47F /* LexDMIS.cxx */, 28064A04190F12E100E6E47F /* LexDMIS.cxx */,
...@@ -1134,6 +1137,7 @@ ...@@ -1134,6 +1137,7 @@
0ED84236A703D57578EBFD2F /* LexNim.cxx in Sources */, 0ED84236A703D57578EBFD2F /* LexNim.cxx in Sources */,
00724A59981D34F11A3D162F /* LexCIL.cxx in Sources */, 00724A59981D34F11A3D162F /* LexCIL.cxx in Sources */,
AE894E1CB7328CAE5B2EF47E /* LexX12.cxx in Sources */, AE894E1CB7328CAE5B2EF47E /* LexX12.cxx in Sources */,
902B40FE926FE48538B168F1 /* LexDataflex.cxx in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
...@@ -415,7 +415,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { ...@@ -415,7 +415,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
} }
[mOwner message: SCI_SETTARGETRANGE wParam: posRange.location lParam: NSMaxRange(posRange)]; [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])]; [mOwner message: SCI_TARGETASUTF8 wParam: 0 lParam: reinterpret_cast<sptr_t>(&text[0])];
text = FixInvalidUTF8(text); text = FixInvalidUTF8(text);
NSString *result = @(text.c_str()); NSString *result = @(text.c_str());
...@@ -425,12 +425,14 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { ...@@ -425,12 +425,14 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
// SCI_GETSTYLEAT reports a signed byte but want an unsigned to index into styles // 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 char styleByte = static_cast<char>([mOwner message: SCI_GETSTYLEAT wParam: posRange.location]);
const long style = static_cast<unsigned char>(styleByte); 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]]; [mOwner message: SCI_STYLEGETFONT wParam: style lParam: (sptr_t)&fontName[0]];
const CGFloat fontSize = [mOwner message: SCI_STYLEGETSIZEFRACTIONAL wParam: style] / 100.0f; const CGFloat fontSize = [mOwner message: SCI_STYLEGETSIZEFRACTIONAL wParam: style] / 100.0f;
NSString *sFontName = @(fontName.c_str()); NSString *sFontName = @(fontName.c_str());
NSFont *font = [NSFont fontWithName: sFontName size: fontSize]; NSFont *font = [NSFont fontWithName: sFontName size: fontSize];
if (font) {
[asResult addAttribute: NSFontAttributeName value: font range: rangeAS]; [asResult addAttribute: NSFontAttributeName value: font range: rangeAS];
}
return asResult; return asResult;
} }
...@@ -527,7 +529,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { ...@@ -527,7 +529,7 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
else if ([aString isKindOfClass: [NSAttributedString class]]) else if ([aString isKindOfClass: [NSAttributedString class]])
newText = (NSString *) [aString string]; 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) { ...@@ -620,11 +622,11 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
NSRange posRangeCurrent = mOwner.backend->PositionsFromCharacters(NSMakeRange(replacementRange.location, 0)); NSRange posRangeCurrent = mOwner.backend->PositionsFromCharacters(NSMakeRange(replacementRange.location, 0));
// Note: Scintilla internally works almost always with bytes instead chars, so we need to take // Note: Scintilla internally works almost always with bytes instead chars, so we need to take
// this into account when determining selection ranges and such. // 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; posRangeCurrent.length = lengthInserted;
mMarkedTextRange = mOwner.backend->CharactersFromPositions(posRangeCurrent); mMarkedTextRange = mOwner.backend->CharactersFromPositions(posRangeCurrent);
// Mark the just inserted text. Keep the marked range for later reset. // 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 [mOwner setGeneralProperty: SCI_INDICATORFILLRANGE
parameter: posRangeCurrent.location parameter: posRangeCurrent.location
value: posRangeCurrent.length]; value: posRangeCurrent.length];
...@@ -1374,11 +1376,11 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { ...@@ -1374,11 +1376,11 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
* input composition, depending on language, keyboard etc. * input composition, depending on language, keyboard etc.
*/ */
- (void) updateIndicatorIME { - (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; const bool drawInBackground = [self message: SCI_GETPHASESDRAW] != 0;
[self setGeneralProperty: SCI_INDICSETUNDER parameter: INDIC_IME value: drawInBackground]; [self setGeneralProperty: SCI_INDICSETUNDER parameter: INDICATOR_IME value: drawInBackground];
[self setGeneralProperty: SCI_INDICSETSTYLE parameter: INDIC_IME value: INDIC_PLAIN]; [self setGeneralProperty: SCI_INDICSETSTYLE parameter: INDICATOR_IME value: INDIC_PLAIN];
[self setGeneralProperty: SCI_INDICSETALPHA parameter: INDIC_IME value: 100]; [self setGeneralProperty: SCI_INDICSETALPHA parameter: INDICATOR_IME value: 100];
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
...@@ -1963,9 +1965,9 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) { ...@@ -1963,9 +1965,9 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) {
- (void) insertText: (id) aString { - (void) insertText: (id) aString {
if ([aString isKindOfClass: [NSString class]]) if ([aString isKindOfClass: [NSString class]])
mBackend->InsertText(aString); mBackend->InsertText(aString, EditModel::CharacterSource::directInput);
else if ([aString isKindOfClass: [NSAttributedString class]]) 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 ...@@ -38,6 +38,7 @@ variableScope:scintilla/lexers/LexBash.cxx
variableScope:scintilla/lexers/LexBatch.cxx variableScope:scintilla/lexers/LexBatch.cxx
variableScope:scintilla/lexers/LexCmake.cxx variableScope:scintilla/lexers/LexCmake.cxx
variableScope:scintilla/lexers/LexCSS.cxx variableScope:scintilla/lexers/LexCSS.cxx
variableScope:scintilla/lexers/LexDataflex.cxx
variableScope:scintilla/lexers/LexErlang.cxx variableScope:scintilla/lexers/LexErlang.cxx
variableScope:scintilla/lexers/LexGui4Cli.cxx variableScope:scintilla/lexers/LexGui4Cli.cxx
variableScope:scintilla/lexers/LexInno.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 @@ ...@@ -26,9 +26,9 @@
<table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0"> <table bgcolor="#CCCCCC" width="100%" cellspacing="0" cellpadding="8" border="0">
<tr> <tr>
<td> <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; 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; GTK/Linux</a>&nbsp;&nbsp;
</font> </font>
</td> </td>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
containing very few restrictions. containing very few restrictions.
</p> </p>
<h3> <h3>
Release 4.1.7 Release 4.2.0
</h3> </h3>
<h4> <h4>
Source Code Source Code
...@@ -50,8 +50,8 @@ ...@@ -50,8 +50,8 @@
The source code package contains all of the source code for Scintilla but no binary The source code package contains all of the source code for Scintilla but no binary
executable code and is available in executable code and is available in
<ul> <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/scintilla420.zip">zip format</a> (1.7M) 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.tgz">tgz format</a> (1.4M) commonly used on Linux and compatible operating systems</li>
</ul> </ul>
Instructions for building on both Windows and Linux are included in the readme file. Instructions for building on both Windows and Linux are included in the readme file.
<h4> <h4>
......
...@@ -542,6 +542,9 @@ ...@@ -542,6 +542,9 @@
<td>Jad Altahan</td> <td>Jad Altahan</td>
<td>Andrea Ricchi</td> <td>Andrea Ricchi</td>
<td>Juarez Rudsatz</td> <td>Juarez Rudsatz</td>
<td>Wil van Antwerpen</td>
</tr><tr>
<td>Hodong Kim</td>
</tr> </tr>
</table> </table>
<p> <p>
...@@ -553,6 +556,60 @@ ...@@ -553,6 +556,60 @@
Icons</a> Copyright(C) 1998 by Dean S. Jones<br /> Icons</a> Copyright(C) 1998 by Dean S. Jones<br />
</li> </li>
</ul> </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> <h3>
<a href="https://www.scintilla.org/scite417.zip">Release 4.1.7</a> <a href="https://www.scintilla.org/scite417.zip">Release 4.1.7</a>
</h3> </h3>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" /> <meta name="keywords" content="Scintilla, SciTE, Editing Component, Text Editor" />
<meta name="Description" <meta name="Description"
content="www.scintilla.org is the home of the Scintilla editing component and SciTE text editor application." /> 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" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css"> <style type="text/css">
#versionlist { #versionlist {
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
GTK, and OS X</font> GTK, and OS X</font>
</td> </td>
<td width="40%" align="right"> <td width="40%" align="right">
<font color="#FFCC99" size="3"> Release version 4.1.7<br /> <font color="#FFCC99" size="3"> Release version 4.2.0<br />
Site last modified June 13 2019</font> Site last modified July 5 2019</font>
</td> </td>
<td width="20%"> <td width="20%">
&nbsp; &nbsp;
...@@ -72,14 +72,12 @@ ...@@ -72,14 +72,12 @@
</tr> </tr>
</table> </table>
<ul id="versionlist"> <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.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.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 <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> 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.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>
<ul id="menu"> <ul id="menu">
<li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li> <li id="remote1"><a href="https://www.scintilla.org/SciTEImage.html">Screenshot</a></li>
......
...@@ -91,10 +91,10 @@ ...@@ -91,10 +91,10 @@
#define IS_WIDGET_REALIZED(w) (gtk_widget_get_realized(GTK_WIDGET(w))) #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 IS_WIDGET_MAPPED(w) (gtk_widget_get_mapped(GTK_WIDGET(w)))
#define SC_INDICATOR_INPUT INDIC_IME #define SC_INDICATOR_INPUT INDICATOR_IME
#define SC_INDICATOR_TARGET INDIC_IME+1 #define SC_INDICATOR_TARGET INDICATOR_IME+1
#define SC_INDICATOR_CONVERTED INDIC_IME+2 #define SC_INDICATOR_CONVERTED INDICATOR_IME+2
#define SC_INDICATOR_UNKNOWN INDIC_IME_MAX #define SC_INDICATOR_UNKNOWN INDICATOR_IME_MAX
static GdkWindow *WindowFromWidget(GtkWidget *w) noexcept { static GdkWindow *WindowFromWidget(GtkWidget *w) noexcept {
return gtk_widget_get_window(w); return gtk_widget_get_window(w);
...@@ -2259,9 +2259,9 @@ void ScintillaGTK::MoveImeCarets(int pos) { ...@@ -2259,9 +2259,9 @@ void ScintillaGTK::MoveImeCarets(int pos) {
void ScintillaGTK::DrawImeIndicator(int indicator, int len) { void ScintillaGTK::DrawImeIndicator(int indicator, int len) {
// Emulate the visual style of IME characters with indicators. // Emulate the visual style of IME characters with indicators.
// Draw an indicator on the character before caret by the character bytes of len // 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. // It does not affect caret positions.
if (indicator < 8 || indicator > INDIC_MAX) { if (indicator < 8 || indicator > INDICATOR_MAX) {
return; return;
} }
pdoc->DecorationSetCurrentIndicator(indicator); pdoc->DecorationSetCurrentIndicator(indicator);
...@@ -2351,7 +2351,7 @@ void ScintillaGTK::CommitThis(char *commitStr) { ...@@ -2351,7 +2351,7 @@ void ScintillaGTK::CommitThis(char *commitStr) {
if (!IsUnicodeMode()) if (!IsUnicodeMode())
docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true); docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true);
AddCharUTF(docChar.c_str(), docChar.size()); InsertCharacter(docChar, CharacterSource::directInput);
} }
g_free(uniStr); g_free(uniStr);
ShowCaretAtCurrentPosition(); ShowCaretAtCurrentPosition();
...@@ -2403,8 +2403,6 @@ void ScintillaGTK::PreeditChangedInlineThis() { ...@@ -2403,8 +2403,6 @@ void ScintillaGTK::PreeditChangedInlineThis() {
std::vector<int> indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str); std::vector<int> indicator = MapImeIndicators(preeditStr.attrs, preeditStr.str);
const bool tmpRecordingMacro = recordingMacro;
recordingMacro = false;
for (glong i = 0; i < preeditStr.uniStrLen; i++) { for (glong i = 0; i < preeditStr.uniStrLen; i++) {
gchar u8Char[UTF8MaxBytes+2] = {0}; gchar u8Char[UTF8MaxBytes+2] = {0};
const gint u8CharLen = g_unichar_to_utf8(preeditStr.uniStr[i], u8Char); const gint u8CharLen = g_unichar_to_utf8(preeditStr.uniStr[i], u8Char);
...@@ -2412,11 +2410,10 @@ void ScintillaGTK::PreeditChangedInlineThis() { ...@@ -2412,11 +2410,10 @@ void ScintillaGTK::PreeditChangedInlineThis() {
if (!IsUnicodeMode()) if (!IsUnicodeMode())
docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true); docChar = ConvertText(u8Char, u8CharLen, charSetSource, "UTF-8", true);
AddCharUTF(docChar.c_str(), docChar.size()); InsertCharacter(docChar, CharacterSource::tentativeInput);
DrawImeIndicator(indicator[i], docChar.size()); DrawImeIndicator(indicator[i], docChar.size());
} }
recordingMacro = tmpRecordingMacro;
// Move caret to ime cursor position. // Move caret to ime cursor position.
const int imeEndToImeCaretU32 = preeditStr.cursor_pos - preeditStr.uniStrLen; const int imeEndToImeCaretU32 = preeditStr.cursor_pos - preeditStr.uniStrLen;
......
...@@ -914,6 +914,18 @@ LexD.o: \ ...@@ -914,6 +914,18 @@ LexD.o: \
../lexlib/LexerModule.h \ ../lexlib/LexerModule.h \
../lexlib/OptionSet.h \ ../lexlib/OptionSet.h \
../lexlib/DefaultLexer.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: \ LexDiff.o: \
../lexers/LexDiff.cxx \ ../lexers/LexDiff.cxx \
../include/ILexer.h \ ../include/ILexer.h \
......
...@@ -57,10 +57,7 @@ vpath %.c $(srcdir) ...@@ -57,10 +57,7 @@ vpath %.c $(srcdir)
vpath %.cxx $(srcdir) $(srcdir)/../src $(srcdir)/../lexlib $(srcdir)/../lexers vpath %.cxx $(srcdir) $(srcdir)/../src $(srcdir)/../lexlib $(srcdir)/../lexers
INCLUDEDIRS=-I $(srcdir)/../include -I $(srcdir)/../src -I $(srcdir)/../lexlib INCLUDEDIRS=-I $(srcdir)/../include -I $(srcdir)/../src -I $(srcdir)/../lexlib
ifdef CHECK_DEPRECATED CXXBASEFLAGS=$(CXXWARNFLAGS) $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS)
DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
endif
CXXBASEFLAGS=$(CXXWARNFLAGS) $(PICFLAGS) -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
ifdef NOTHREADS ifdef NOTHREADS
THREADFLAGS=-DG_THREADS_IMPL_NONE THREADFLAGS=-DG_THREADS_IMPL_NONE
......
...@@ -141,6 +141,7 @@ ...@@ -141,6 +141,7 @@
#define SCLEX_NIM 126 #define SCLEX_NIM 126
#define SCLEX_CIL 127 #define SCLEX_CIL 127
#define SCLEX_X12 128 #define SCLEX_X12 128
#define SCLEX_DATAFLEX 129
#define SCLEX_AUTOMATIC 1000 #define SCLEX_AUTOMATIC 1000
#define SCE_P_DEFAULT 0 #define SCE_P_DEFAULT 0
#define SCE_P_COMMENTLINE 1 #define SCE_P_COMMENTLINE 1
...@@ -1895,6 +1896,21 @@ ...@@ -1895,6 +1896,21 @@
#define SCE_X12_SEGMENTEND 6 #define SCE_X12_SEGMENTEND 6
#define SCE_X12_SEP_ELEMENT 7 #define SCE_X12_SEP_ELEMENT 7
#define SCE_X12_SEP_SUBELEMENT 8 #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