From 9b98d55defc918c951660f05e9ebdd30e9bfb184 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sun, 24 May 2015 18:44:02 +0200 Subject: [PATCH] Update Scintilla to 3.5.6 pre-release Fixes broken auto-completion popup on Windows. --- scintilla/gtk/PlatGTK.cxx | 18 +++++++++++++++++- scintilla/gtk/ScintillaGTK.cxx | 2 +- scintilla/lexers/LexCPP.cxx | 6 ++---- scintilla/lexers/LexFortran.cxx | 1 + scintilla/lexers/LexVHDL.cxx | 7 ++++--- scintilla/lexers/LexVerilog.cxx | 4 +++- scintilla/src/Document.cxx | 2 ++ scintilla/src/EditModel.h | 2 +- scintilla/src/Editor.h | 2 +- scintilla/src/ScintillaBase.h | 2 +- scintilla/version.txt | 2 +- 11 files changed, 34 insertions(+), 14 deletions(-) diff --git a/scintilla/gtk/PlatGTK.cxx b/scintilla/gtk/PlatGTK.cxx index 1445ac130..27c68b93b 100644 --- a/scintilla/gtk/PlatGTK.cxx +++ b/scintilla/gtk/PlatGTK.cxx @@ -602,6 +602,7 @@ void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID cairo_set_line_width(context, 1); createdGC = true; inited = true; + et = surfImpl->et; } void SurfaceImpl::PenColour(ColourDesired fore) { @@ -1483,7 +1484,22 @@ ListBox *ListBox::Allocate() { // SmallScroller, a GtkScrolledWindow that can shrink very small, as // gtk_widget_set_size_request() cannot shrink widgets on GTK3 -typedef GtkScrolledWindow SmallScroller; +typedef struct { + GtkScrolledWindow parent; + /* Workaround ABI issue with Windows GTK2 bundle and GCC > 3. + See http://lists.geany.org/pipermail/devel/2015-April/thread.html#9379 + + GtkScrolledWindow contains a bitfield, and GCC 3.4 and 4.8 don't agree + on the size of the structure (regardless of -mms-bitfields): + - GCC 3.4 has sizeof(GtkScrolledWindow)=88 + - GCC 4.8 has sizeof(GtkScrolledWindow)=84 + As Windows GTK2 bundle is built with GCC 3, it requires types derived + from GtkScrolledWindow to be at least 88 bytes, which means we need to + add some fake padding to fill in the extra 4 bytes. + There is however no other issue with the layout difference as we never + access any GtkScrolledWindow fields ourselves. */ + int padding; +} SmallScroller; typedef GtkScrolledWindowClass SmallScrollerClass; G_DEFINE_TYPE(SmallScroller, small_scroller, GTK_TYPE_SCROLLED_WINDOW) diff --git a/scintilla/gtk/ScintillaGTK.cxx b/scintilla/gtk/ScintillaGTK.cxx index 841bbbe40..fb082e05c 100644 --- a/scintilla/gtk/ScintillaGTK.cxx +++ b/scintilla/gtk/ScintillaGTK.cxx @@ -657,7 +657,7 @@ public: gunichar *uniStr; PangoScript pscript; - PreEditString(GtkIMContext *im_context) { + explicit PreEditString(GtkIMContext *im_context) { gtk_im_context_get_preedit_string(im_context, &str, &attrs, &cursor_pos); validUTF8 = g_utf8_validate(str, strlen(str), NULL); uniStr = g_utf8_to_ucs4_fast(str, strlen(str), &uniStrLen); diff --git a/scintilla/lexers/LexCPP.cxx b/scintilla/lexers/LexCPP.cxx index ab982bb4b..1d9e40d17 100644 --- a/scintilla/lexers/LexCPP.cxx +++ b/scintilla/lexers/LexCPP.cxx @@ -1092,7 +1092,6 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, } else if (options.backQuotedStrings && sc.Match('`')) { sc.SetState(SCE_C_STRINGRAW|activitySet); rawStringTerminator = "`"; - sc.Forward(); } else if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) { if (lastWordWasUUID) { sc.SetState(SCE_C_UUID|activitySet); @@ -1246,11 +1245,10 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle, } } else if (sc.Match("undef")) { if (options.updatePreprocessor && !preproc.IsInactive()) { - std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 5, true); + const std::string restOfLine = GetRestOfLine(styler, sc.currentPos + 5, false); std::vector tokens = Tokenize(restOfLine); - std::string key; if (tokens.size() >= 1) { - key = tokens[0]; + const std::string key = tokens[0]; preprocessorDefinitions.erase(key); ppDefineHistory.push_back(PPDefinition(lineCurrent, key, "", true)); definitionsChanged = true; diff --git a/scintilla/lexers/LexFortran.cxx b/scintilla/lexers/LexFortran.cxx index 5deaf1173..387ed84ed 100644 --- a/scintilla/lexers/LexFortran.cxx +++ b/scintilla/lexers/LexFortran.cxx @@ -260,6 +260,7 @@ static int classifyFoldPointFortran(const char* s, const char* prevWord, const c lev = 0; } else if (strcmp(s, "associate") == 0 || strcmp(s, "block") == 0 || strcmp(s, "blockdata") == 0 || strcmp(s, "select") == 0 + || strcmp(s, "selecttype") == 0 || strcmp(s, "selectcase") == 0 || strcmp(s, "do") == 0 || strcmp(s, "enum") ==0 || strcmp(s, "function") == 0 || strcmp(s, "interface") == 0 || strcmp(s, "module") == 0 || strcmp(s, "program") == 0 diff --git a/scintilla/lexers/LexVHDL.cxx b/scintilla/lexers/LexVHDL.cxx index 35383f3d8..56426e43f 100644 --- a/scintilla/lexers/LexVHDL.cxx +++ b/scintilla/lexers/LexVHDL.cxx @@ -216,7 +216,7 @@ static void FoldNoBoxVHDLDoc( // don't check if the style for the keywords that I use to adjust the levels. char words[] = "architecture begin block case component else elsif end entity generate loop package process record then " - "procedure function when"; + "procedure function when units"; WordList keywords; keywords.Set(words); @@ -382,7 +382,8 @@ static void FoldNoBoxVHDLDoc( strcmp(s, "package") ==0 || strcmp(s, "process") == 0 || strcmp(s, "record") == 0 || - strcmp(s, "then") == 0) + strcmp(s, "then") == 0 || + strcmp(s, "units") == 0) { if (strcmp(prevWord, "end") != 0) { @@ -437,7 +438,7 @@ static void FoldNoBoxVHDLDoc( (!IsCommentStyle(styleAtPos)) && (styleAtPos != SCE_VHDL_STRING) && !iswordchar(styler.SafeGetCharAt(pos-1)) && - styler.Match(pos, "is") && + (chAtPos|' ')=='i' && (styler.SafeGetCharAt(pos+1)|' ')=='s' && !iswordchar(styler.SafeGetCharAt(pos+2))) { if (levelMinCurrentElse > levelNext) { diff --git a/scintilla/lexers/LexVerilog.cxx b/scintilla/lexers/LexVerilog.cxx index f0995be24..82b75844f 100644 --- a/scintilla/lexers/LexVerilog.cxx +++ b/scintilla/lexers/LexVerilog.cxx @@ -928,9 +928,10 @@ void SCI_METHOD LexerVerilog::Fold(unsigned int startPos, int length, int initSt if (styler.Match(j, "case") || styler.Match(j, "casex") || styler.Match(j, "casez") || + styler.Match(j, "covergroup") || styler.Match(j, "function") || styler.Match(j, "generate") || - styler.Match(j, "covergroup") || + styler.Match(j, "interface") || styler.Match(j, "package") || styler.Match(j, "primitive") || styler.Match(j, "program") || @@ -962,6 +963,7 @@ void SCI_METHOD LexerVerilog::Fold(unsigned int startPos, int length, int initSt styler.Match(j, "endfunction") || styler.Match(j, "endgenerate") || styler.Match(j, "endgroup") || + styler.Match(j, "endinterface") || styler.Match(j, "endpackage") || styler.Match(j, "endprimitive") || styler.Match(j, "endprogram") || diff --git a/scintilla/src/Document.cxx b/scintilla/src/Document.cxx index 7d34dace1..3f365fdf4 100644 --- a/scintilla/src/Document.cxx +++ b/scintilla/src/Document.cxx @@ -216,6 +216,8 @@ void Document::SetSavePoint() { } void Document::TentativeUndo() { + if (!TentativeActive()) + return; CheckReadOnly(); if (enteredModification == 0) { enteredModification++; diff --git a/scintilla/src/EditModel.h b/scintilla/src/EditModel.h index fce26bd22..33c1ac0df 100644 --- a/scintilla/src/EditModel.h +++ b/scintilla/src/EditModel.h @@ -25,7 +25,7 @@ public: class EditModel { // Private so EditModel objects can not be copied - EditModel(const EditModel &); + explicit EditModel(const EditModel &); EditModel &operator=(const EditModel &); public: diff --git a/scintilla/src/Editor.h b/scintilla/src/Editor.h index 1fc907ac7..2bf8336fa 100644 --- a/scintilla/src/Editor.h +++ b/scintilla/src/Editor.h @@ -153,7 +153,7 @@ struct WrapPending { */ class Editor : public EditModel, public DocWatcher { // Private so Editor objects can not be copied - Editor(const Editor &); + explicit Editor(const Editor &); Editor &operator=(const Editor &); protected: // ScintillaBase subclass needs access to much of Editor diff --git a/scintilla/src/ScintillaBase.h b/scintilla/src/ScintillaBase.h index 668abed3c..d6401cc30 100644 --- a/scintilla/src/ScintillaBase.h +++ b/scintilla/src/ScintillaBase.h @@ -20,7 +20,7 @@ class LexState; */ class ScintillaBase : public Editor { // Private so ScintillaBase objects can not be copied - ScintillaBase(const ScintillaBase &); + explicit ScintillaBase(const ScintillaBase &); ScintillaBase &operator=(const ScintillaBase &); protected: diff --git a/scintilla/version.txt b/scintilla/version.txt index 8941db590..53d5a5ad6 100644 --- a/scintilla/version.txt +++ b/scintilla/version.txt @@ -1 +1 @@ -355 +356 -- 2.11.4.GIT