diff options
| -rw-r--r-- | cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/xcshareddata/xcschemes/Scintilla.xcscheme | 6 | ||||
| -rw-r--r-- | cppcheck.suppress | 1 | ||||
| -rw-r--r-- | doc/SciCoding.html | 4 | ||||
| -rw-r--r-- | doc/ScintillaDoc.html | 8 | ||||
| -rw-r--r-- | doc/ScintillaHistory.html | 2 | ||||
| -rw-r--r-- | gtk/DepGen.py | 4 | ||||
| -rwxr-xr-x | gtk/PlatGTK.cxx | 2 | ||||
| -rw-r--r-- | include/Platform.h | 10 | ||||
| -rw-r--r-- | lexers/LexHollywood.cxx | 28 | ||||
| -rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 4 | ||||
| -rw-r--r-- | scripts/Dependencies.py | 5 | ||||
| -rw-r--r-- | scripts/LexGen.py | 10 | ||||
| -rw-r--r-- | src/EditModel.cxx | 1 | ||||
| -rw-r--r-- | src/EditView.cxx | 3 | ||||
| -rw-r--r-- | src/ScintillaBase.cxx | 10 | ||||
| -rw-r--r-- | src/Style.h | 1 | ||||
| -rw-r--r-- | test/unit/UnitTester.vcxproj | 2 | ||||
| -rw-r--r-- | test/unit/makefile | 4 | ||||
| -rw-r--r-- | win32/DepGen.py | 4 | ||||
| -rw-r--r-- | win32/makefile | 3 | ||||
| -rw-r--r-- | win32/scintilla.mak | 3 |
21 files changed, 64 insertions, 51 deletions
diff --git a/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/xcshareddata/xcschemes/Scintilla.xcscheme b/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/xcshareddata/xcschemes/Scintilla.xcscheme index 3e029056e..4679fafe5 100644 --- a/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/xcshareddata/xcschemes/Scintilla.xcscheme +++ b/cocoa/ScintillaFramework/ScintillaFramework.xcodeproj/xcshareddata/xcschemes/Scintilla.xcscheme @@ -29,18 +29,16 @@ shouldUseLaunchSchemeArgsEnv = "YES"> <Testables> </Testables> - <AdditionalOptions> - </AdditionalOptions> </TestAction> <LaunchAction buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + enableAddressSanitizer = "YES" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" - enableAddressSanitizer = "YES" debugServiceExtension = "internal" allowLocationSimulation = "YES"> <MacroExpansion> @@ -52,8 +50,6 @@ ReferencedContainer = "container:ScintillaFramework.xcodeproj"> </BuildableReference> </MacroExpansion> - <AdditionalOptions> - </AdditionalOptions> </LaunchAction> <ProfileAction buildConfiguration = "Release" diff --git a/cppcheck.suppress b/cppcheck.suppress index d0bb6d38d..8523b30f2 100644 --- a/cppcheck.suppress +++ b/cppcheck.suppress @@ -71,7 +71,6 @@ constParameter:scintilla/lexers/LexFortran.cxx variableScope:scintilla/lexers/LexGui4Cli.cxx
constParameter:scintilla/lexers/LexHaskell.cxx
constParameter:scintilla/lexers/LexHex.cxx
-missingOverride:scintilla/lexers/LexHollywood.cxx
constParameter:scintilla/lexers/LexHTML.cxx
variableScope:scintilla/lexers/LexInno.cxx
constParameter:scintilla/lexers/LexJSON.cxx
diff --git a/doc/SciCoding.html b/doc/SciCoding.html index c5debf51a..b3724abec 100644 --- a/doc/SciCoding.html +++ b/doc/SciCoding.html @@ -124,8 +124,8 @@ compilers on diverse platforms with high performance and low resource usage. Scintilla has stricter portability requirements to SciTE as it may be ported to low capability platforms. - Scintilla code must build with C++03 which can be checked with "g++ --std=gnu++03". - SciTE can use C++11 features that are widely available from g++ 4.6, MSVC 2012 and clang 3.4 compilers. + Scintilla code must build with C++11 which can be checked with "g++ --std=c++11". + SciTE can use C++11 features that are widely available from g++ 4.8, MSVC 2015 and clang 3.4 compilers. </p> <p> To achieve portability, only a subset of C++ features are used. diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index ef9e3e81b..46262e0a5 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -1808,7 +1808,7 @@ struct Sci_TextToFind { <b id="SCI_GETSELECTIONNEND">SCI_GETSELECTIONNEND(int selection) → position</b><br /> <b id="SCI_GETSELECTIONNENDVIRTUALSPACE">SCI_GETSELECTIONNENDVIRTUALSPACE(int selection) → position</b><br /> Set or query the start and end position of each already existing selection. - Query the virtual space at start and end of each selection. + Query the virtual space at start and end of each selection. Mostly of use to query each range for its text. The selection parameter is zero-based. </p> <p> @@ -7122,9 +7122,7 @@ SCI_METHOD<span class="S0"> </span>PropertyNames<span class="S10">()</span> <p> The types <code>Sci_Position</code> and <code>Sci_PositionU</code> are used for positions and line numbers in the document. -Before release 3.6.0 the types <code>int</code> and <code>unsigned int</code> were used instead and, for 3.6.0, -<code>Sci_Position</code> is defined as <code>int</code> and <code>Sci_PositionU</code> is defined as <code>unsigned int</code>. -In a future release, 64-bit builds will define these as 64-bit types to allow documents larger than 2 GB. +With release 3.8.0, 64-bit builds define these as 64-bit types to allow future implementation of documents larger than 2 GB. </p> <p> @@ -8460,8 +8458,6 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next <p>Provisional features are displayed in this document with <span class="provisional">a distinctive background colour</span>.</p> - <p>There are currently no provisional messages or values.</p> - <p>Some developers may want to only use features that are stable and have graduated from provisional status. To avoid using provisional messages compile with the symbol <code>SCI_DISABLE_PROVISIONAL</code> defined.</p> diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 9da57e3cb..bb680872c 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -942,7 +942,7 @@ Added "nim" lexer (SCLEX_NIM) for the Nim language which was previously called Nimrod. For compatibility, the old "nimrod" lexer is still present but is deprecated and will be removed at the next major version. - <a href="https://sourceforge.net/p/scintilla/feature-requests/1242/">Feature #1242.</a> + <a href="https://sourceforge.net/p/scintilla/feature-requests/1242/">Feature #1242</a>. </li> <li> The Bash lexer implements substyles for multiple sets of keywords and supports SCI_PROPERTYNAMES. diff --git a/gtk/DepGen.py b/gtk/DepGen.py index 20f4a0148..4feea8a9c 100644 --- a/gtk/DepGen.py +++ b/gtk/DepGen.py @@ -6,9 +6,9 @@ import sys -sys.path.append("../") +sys.path.append("..") -import scripts.Dependencies as Dependencies +from scripts import Dependencies topComment = "# Created by DepGen.py. To recreate, run 'python DepGen.py'.\n" diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 94f6c449f..66a2daac2 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -645,7 +645,7 @@ std::string UTF8FromLatin1(const char *s, int len) { std::string utfForm(len*2 + 1, '\0'); size_t lenU = 0; for (int i=0; i<len; i++) { - unsigned int uch = static_cast<unsigned char>(s[i]); + const unsigned char uch = static_cast<unsigned char>(s[i]); if (uch < 0x80) { utfForm[lenU++] = uch; } else { diff --git a/include/Platform.h b/include/Platform.h index 8f5417fe0..bb453e20b 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -371,11 +371,11 @@ public: virtual void Ellipse(PRectangle rc, ColourDesired fore, ColourDesired back)=0; virtual void Copy(PRectangle rc, Point from, Surface &surfaceSource)=0; - virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0; - virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back)=0; - virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore)=0; - virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions)=0; - virtual XYPOSITION WidthText(Font &font_, const char *s, int len)=0; + virtual void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) = 0; + virtual void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore, ColourDesired back) = 0; + virtual void DrawTextTransparent(PRectangle rc, Font &font_, XYPOSITION ybase, const char *s, int len, ColourDesired fore) = 0; + virtual void MeasureWidths(Font &font_, const char *s, int len, XYPOSITION *positions) = 0; + virtual XYPOSITION WidthText(Font &font_, const char *s, int len) = 0; virtual XYPOSITION Ascent(Font &font_)=0; virtual XYPOSITION Descent(Font &font_)=0; virtual XYPOSITION InternalLeading(Font &font_)=0; diff --git a/lexers/LexHollywood.cxx b/lexers/LexHollywood.cxx index 90be36043..8d306c9fa 100644 --- a/lexers/LexHollywood.cxx +++ b/lexers/LexHollywood.cxx @@ -6,7 +6,7 @@ ** For more information on Hollywood, see http://www.hollywood-mal.com/ ** Mail me (andreas <at> airsoftsoftwair <dot> de) for any bugs. ** This code is subject to the same license terms as the rest of the Scintilla project: - ** The License.txt file describes the conditions under which this software may be distributed. + ** The License.txt file describes the conditions under which this software may be distributed. **/ #include <stdlib.h> @@ -96,7 +96,7 @@ static int character_classification[128] = // we handle the decimal digit case manually below so that 3.1415 and .123 is styled correctly // the collateral damage of treating "." as an identifier is that "." is never styled // SCE_HOLLYWOOD_OPERATOR - 4, // . ($2E) + 4, // . ($2E) 2, // / ($2F) 28, // 0 ($30) 28, // 1 ($31) @@ -247,7 +247,7 @@ struct OptionSetHollywood : public OptionSet<OptionsHollywood> { class LexerHollywood : public DefaultLexer { int (*CheckFoldPoint)(char const *); - WordList keywordlists[4]; + WordList keywordlists[4]; OptionsHollywood options; OptionSetHollywood osHollywood; public: @@ -324,7 +324,7 @@ Sci_Position SCI_METHOD LexerHollywood::WordListSet(int n, const char *wl) { firstModification = 0; } } - return firstModification; + return firstModification; } void SCI_METHOD LexerHollywood::Lex(Sci_PositionU startPos, Sci_Position length, int initStyle, IDocument *pAccess) { @@ -343,7 +343,7 @@ void SCI_METHOD LexerHollywood::Lex(Sci_PositionU startPos, Sci_Position length, if (sc.ch == '\"' && sc.chPrev != '\\') inString = !inString; if (sc.state == SCE_HOLLYWOOD_IDENTIFIER) { - if (!IsIdentifier(sc.ch)) { + if (!IsIdentifier(sc.ch)) { char s[100]; int kstates[4] = { SCE_HOLLYWOOD_KEYWORD, @@ -357,7 +357,7 @@ void SCI_METHOD LexerHollywood::Lex(Sci_PositionU startPos, Sci_Position length, sc.ChangeState(kstates[i]); } } - sc.SetState(SCE_HOLLYWOOD_DEFAULT); + sc.SetState(SCE_HOLLYWOOD_DEFAULT); } } else if (sc.state == SCE_HOLLYWOOD_OPERATOR) { @@ -400,7 +400,7 @@ void SCI_METHOD LexerHollywood::Lex(Sci_PositionU startPos, Sci_Position length, if (sc.Match("]]") && !inString) { sc.Forward(); sc.ForwardSetState(SCE_HOLLYWOOD_DEFAULT); - } + } } if (sc.state == SCE_HOLLYWOOD_DEFAULT) { @@ -411,23 +411,23 @@ void SCI_METHOD LexerHollywood::Lex(Sci_PositionU startPos, Sci_Position length, sc.Forward(); } else if (sc.Match("[[")) { sc.SetState(SCE_HOLLYWOOD_STRINGBLOCK); - sc.Forward(); + sc.Forward(); } else if (sc.Match('"')) { sc.SetState(SCE_HOLLYWOOD_STRING); - } else if (sc.Match('$')) { + } else if (sc.Match('$')) { sc.SetState(SCE_HOLLYWOOD_HEXNUMBER); } else if (sc.Match("0x") || sc.Match("0X")) { // must be before IsDigit() because of 0x sc.SetState(SCE_HOLLYWOOD_HEXNUMBER); sc.Forward(); } else if (sc.ch == '.' && (sc.chNext >= '0' && sc.chNext <= '9')) { // ".1234" style numbers sc.SetState(SCE_HOLLYWOOD_NUMBER); - sc.Forward(); + sc.Forward(); } else if (IsDigit(sc.ch)) { sc.SetState(SCE_HOLLYWOOD_NUMBER); } else if (sc.Match('#')) { sc.SetState(SCE_HOLLYWOOD_CONSTANT); } else if (sc.Match('@')) { - sc.SetState(SCE_HOLLYWOOD_PREPROCESSOR); + sc.SetState(SCE_HOLLYWOOD_PREPROCESSOR); } else if (IsOperator(sc.ch)) { sc.SetState(SCE_HOLLYWOOD_OPERATOR); } else if (IsIdentifier(sc.ch)) { @@ -484,7 +484,7 @@ void SCI_METHOD LexerHollywood::Fold(Sci_PositionU startPos, Sci_Position length done = 1; } } - } + } if (atEOL) { int lev = levelPrev; @@ -501,7 +501,7 @@ void SCI_METHOD LexerHollywood::Fold(Sci_PositionU startPos, Sci_Position length levelPrev = levelCurrent; visibleChars = 0; done = 0; - wordlen = 0; + wordlen = 0; } if (!IsSpace(ch)) { visibleChars++; @@ -510,7 +510,7 @@ void SCI_METHOD LexerHollywood::Fold(Sci_PositionU startPos, Sci_Position length // Fill in the real level of the next line, keeping the current flags as they will be filled in later int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK; - styler.SetLevel(lineCurrent, levelPrev | flagsNext); + styler.SetLevel(lineCurrent, levelPrev | flagsNext); } LexerModule lmHollywood(SCLEX_HOLLYWOOD, LexerHollywood::LexerFactoryHollywood, "hollywood", hollywoodWordListDesc); diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 281fdba3d..78f4e6eca 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -521,8 +521,8 @@ XYPOSITION SurfaceImpl::WidthText(Font &font, const char *s, int len) { QFontMetricsF metrics(*FontPointer(font), device); SetCodec(font); - QString string = codec->toUnicode(s, len); - return metrics.width(string); + QString su = codec->toUnicode(s, len); + return metrics.width(su); } XYPOSITION SurfaceImpl::Ascent(Font &font) diff --git a/scripts/Dependencies.py b/scripts/Dependencies.py index 90b8b9529..db705137c 100644 --- a/scripts/Dependencies.py +++ b/scripts/Dependencies.py @@ -21,7 +21,10 @@ import codecs, glob, os, sys -from . import FileGenerator +if __name__ == "__main__": + import FileGenerator +else: + from . import FileGenerator continuationLineEnd = " \\" diff --git a/scripts/LexGen.py b/scripts/LexGen.py index 8748a744b..0494286b3 100644 --- a/scripts/LexGen.py +++ b/scripts/LexGen.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.insert(0, 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) + 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) diff --git a/src/EditModel.cxx b/src/EditModel.cxx index 99520f3cb..591d2c623 100644 --- a/src/EditModel.cxx +++ b/src/EditModel.cxx @@ -94,4 +94,3 @@ const char *EditModel::GetFoldDisplayText(Sci::Line lineDoc) const { const char *text = pcs->GetFoldDisplayText(lineDoc); return text ? text : defaultFoldDisplayText.get(); } - diff --git a/src/EditView.cxx b/src/EditView.cxx index 6850d0964..c16f25ac6 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -59,7 +59,7 @@ using namespace Scintilla; -static inline bool IsControlCharacter(int ch) { +static constexpr bool IsControlCharacter(int ch) noexcept { // iscntrl returns true for lots of chars > 127 which are displayable return ch >= 0 && ch < ' '; } @@ -1563,6 +1563,7 @@ static void DrawMarkUnderline(Surface *surface, const EditModel &model, const Vi marks >>= 1; } } + static void DrawTranslucentSelection(Surface *surface, const EditModel &model, const ViewStyle &vsDraw, const LineLayout *ll, Sci::Line line, PRectangle rcLine, int subLine, Range lineRange, int xStart) { if ((vsDraw.selAlpha != SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha != SC_ALPHA_NOALPHA)) { diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 0b7adbd67..b538fee2e 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -675,7 +675,15 @@ void LexState::SetWordList(int n, const char *wl) { } const char *LexState::GetName() const { - return lexCurrent ? lexCurrent->languageName : ""; + if (lexCurrent) { + return lexCurrent->languageName; + } + if (instance) { + if (instance->Version() >= lvIdentity) { + return static_cast<ILexerWithIdentity *>(instance)->GetName(); + } + } + return ""; } void *LexState::PrivateCall(int operation, void *pointer) { diff --git a/src/Style.h b/src/Style.h index 1f7f02fe6..956a55b65 100644 --- a/src/Style.h +++ b/src/Style.h @@ -72,6 +72,7 @@ public: Style(); Style(const Style &source); + // Style objects should not be moved but MSVC 2015 requires this. Style(Style &&) = default; ~Style(); Style &operator=(const Style &source); diff --git a/test/unit/UnitTester.vcxproj b/test/unit/UnitTester.vcxproj index c80270618..65a3529fc 100644 --- a/test/unit/UnitTester.vcxproj +++ b/test/unit/UnitTester.vcxproj @@ -163,4 +163,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project>
+</Project>
\ No newline at end of file diff --git a/test/unit/makefile b/test/unit/makefile index 51c4950d5..a9d10f748 100644 --- a/test/unit/makefile +++ b/test/unit/makefile @@ -5,6 +5,8 @@ # clang works only with libc++, not libstdc++ # Tested with clang 3.3 and g++ 4.8 +CXXSTD=c++11 + ifndef windir ifeq ($(shell uname),Darwin) # On OS X always use clang as g++ is old version @@ -13,7 +15,7 @@ USELIBCPP = 1 endif endif -CXXFLAGS += --std=c++11 +CXXFLAGS += --std=$(CXXSTD) ifdef CLANG CXX = clang++ diff --git a/win32/DepGen.py b/win32/DepGen.py index ce40d1a82..c255574b0 100644 --- a/win32/DepGen.py +++ b/win32/DepGen.py @@ -6,9 +6,9 @@ import sys -sys.path.append("../") +sys.path.append("..") -import scripts.Dependencies as Dependencies +from scripts import Dependencies topComment = "# Created by DepGen.py. To recreate, run 'python DepGen.py'.\n" diff --git a/win32/makefile b/win32/makefile index 71be978c7..1b5ce451b 100644 --- a/win32/makefile +++ b/win32/makefile @@ -2,8 +2,7 @@ # @file makefile # Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org> # The License.txt file describes the conditions under which this software may be distributed. -# This makefile assumes the MinGW32 version of GCC 4.8+ is used and changes will -# be needed to use other compilers. +# This makefile assumes Mingw GCC 4.8+ is used and changes will be needed to use other compilers. # Clang 3.4+ can be used with CLANG=1 on command line. .PHONY: all clean analyze depend diff --git a/win32/scintilla.mak b/win32/scintilla.mak index fde975802..d5c3a2a9e 100644 --- a/win32/scintilla.mak +++ b/win32/scintilla.mak @@ -231,7 +231,7 @@ LEXLIB_OBJS = \ $(DIR_O)\LexerModule.obj \ $(DIR_O)\LexerSimple.obj \ $(DIR_O)\StyleContext.obj \ - $(DIR_O)\WordList.obj \ + $(DIR_O)\WordList.obj # Required by libraries and DLLs that include lexing SCILEX_OBJS = \ @@ -291,3 +291,4 @@ $(DIR_O)\ScintillaBaseL.obj: ..\src\ScintillaBase.cxx !INCLUDE nmdeps.mak !ENDIF + |
