lists.geany.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
List overview
Commits
January 2022
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
commits@lists.geany.org
1 participants
68 discussions
Start a n
N
ew thread
[geany/geany] c603bb: Update to Scintilla 5.1.5 and Lexilla 5.1.4
by Thomas Martitz
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Thomas Martitz <thomas.martitz(a)mailbox.org> Committer: Thomas Martitz <thomas.martitz(a)mailbox.org> Date: Tue, 07 Dec 2021 06:37:16 UTC Commit: c603bbfad5a92a00b5d2e6f7cf758963e55577ca
https://github.com/geany/geany/commit/c603bbfad5a92a00b5d2e6f7cf758963e5557…
Log Message: ----------- Update to Scintilla 5.1.5 and Lexilla 5.1.4 Scintilla: - SCI_GETTEXT, SCI_GETSELTEXT, and SCI_GETCURLINE behaviorial changes - Autocompletion on Wayland (see #3009) Lexilla: - New parsers: gdscript (see #3012) and asciidoc (see #2986) but not imported yet Modified Paths: -------------- scintilla/gtk/PlatGTK.cxx scintilla/lexilla/include/SciLexer.h scintilla/lexilla/lexers/LexBatch.cxx scintilla/lexilla/src/Lexilla.cxx scintilla/lexilla/version.txt scintilla/src/AutoComplete.cxx scintilla/src/Document.cxx scintilla/src/Editor.cxx scintilla/version.txt scripts/update-scintilla.sh Modified: scintilla/gtk/PlatGTK.cxx 11 lines changed, 11 insertions(+), 0 deletions(-) =================================================================== @@ -23,6 +23,9 @@ #include <gdk/gdk.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> +#if defined(GDK_WINDOWING_WAYLAND) +#include <gdk/gdkwayland.h> +#endif #include "ScintillaTypes.h" #include "ScintillaMessages.h" @@ -1181,6 +1184,14 @@ GdkRectangle MonitorRectangleForWidget(GtkWidget *wid) noexcept { GdkDisplay *pdisplay = gtk_widget_get_display(wid); GdkMonitor *monitor = gdk_display_get_monitor_at_window(pdisplay, wnd); gdk_monitor_get_geometry(monitor, &rcScreen); +#if defined(GDK_WINDOWING_WAYLAND) + if (GDK_IS_WAYLAND_DISPLAY(pdisplay)) { + // The GDK behavior on Wayland is not self-consistent, we must correct the display coordinates to match + // the coordinate space used in gtk_window_move. See also
https://sourceforge.net/p/scintilla/bugs/2296/
+ rcScreen.x = 0; + rcScreen.y = 0; + } +#endif #else GdkScreen *screen = gtk_widget_get_screen(wid); const gint monitor_num = gdk_screen_get_monitor_at_window(screen, wnd); Modified: scintilla/lexilla/include/SciLexer.h 42 lines changed, 42 insertions(+), 0 deletions(-) =================================================================== @@ -146,6 +146,8 @@ #define SCLEX_RAKU 131 #define SCLEX_FSHARP 132 #define SCLEX_JULIA 133 +#define SCLEX_ASCIIDOC 134 +#define SCLEX_GDSCRIPT 135 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 @@ -2002,6 +2004,46 @@ #define SCE_FSHARP_QUOTATION 17 #define SCE_FSHARP_ATTRIBUTE 18 #define SCE_FSHARP_FORMAT_SPEC 19 +#define SCE_ASCIIDOC_DEFAULT 0 +#define SCE_ASCIIDOC_STRONG1 1 +#define SCE_ASCIIDOC_STRONG2 2 +#define SCE_ASCIIDOC_EM1 3 +#define SCE_ASCIIDOC_EM2 4 +#define SCE_ASCIIDOC_HEADER1 5 +#define SCE_ASCIIDOC_HEADER2 6 +#define SCE_ASCIIDOC_HEADER3 7 +#define SCE_ASCIIDOC_HEADER4 8 +#define SCE_ASCIIDOC_HEADER5 9 +#define SCE_ASCIIDOC_HEADER6 10 +#define SCE_ASCIIDOC_ULIST_ITEM 11 +#define SCE_ASCIIDOC_OLIST_ITEM 12 +#define SCE_ASCIIDOC_BLOCKQUOTE 13 +#define SCE_ASCIIDOC_LINK 14 +#define SCE_ASCIIDOC_CODEBK 15 +#define SCE_ASCIIDOC_PASSBK 16 +#define SCE_ASCIIDOC_COMMENT 17 +#define SCE_ASCIIDOC_COMMENTBK 18 +#define SCE_ASCIIDOC_LITERAL 19 +#define SCE_ASCIIDOC_LITERALBK 20 +#define SCE_ASCIIDOC_ATTRIB 21 +#define SCE_ASCIIDOC_ATTRIBVAL 22 +#define SCE_ASCIIDOC_MACRO 23 +#define SCE_GD_DEFAULT 0 +#define SCE_GD_COMMENTLINE 1 +#define SCE_GD_NUMBER 2 +#define SCE_GD_STRING 3 +#define SCE_GD_CHARACTER 4 +#define SCE_GD_WORD 5 +#define SCE_GD_TRIPLE 6 +#define SCE_GD_TRIPLEDOUBLE 7 +#define SCE_GD_CLASSNAME 8 +#define SCE_GD_FUNCNAME 9 +#define SCE_GD_OPERATOR 10 +#define SCE_GD_IDENTIFIER 11 +#define SCE_GD_COMMENTBLOCK 12 +#define SCE_GD_STRINGEOL 13 +#define SCE_GD_WORD2 14 +#define SCE_GD_ANNOTATION 15 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif Modified: scintilla/lexilla/lexers/LexBatch.cxx 64 lines changed, 32 insertions(+), 32 deletions(-) =================================================================== @@ -28,34 +28,36 @@ using namespace Lexilla; -static bool Is0To9(char ch) { +namespace { + +constexpr bool Is0To9(char ch) noexcept { return (ch >= '0') && (ch <= '9'); } -static bool IsAlphabetic(int ch) { +bool IsAlphabetic(int ch) noexcept { return IsASCII(ch) && isalpha(ch); } -static inline bool AtEOL(Accessor &styler, Sci_PositionU i) { +inline bool AtEOL(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } // Tests for BATCH Operators -static bool IsBOperator(char ch) { +constexpr bool IsBOperator(char ch) noexcept { return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') || (ch == '|') || (ch == '?') || (ch == '*')|| (ch == '&') || (ch == '(') || (ch == ')'); } // Tests for BATCH Separators -static bool IsBSeparator(char ch) { +constexpr bool IsBSeparator(char ch) noexcept { return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == '\"') || (ch == '\'') || (ch == '/'); } // Tests for escape character -static bool IsEscaped(char* wordStr, Sci_PositionU pos) { +bool IsEscaped(const char* wordStr, Sci_PositionU pos) noexcept { bool isQoted=false; while (pos>0){ pos--; @@ -68,7 +70,7 @@ static bool IsEscaped(char* wordStr, Sci_PositionU pos) { } // Tests for quote character -static bool textQuoted(char *lineBuffer, Sci_PositionU endPos) { +bool textQuoted(const char *lineBuffer, Sci_PositionU endPos) { char strBuffer[1024]; strncpy(strBuffer, lineBuffer, endPos); strBuffer[endPos] = '\0'; @@ -85,7 +87,7 @@ static bool textQuoted(char *lineBuffer, Sci_PositionU endPos) { return CurrentStatus; } -static void ColouriseBatchDoc( +void ColouriseBatchDoc( Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, @@ -109,7 +111,7 @@ static void ColouriseBatchDoc( } } - char lineBuffer[1024]; + char lineBuffer[1024] {}; styler.StartAt(startPos); styler.StartSegment(startPos); @@ -123,35 +125,26 @@ static void ColouriseBatchDoc( if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1) || (i==startPos + length-1)) { // End of line (or of line buffer) (or End of Last Line) met, colourise it lineBuffer[linePos] = '\0'; - Sci_PositionU lengthLine=linePos; - Sci_PositionU endPos=i; - Sci_PositionU offset = 0; // Line Buffer Offset - Sci_PositionU cmdLoc; // External Command / Program Location - char wordBuffer[81]; // Word Buffer - large to catch long paths - Sci_PositionU wbl; // Word Buffer Length - Sci_PositionU wbo; // Word Buffer Offset - also Special Keyword Buffer Length - WordList &keywords = *keywordlists[0]; // Internal Commands - WordList &keywords2 = *keywordlists[1]; // External Commands (optional) + const Sci_PositionU lengthLine=linePos; + const Sci_PositionU endPos=i; + const WordList &keywords = *keywordlists[0]; // Internal Commands + const WordList &keywords2 = *keywordlists[1]; // External Commands (optional) // CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords // Toggling Regular Keyword Checking off improves readability // Other Regular Keywords and External Commands / Programs might also benefit from toggling // Need a more robust algorithm to properly toggle Regular Keyword Checking bool stopLineProcessing=false; // Used to stop line processing if Comment or Drive Change found - // Special Keywords are those that allow certain characters without whitespace after the command - // Examples are: cd. cd\ md. rd. dir| dir> echo: echo. path= - // Special Keyword Buffer used to determine if the first n characters is a Keyword - char sKeywordBuffer[10]; // Special Keyword Buffer - bool sKeywordFound; // Exit Special Keyword for-loop if found + Sci_PositionU offset = 0; // Line Buffer Offset // Skip initial spaces while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); // Set External Command / Program Location - cmdLoc = offset; + Sci_PositionU cmdLoc = offset; // Check for Fake Label (Comment) or Real Label - return if found if (lineBuffer[offset] == ':') { @@ -190,14 +183,15 @@ static void ColouriseBatchDoc( // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } + char wordBuffer[81]{}; // Word Buffer - large to catch long paths // Copy word from Line Buffer into Word Buffer - wbl = 0; + Sci_PositionU wbl = 0; // Word Buffer Length for (; offset < lengthLine && wbl < 80 && !isspacechar(lineBuffer[offset]); wbl++, offset++) { - wordBuffer[wbl] = static_cast<char>(tolower(lineBuffer[offset])); + wordBuffer[wbl] = tolower(lineBuffer[offset]); } wordBuffer[wbl] = '\0'; - wbo = 0; + Sci_PositionU wbo = 0; // Word Buffer Offset - also Special Keyword Buffer Length // Check for Comment - return if found if ((CompareCaseInsensitive(wordBuffer, "rem") == 0) && continueProcessing) { @@ -287,12 +281,16 @@ static void ColouriseBatchDoc( // Check for Special Keyword // Affected Commands are in Length range 2-6 // Good that ERRORLEVEL, EXIST, CALL, DO, LOADHIGH, and LH are unaffected - sKeywordFound = false; + bool sKeywordFound = false; // Exit Special Keyword for-loop if found for (Sci_PositionU keywordLength = 2; keywordLength < wbl && keywordLength < 7 && !sKeywordFound; keywordLength++) { + // Special Keywords are those that allow certain characters without whitespace after the command + // Examples are: cd. cd\ md. rd. dir| dir> echo: echo. path= + // Special Keyword Buffer used to determine if the first n characters is a Keyword + char sKeywordBuffer[10]{}; // Special Keyword Buffer wbo = 0; // Copy Keyword Length from Word Buffer into Special Keyword Buffer for (; wbo < keywordLength; wbo++) { - sKeywordBuffer[wbo] = static_cast<char>(wordBuffer[wbo]); + sKeywordBuffer[wbo] = wordBuffer[wbo]; } sKeywordBuffer[wbo] = '\0'; // Check for Special Keyword in list @@ -412,12 +410,12 @@ static void ColouriseBatchDoc( if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } - bool isArgument = (wordBuffer[1] == '~'); + const bool isArgument = (wordBuffer[1] == '~'); if (isArgument) { Sci_PositionU expansionStopOffset = 2; bool isValid = false; for (; expansionStopOffset < wbl; expansionStopOffset++) { - if (isArgument && Is0To9(wordBuffer[expansionStopOffset])) { + if (Is0To9(wordBuffer[expansionStopOffset])) { expansionStopOffset++; isValid = true; wbo = expansionStopOffset; @@ -618,10 +616,12 @@ static void ColouriseBatchDoc( } } -static const char *const batchWordListDesc[] = { +const char *const batchWordListDesc[] = { "Internal Commands", "External Commands", 0 }; +} + LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc); Modified: scintilla/lexilla/src/Lexilla.cxx 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -33,6 +33,7 @@ extern LexerModule lmAbaqus; extern LexerModule lmAda; extern LexerModule lmAPDL; extern LexerModule lmAs; +extern LexerModule lmAsciidoc; extern LexerModule lmAsm; extern LexerModule lmAsn1; extern LexerModule lmASY; @@ -76,6 +77,7 @@ extern LexerModule lmFortran; extern LexerModule lmFreeBasic; extern LexerModule lmFSharp; extern LexerModule lmGAP; +extern LexerModule lmGDScript; extern LexerModule lmGui4Cli; extern LexerModule lmHaskell; extern LexerModule lmHollywood; @@ -235,6 +237,7 @@ void AddEachLexer() { &lmAda, &lmAPDL, &lmAs, + &lmAsciidoc, &lmAsm, &lmAsn1, &lmASY, @@ -278,6 +281,7 @@ void AddEachLexer() { &lmFreeBasic, &lmFSharp, &lmGAP, + &lmGDScript, &lmGui4Cli, &lmHaskell, &lmHollywood, Modified: scintilla/lexilla/version.txt 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1 +1 @@ -513 +514 \ No newline at end of file Modified: scintilla/src/AutoComplete.cxx 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -115,6 +115,11 @@ struct Sorter { Sorter(AutoComplete *ac_, const char *list_) : ac(ac_), list(list_) { int i = 0; + if (!list[i]) { + // Empty list has a single empty member + indices.push_back(i); // word start + indices.push_back(i); // word end + } while (list[i]) { indices.push_back(i); // word start while (list[i] != ac->GetTypesep() && list[i] != ac->GetSeparator() && list[i]) Modified: scintilla/src/Document.cxx 89 lines changed, 17 insertions(+), 72 deletions(-) =================================================================== @@ -2871,35 +2871,18 @@ class DocumentIndexer : public CharacterIndexer { class ByteIterator { public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef char value_type; - typedef ptrdiff_t difference_type; - typedef char* pointer; - typedef char& reference; + using iterator_category = std::bidirectional_iterator_tag; + using value_type = char; + using difference_type = ptrdiff_t; + using pointer = char*; + using reference = char&; const Document *doc; Sci::Position position; - ByteIterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : + explicit ByteIterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : doc(doc_), position(position_) { } - ByteIterator(const ByteIterator &other) noexcept { - doc = other.doc; - position = other.position; - } - ByteIterator(ByteIterator &&other) noexcept { - doc = other.doc; - position = other.position; - } - ByteIterator &operator=(const ByteIterator &other) noexcept { - if (this != &other) { - doc = other.doc; - position = other.position; - } - return *this; - } - ByteIterator &operator=(ByteIterator &&) noexcept = default; - ~ByteIterator() = default; char operator*() const noexcept { return doc->CharAt(position); } @@ -2956,11 +2939,11 @@ class UTF8Iterator { size_t lenCharacters; wchar_t buffered[2]; public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef wchar_t value_type; - typedef ptrdiff_t difference_type; - typedef wchar_t* pointer; - typedef wchar_t& reference; + using iterator_category = std::bidirectional_iterator_tag; + using value_type = wchar_t; + using difference_type = ptrdiff_t; + using pointer = wchar_t*; + using reference = wchar_t&; explicit UTF8Iterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : doc(doc_), position(position_), characterIndex(0), lenBytes(0), lenCharacters(0), buffered{} { @@ -2970,30 +2953,6 @@ class UTF8Iterator { ReadCharacter(); } } - UTF8Iterator(const UTF8Iterator &other) noexcept : buffered{} { - doc = other.doc; - position = other.position; - characterIndex = other.characterIndex; - lenBytes = other.lenBytes; - lenCharacters = other.lenCharacters; - buffered[0] = other.buffered[0]; - buffered[1] = other.buffered[1]; - } - UTF8Iterator(UTF8Iterator &&other) noexcept = default; - UTF8Iterator &operator=(const UTF8Iterator &other) noexcept { - if (this != &other) { - doc = other.doc; - position = other.position; - characterIndex = other.characterIndex; - lenBytes = other.lenBytes; - lenCharacters = other.lenCharacters; - buffered[0] = other.buffered[0]; - buffered[1] = other.buffered[1]; - } - return *this; - } - UTF8Iterator &operator=(UTF8Iterator &&) noexcept = default; - ~UTF8Iterator() = default; wchar_t operator*() const noexcept { assert(lenCharacters != 0); return buffered[characterIndex]; @@ -3071,29 +3030,15 @@ class UTF8Iterator { const Document *doc; Sci::Position position; public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef wchar_t value_type; - typedef ptrdiff_t difference_type; - typedef wchar_t* pointer; - typedef wchar_t& reference; + using iterator_category = std::bidirectional_iterator_tag; + using value_type = wchar_t; + using difference_type = ptrdiff_t; + using pointer = wchar_t*; + using reference = wchar_t&; - UTF8Iterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : + explicit UTF8Iterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : doc(doc_), position(position_) { } - UTF8Iterator(const UTF8Iterator &other) noexcept { - doc = other.doc; - position = other.position; - } - UTF8Iterator(UTF8Iterator &&other) noexcept = default; - UTF8Iterator &operator=(const UTF8Iterator &other) noexcept { - if (this != &other) { - doc = other.doc; - position = other.position; - } - return *this; - } - UTF8Iterator &operator=(UTF8Iterator &&) noexcept = default; - ~UTF8Iterator() = default; wchar_t operator*() const noexcept { const Document::CharacterExtracted charExtracted = doc->ExtractCharacter(position); return charExtracted.character; Modified: scintilla/src/Editor.cxx 69 lines changed, 31 insertions(+), 38 deletions(-) =================================================================== @@ -4143,7 +4143,7 @@ Sci::Position Editor::SearchText( ///< @c FindOption::WordStart, @c FindOption::RegExp or @c FindOption::Posix. sptr_t lParam) { ///< The text to search for. - const char *txt = CharPtrFromSPtr(lParam); + const char *txt = ConstCharPtrFromSPtr(lParam); Sci::Position pos = Sci::invalidPosition; Sci::Position lengthFound = strlen(txt); if (!pdoc->HasCaseFolder()) @@ -5741,7 +5741,7 @@ void Editor::StyleSetMessage(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::StyleSetFont: if (lParam != 0) { - vs.SetStyleFontName(static_cast<int>(wParam), CharPtrFromSPtr(lParam)); + vs.SetStyleFontName(static_cast<int>(wParam), ConstCharPtrFromSPtr(lParam)); } break; case Message::StyleSetUnderline: @@ -5888,11 +5888,9 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::GetText: { if (lParam == 0) - return pdoc->Length() + 1; - if (wParam == 0) - return 0; + return pdoc->Length(); char *ptr = CharPtrFromSPtr(lParam); - const Sci_Position len = std::min<Sci_Position>(wParam - 1, pdoc->Length()); + const Sci_Position len = std::min<Sci_Position>(wParam, pdoc->Length()); pdoc->GetCharRange(ptr, 0, len); ptr[len] = '\0'; return len; @@ -5904,7 +5902,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { UndoGroup ug(pdoc); pdoc->DeleteChars(0, pdoc->Length()); SetEmptySelection(0); - const char *text = CharPtrFromSPtr(lParam); + const char *text = ConstCharPtrFromSPtr(lParam); pdoc->InsertString(0, text, strlen(text)); return 1; } @@ -5942,7 +5940,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::CopyText: - CopyText(wParam, CharPtrFromSPtr(lParam)); + CopyText(wParam, ConstCharPtrFromSPtr(lParam)); break; case Message::Paste: @@ -5958,7 +5956,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { if (!sel.Empty()) { ClearSelection(); // want to replace rectangular selection contents } - InsertPasteShape(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam), PasteShape::rectangular); + InsertPasteShape(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam), PasteShape::rectangular); break; } @@ -6033,20 +6031,16 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::GetSelText: { SelectionText selectedText; CopySelectionRange(&selectedText); - if (lParam == 0) { - return selectedText.LengthWithTerminator(); - } else { + if (lParam) { char *ptr = CharPtrFromSPtr(lParam); size_t iChar = selectedText.Length(); if (iChar) { memcpy(ptr, selectedText.Data(), iChar); - ptr[iChar++] = '\0'; - } else { - ptr[0] = '\0'; } - return iChar; + ptr[iChar] = '\0'; } - } + return selectedText.Length(); + } case Message::LineFromPosition: if (PositionFromUPtr(wParam) < 0) @@ -6076,7 +6070,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return 0; UndoGroup ug(pdoc); ClearSelection(); - const char *replacement = CharPtrFromSPtr(lParam); + const char *replacement = ConstCharPtrFromSPtr(lParam); const Sci::Position lengthInserted = pdoc->InsertString( sel.MainCaret(), replacement, strlen(replacement)); SetEmptySelection(sel.MainCaret() + lengthInserted); @@ -6135,15 +6129,15 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::ReplaceTarget: PLATFORM_ASSERT(lParam); - return ReplaceTarget(false, CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + return ReplaceTarget(false, ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); case Message::ReplaceTargetRE: PLATFORM_ASSERT(lParam); - return ReplaceTarget(true, CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + return ReplaceTarget(true, ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); case Message::SearchInTarget: PLATFORM_ASSERT(lParam); - return SearchInTarget(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + return SearchInTarget(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); case Message::SetSearchFlags: searchFlags = static_cast<FindOption>(wParam); @@ -6270,14 +6264,14 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { if (lParam == 0) return 0; const Sci::Position lengthInserted = pdoc->InsertString( - CurrentPosition(), CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + CurrentPosition(), ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); SetEmptySelection(sel.MainCaret() + lengthInserted); return 0; } case Message::AddStyledText: if (lParam) - AddStyledText(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + AddStyledText(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); return 0; case Message::InsertText: { @@ -6287,7 +6281,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { if (insertPos == -1) insertPos = CurrentPosition(); Sci::Position newCurrent = CurrentPosition(); - const char *sz = CharPtrFromSPtr(lParam); + const char *sz = ConstCharPtrFromSPtr(lParam); const Sci::Position lengthInserted = pdoc->InsertString(insertPos, sz, strlen(sz)); if (newCurrent > insertPos) newCurrent += lengthInserted; @@ -6297,12 +6291,12 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::ChangeInsertion: PLATFORM_ASSERT(lParam); - pdoc->ChangeInsertion(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + pdoc->ChangeInsertion(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); return 0; case Message::AppendText: pdoc->InsertString(pdoc->Length(), - CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); return 0; case Message::ClearAll: @@ -6554,11 +6548,10 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { const Sci::Position lineStart = pdoc->LineStart(lineCurrentPos); const Sci::Position lineEnd = pdoc->LineStart(lineCurrentPos + 1); if (lParam == 0) { - return 1 + lineEnd - lineStart; + return lineEnd - lineStart; } - PLATFORM_ASSERT(wParam > 0); char *ptr = CharPtrFromSPtr(lParam); - const Sci::Position len = std::min<uptr_t>(lineEnd - lineStart, wParam - 1); + const Sci::Position len = std::min<uptr_t>(lineEnd - lineStart, wParam); pdoc->GetCharRange(ptr, lineStart, len); ptr[len] = '\0'; return sel.MainCaret() - lineStart; @@ -6603,7 +6596,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::SetStylingEx: // Specify a complete styling buffer if (lParam == 0) return 0; - pdoc->SetStyles(PositionFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->SetStyles(PositionFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::SetBufferedDraw: @@ -6842,7 +6835,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::TextWidth: PLATFORM_ASSERT(wParam < vs.styles.size()); PLATFORM_ASSERT(lParam); - return TextWidth(wParam, CharPtrFromSPtr(lParam)); + return TextWidth(wParam, ConstCharPtrFromSPtr(lParam)); case Message::TextHeight: RefreshStyleData(); @@ -7086,7 +7079,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::MarkerDefinePixmap: if (wParam <= MarkerMax) { - vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam)); + vs.markers[wParam].SetXPM(ConstCharPtrFromSPtr(lParam)); vs.CalcLargestMarkerHeight(); } InvalidateStyleData(); @@ -7275,7 +7268,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::SetFontLocale: if (lParam) { - vs.SetFontLocaleName(CharPtrFromSPtr(lParam)); + vs.SetFontLocaleName(ConstCharPtrFromSPtr(lParam)); InvalidateStyleRedraw(); } break; @@ -7437,7 +7430,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::ToggleFoldShowText: - pcs->SetFoldDisplayText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pcs->SetFoldDisplayText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); FoldLine(LineFromUPtr(wParam), FoldAction::Toggle); break; @@ -7450,7 +7443,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return static_cast<sptr_t>(foldDisplayTextStyle); case Message::SetDefaultFoldDisplayText: - SetDefaultFoldDisplayText(CharPtrFromSPtr(lParam)); + SetDefaultFoldDisplayText(ConstCharPtrFromSPtr(lParam)); Redraw(); break; @@ -8281,7 +8274,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return static_cast<sptr_t>(marginOptions); case Message::MarginSetText: - pdoc->MarginSetText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->MarginSetText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::MarginGetText: { @@ -8312,7 +8305,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::AnnotationSetText: - pdoc->AnnotationSetText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->AnnotationSetText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::AnnotationGetText: { @@ -8361,7 +8354,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return vs.annotationStyleOffset; case Message::EOLAnnotationSetText: - pdoc->EOLAnnotationSetText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->EOLAnnotationSetText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::EOLAnnotationGetText: { Modified: scintilla/version.txt 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1 +1 @@ -514 +515 Modified: scripts/update-scintilla.sh 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -84,7 +84,7 @@ git apply -p0 scintilla/scintilla_changes.patch || { } echo "Upstream lexer catalogue changes:" -git diff -p -R --src-prefix= --dst-prefix= scintilla/lexilla/src/Lexilla.cxx +git diff -p --src-prefix= --dst-prefix= scintilla/lexilla/src/Lexilla.cxx # show a nice success banner echo "Scintilla update successful!" | sed 'h;s/./=/g;p;x;p;x' -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] a04f36: Merge pull request #3046 from kugel-/scintilla5-trad
by Thomas Martitz
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Thomas Martitz <thomas.martitz(a)mailbox.org> Committer: GitHub <noreply(a)github.com> Date: Sun, 09 Jan 2022 22:50:41 UTC Commit: a04f361ef357335e007a23ef04f3a3a4eec16c85
https://github.com/geany/geany/commit/a04f361ef357335e007a23ef04f3a3a4eec16…
Log Message: ----------- Merge pull request #3046 from kugel-/scintilla5-trad Update to Scintilla 5.1.5 and Lexilla 5.1.4 Modified Paths: -------------- scintilla/gtk/PlatGTK.cxx scintilla/lexilla/include/SciLexer.h scintilla/lexilla/lexers/LexBatch.cxx scintilla/lexilla/src/Lexilla.cxx scintilla/lexilla/version.txt scintilla/src/AutoComplete.cxx scintilla/src/Document.cxx scintilla/src/Editor.cxx scintilla/version.txt scripts/update-scintilla.sh src/sciwrappers.c Modified: scintilla/gtk/PlatGTK.cxx 11 lines changed, 11 insertions(+), 0 deletions(-) =================================================================== @@ -23,6 +23,9 @@ #include <gdk/gdk.h> #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> +#if defined(GDK_WINDOWING_WAYLAND) +#include <gdk/gdkwayland.h> +#endif #include "ScintillaTypes.h" #include "ScintillaMessages.h" @@ -1181,6 +1184,14 @@ GdkRectangle MonitorRectangleForWidget(GtkWidget *wid) noexcept { GdkDisplay *pdisplay = gtk_widget_get_display(wid); GdkMonitor *monitor = gdk_display_get_monitor_at_window(pdisplay, wnd); gdk_monitor_get_geometry(monitor, &rcScreen); +#if defined(GDK_WINDOWING_WAYLAND) + if (GDK_IS_WAYLAND_DISPLAY(pdisplay)) { + // The GDK behavior on Wayland is not self-consistent, we must correct the display coordinates to match + // the coordinate space used in gtk_window_move. See also
https://sourceforge.net/p/scintilla/bugs/2296/
+ rcScreen.x = 0; + rcScreen.y = 0; + } +#endif #else GdkScreen *screen = gtk_widget_get_screen(wid); const gint monitor_num = gdk_screen_get_monitor_at_window(screen, wnd); Modified: scintilla/lexilla/include/SciLexer.h 42 lines changed, 42 insertions(+), 0 deletions(-) =================================================================== @@ -146,6 +146,8 @@ #define SCLEX_RAKU 131 #define SCLEX_FSHARP 132 #define SCLEX_JULIA 133 +#define SCLEX_ASCIIDOC 134 +#define SCLEX_GDSCRIPT 135 #define SCLEX_AUTOMATIC 1000 #define SCE_P_DEFAULT 0 #define SCE_P_COMMENTLINE 1 @@ -2002,6 +2004,46 @@ #define SCE_FSHARP_QUOTATION 17 #define SCE_FSHARP_ATTRIBUTE 18 #define SCE_FSHARP_FORMAT_SPEC 19 +#define SCE_ASCIIDOC_DEFAULT 0 +#define SCE_ASCIIDOC_STRONG1 1 +#define SCE_ASCIIDOC_STRONG2 2 +#define SCE_ASCIIDOC_EM1 3 +#define SCE_ASCIIDOC_EM2 4 +#define SCE_ASCIIDOC_HEADER1 5 +#define SCE_ASCIIDOC_HEADER2 6 +#define SCE_ASCIIDOC_HEADER3 7 +#define SCE_ASCIIDOC_HEADER4 8 +#define SCE_ASCIIDOC_HEADER5 9 +#define SCE_ASCIIDOC_HEADER6 10 +#define SCE_ASCIIDOC_ULIST_ITEM 11 +#define SCE_ASCIIDOC_OLIST_ITEM 12 +#define SCE_ASCIIDOC_BLOCKQUOTE 13 +#define SCE_ASCIIDOC_LINK 14 +#define SCE_ASCIIDOC_CODEBK 15 +#define SCE_ASCIIDOC_PASSBK 16 +#define SCE_ASCIIDOC_COMMENT 17 +#define SCE_ASCIIDOC_COMMENTBK 18 +#define SCE_ASCIIDOC_LITERAL 19 +#define SCE_ASCIIDOC_LITERALBK 20 +#define SCE_ASCIIDOC_ATTRIB 21 +#define SCE_ASCIIDOC_ATTRIBVAL 22 +#define SCE_ASCIIDOC_MACRO 23 +#define SCE_GD_DEFAULT 0 +#define SCE_GD_COMMENTLINE 1 +#define SCE_GD_NUMBER 2 +#define SCE_GD_STRING 3 +#define SCE_GD_CHARACTER 4 +#define SCE_GD_WORD 5 +#define SCE_GD_TRIPLE 6 +#define SCE_GD_TRIPLEDOUBLE 7 +#define SCE_GD_CLASSNAME 8 +#define SCE_GD_FUNCNAME 9 +#define SCE_GD_OPERATOR 10 +#define SCE_GD_IDENTIFIER 11 +#define SCE_GD_COMMENTBLOCK 12 +#define SCE_GD_STRINGEOL 13 +#define SCE_GD_WORD2 14 +#define SCE_GD_ANNOTATION 15 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ #endif Modified: scintilla/lexilla/lexers/LexBatch.cxx 64 lines changed, 32 insertions(+), 32 deletions(-) =================================================================== @@ -28,34 +28,36 @@ using namespace Lexilla; -static bool Is0To9(char ch) { +namespace { + +constexpr bool Is0To9(char ch) noexcept { return (ch >= '0') && (ch <= '9'); } -static bool IsAlphabetic(int ch) { +bool IsAlphabetic(int ch) noexcept { return IsASCII(ch) && isalpha(ch); } -static inline bool AtEOL(Accessor &styler, Sci_PositionU i) { +inline bool AtEOL(Accessor &styler, Sci_PositionU i) { return (styler[i] == '\n') || ((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n')); } // Tests for BATCH Operators -static bool IsBOperator(char ch) { +constexpr bool IsBOperator(char ch) noexcept { return (ch == '=') || (ch == '+') || (ch == '>') || (ch == '<') || (ch == '|') || (ch == '?') || (ch == '*')|| (ch == '&') || (ch == '(') || (ch == ')'); } // Tests for BATCH Separators -static bool IsBSeparator(char ch) { +constexpr bool IsBSeparator(char ch) noexcept { return (ch == '\\') || (ch == '.') || (ch == ';') || (ch == '\"') || (ch == '\'') || (ch == '/'); } // Tests for escape character -static bool IsEscaped(char* wordStr, Sci_PositionU pos) { +bool IsEscaped(const char* wordStr, Sci_PositionU pos) noexcept { bool isQoted=false; while (pos>0){ pos--; @@ -68,7 +70,7 @@ static bool IsEscaped(char* wordStr, Sci_PositionU pos) { } // Tests for quote character -static bool textQuoted(char *lineBuffer, Sci_PositionU endPos) { +bool textQuoted(const char *lineBuffer, Sci_PositionU endPos) { char strBuffer[1024]; strncpy(strBuffer, lineBuffer, endPos); strBuffer[endPos] = '\0'; @@ -85,7 +87,7 @@ static bool textQuoted(char *lineBuffer, Sci_PositionU endPos) { return CurrentStatus; } -static void ColouriseBatchDoc( +void ColouriseBatchDoc( Sci_PositionU startPos, Sci_Position length, int /*initStyle*/, @@ -109,7 +111,7 @@ static void ColouriseBatchDoc( } } - char lineBuffer[1024]; + char lineBuffer[1024] {}; styler.StartAt(startPos); styler.StartSegment(startPos); @@ -123,35 +125,26 @@ static void ColouriseBatchDoc( if (AtEOL(styler, i) || (linePos >= sizeof(lineBuffer) - 1) || (i==startPos + length-1)) { // End of line (or of line buffer) (or End of Last Line) met, colourise it lineBuffer[linePos] = '\0'; - Sci_PositionU lengthLine=linePos; - Sci_PositionU endPos=i; - Sci_PositionU offset = 0; // Line Buffer Offset - Sci_PositionU cmdLoc; // External Command / Program Location - char wordBuffer[81]; // Word Buffer - large to catch long paths - Sci_PositionU wbl; // Word Buffer Length - Sci_PositionU wbo; // Word Buffer Offset - also Special Keyword Buffer Length - WordList &keywords = *keywordlists[0]; // Internal Commands - WordList &keywords2 = *keywordlists[1]; // External Commands (optional) + const Sci_PositionU lengthLine=linePos; + const Sci_PositionU endPos=i; + const WordList &keywords = *keywordlists[0]; // Internal Commands + const WordList &keywords2 = *keywordlists[1]; // External Commands (optional) // CHOICE, ECHO, GOTO, PROMPT and SET have Default Text that may contain Regular Keywords // Toggling Regular Keyword Checking off improves readability // Other Regular Keywords and External Commands / Programs might also benefit from toggling // Need a more robust algorithm to properly toggle Regular Keyword Checking bool stopLineProcessing=false; // Used to stop line processing if Comment or Drive Change found - // Special Keywords are those that allow certain characters without whitespace after the command - // Examples are: cd. cd\ md. rd. dir| dir> echo: echo. path= - // Special Keyword Buffer used to determine if the first n characters is a Keyword - char sKeywordBuffer[10]; // Special Keyword Buffer - bool sKeywordFound; // Exit Special Keyword for-loop if found + Sci_PositionU offset = 0; // Line Buffer Offset // Skip initial spaces while ((offset < lengthLine) && (isspacechar(lineBuffer[offset]))) { offset++; } // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); // Set External Command / Program Location - cmdLoc = offset; + Sci_PositionU cmdLoc = offset; // Check for Fake Label (Comment) or Real Label - return if found if (lineBuffer[offset] == ':') { @@ -190,14 +183,15 @@ static void ColouriseBatchDoc( // Colorize Default Text styler.ColourTo(startLine + offset - 1, SCE_BAT_DEFAULT); } + char wordBuffer[81]{}; // Word Buffer - large to catch long paths // Copy word from Line Buffer into Word Buffer - wbl = 0; + Sci_PositionU wbl = 0; // Word Buffer Length for (; offset < lengthLine && wbl < 80 && !isspacechar(lineBuffer[offset]); wbl++, offset++) { - wordBuffer[wbl] = static_cast<char>(tolower(lineBuffer[offset])); + wordBuffer[wbl] = tolower(lineBuffer[offset]); } wordBuffer[wbl] = '\0'; - wbo = 0; + Sci_PositionU wbo = 0; // Word Buffer Offset - also Special Keyword Buffer Length // Check for Comment - return if found if ((CompareCaseInsensitive(wordBuffer, "rem") == 0) && continueProcessing) { @@ -287,12 +281,16 @@ static void ColouriseBatchDoc( // Check for Special Keyword // Affected Commands are in Length range 2-6 // Good that ERRORLEVEL, EXIST, CALL, DO, LOADHIGH, and LH are unaffected - sKeywordFound = false; + bool sKeywordFound = false; // Exit Special Keyword for-loop if found for (Sci_PositionU keywordLength = 2; keywordLength < wbl && keywordLength < 7 && !sKeywordFound; keywordLength++) { + // Special Keywords are those that allow certain characters without whitespace after the command + // Examples are: cd. cd\ md. rd. dir| dir> echo: echo. path= + // Special Keyword Buffer used to determine if the first n characters is a Keyword + char sKeywordBuffer[10]{}; // Special Keyword Buffer wbo = 0; // Copy Keyword Length from Word Buffer into Special Keyword Buffer for (; wbo < keywordLength; wbo++) { - sKeywordBuffer[wbo] = static_cast<char>(wordBuffer[wbo]); + sKeywordBuffer[wbo] = wordBuffer[wbo]; } sKeywordBuffer[wbo] = '\0'; // Check for Special Keyword in list @@ -412,12 +410,12 @@ static void ColouriseBatchDoc( if (cmdLoc == offset - wbl) { cmdLoc = offset - (wbl - wbo); } - bool isArgument = (wordBuffer[1] == '~'); + const bool isArgument = (wordBuffer[1] == '~'); if (isArgument) { Sci_PositionU expansionStopOffset = 2; bool isValid = false; for (; expansionStopOffset < wbl; expansionStopOffset++) { - if (isArgument && Is0To9(wordBuffer[expansionStopOffset])) { + if (Is0To9(wordBuffer[expansionStopOffset])) { expansionStopOffset++; isValid = true; wbo = expansionStopOffset; @@ -618,10 +616,12 @@ static void ColouriseBatchDoc( } } -static const char *const batchWordListDesc[] = { +const char *const batchWordListDesc[] = { "Internal Commands", "External Commands", 0 }; +} + LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc); Modified: scintilla/lexilla/src/Lexilla.cxx 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -33,6 +33,7 @@ extern LexerModule lmAbaqus; extern LexerModule lmAda; extern LexerModule lmAPDL; extern LexerModule lmAs; +extern LexerModule lmAsciidoc; extern LexerModule lmAsm; extern LexerModule lmAsn1; extern LexerModule lmASY; @@ -76,6 +77,7 @@ extern LexerModule lmFortran; extern LexerModule lmFreeBasic; extern LexerModule lmFSharp; extern LexerModule lmGAP; +extern LexerModule lmGDScript; extern LexerModule lmGui4Cli; extern LexerModule lmHaskell; extern LexerModule lmHollywood; @@ -235,6 +237,7 @@ void AddEachLexer() { &lmAda, &lmAPDL, &lmAs, + &lmAsciidoc, &lmAsm, &lmAsn1, &lmASY, @@ -278,6 +281,7 @@ void AddEachLexer() { &lmFreeBasic, &lmFSharp, &lmGAP, + &lmGDScript, &lmGui4Cli, &lmHaskell, &lmHollywood, Modified: scintilla/lexilla/version.txt 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1 +1 @@ -513 +514 \ No newline at end of file Modified: scintilla/src/AutoComplete.cxx 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -115,6 +115,11 @@ struct Sorter { Sorter(AutoComplete *ac_, const char *list_) : ac(ac_), list(list_) { int i = 0; + if (!list[i]) { + // Empty list has a single empty member + indices.push_back(i); // word start + indices.push_back(i); // word end + } while (list[i]) { indices.push_back(i); // word start while (list[i] != ac->GetTypesep() && list[i] != ac->GetSeparator() && list[i]) Modified: scintilla/src/Document.cxx 89 lines changed, 17 insertions(+), 72 deletions(-) =================================================================== @@ -2871,35 +2871,18 @@ class DocumentIndexer : public CharacterIndexer { class ByteIterator { public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef char value_type; - typedef ptrdiff_t difference_type; - typedef char* pointer; - typedef char& reference; + using iterator_category = std::bidirectional_iterator_tag; + using value_type = char; + using difference_type = ptrdiff_t; + using pointer = char*; + using reference = char&; const Document *doc; Sci::Position position; - ByteIterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : + explicit ByteIterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : doc(doc_), position(position_) { } - ByteIterator(const ByteIterator &other) noexcept { - doc = other.doc; - position = other.position; - } - ByteIterator(ByteIterator &&other) noexcept { - doc = other.doc; - position = other.position; - } - ByteIterator &operator=(const ByteIterator &other) noexcept { - if (this != &other) { - doc = other.doc; - position = other.position; - } - return *this; - } - ByteIterator &operator=(ByteIterator &&) noexcept = default; - ~ByteIterator() = default; char operator*() const noexcept { return doc->CharAt(position); } @@ -2956,11 +2939,11 @@ class UTF8Iterator { size_t lenCharacters; wchar_t buffered[2]; public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef wchar_t value_type; - typedef ptrdiff_t difference_type; - typedef wchar_t* pointer; - typedef wchar_t& reference; + using iterator_category = std::bidirectional_iterator_tag; + using value_type = wchar_t; + using difference_type = ptrdiff_t; + using pointer = wchar_t*; + using reference = wchar_t&; explicit UTF8Iterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : doc(doc_), position(position_), characterIndex(0), lenBytes(0), lenCharacters(0), buffered{} { @@ -2970,30 +2953,6 @@ class UTF8Iterator { ReadCharacter(); } } - UTF8Iterator(const UTF8Iterator &other) noexcept : buffered{} { - doc = other.doc; - position = other.position; - characterIndex = other.characterIndex; - lenBytes = other.lenBytes; - lenCharacters = other.lenCharacters; - buffered[0] = other.buffered[0]; - buffered[1] = other.buffered[1]; - } - UTF8Iterator(UTF8Iterator &&other) noexcept = default; - UTF8Iterator &operator=(const UTF8Iterator &other) noexcept { - if (this != &other) { - doc = other.doc; - position = other.position; - characterIndex = other.characterIndex; - lenBytes = other.lenBytes; - lenCharacters = other.lenCharacters; - buffered[0] = other.buffered[0]; - buffered[1] = other.buffered[1]; - } - return *this; - } - UTF8Iterator &operator=(UTF8Iterator &&) noexcept = default; - ~UTF8Iterator() = default; wchar_t operator*() const noexcept { assert(lenCharacters != 0); return buffered[characterIndex]; @@ -3071,29 +3030,15 @@ class UTF8Iterator { const Document *doc; Sci::Position position; public: - typedef std::bidirectional_iterator_tag iterator_category; - typedef wchar_t value_type; - typedef ptrdiff_t difference_type; - typedef wchar_t* pointer; - typedef wchar_t& reference; + using iterator_category = std::bidirectional_iterator_tag; + using value_type = wchar_t; + using difference_type = ptrdiff_t; + using pointer = wchar_t*; + using reference = wchar_t&; - UTF8Iterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : + explicit UTF8Iterator(const Document *doc_=nullptr, Sci::Position position_=0) noexcept : doc(doc_), position(position_) { } - UTF8Iterator(const UTF8Iterator &other) noexcept { - doc = other.doc; - position = other.position; - } - UTF8Iterator(UTF8Iterator &&other) noexcept = default; - UTF8Iterator &operator=(const UTF8Iterator &other) noexcept { - if (this != &other) { - doc = other.doc; - position = other.position; - } - return *this; - } - UTF8Iterator &operator=(UTF8Iterator &&) noexcept = default; - ~UTF8Iterator() = default; wchar_t operator*() const noexcept { const Document::CharacterExtracted charExtracted = doc->ExtractCharacter(position); return charExtracted.character; Modified: scintilla/src/Editor.cxx 69 lines changed, 31 insertions(+), 38 deletions(-) =================================================================== @@ -4143,7 +4143,7 @@ Sci::Position Editor::SearchText( ///< @c FindOption::WordStart, @c FindOption::RegExp or @c FindOption::Posix. sptr_t lParam) { ///< The text to search for. - const char *txt = CharPtrFromSPtr(lParam); + const char *txt = ConstCharPtrFromSPtr(lParam); Sci::Position pos = Sci::invalidPosition; Sci::Position lengthFound = strlen(txt); if (!pdoc->HasCaseFolder()) @@ -5741,7 +5741,7 @@ void Editor::StyleSetMessage(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::StyleSetFont: if (lParam != 0) { - vs.SetStyleFontName(static_cast<int>(wParam), CharPtrFromSPtr(lParam)); + vs.SetStyleFontName(static_cast<int>(wParam), ConstCharPtrFromSPtr(lParam)); } break; case Message::StyleSetUnderline: @@ -5888,11 +5888,9 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::GetText: { if (lParam == 0) - return pdoc->Length() + 1; - if (wParam == 0) - return 0; + return pdoc->Length(); char *ptr = CharPtrFromSPtr(lParam); - const Sci_Position len = std::min<Sci_Position>(wParam - 1, pdoc->Length()); + const Sci_Position len = std::min<Sci_Position>(wParam, pdoc->Length()); pdoc->GetCharRange(ptr, 0, len); ptr[len] = '\0'; return len; @@ -5904,7 +5902,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { UndoGroup ug(pdoc); pdoc->DeleteChars(0, pdoc->Length()); SetEmptySelection(0); - const char *text = CharPtrFromSPtr(lParam); + const char *text = ConstCharPtrFromSPtr(lParam); pdoc->InsertString(0, text, strlen(text)); return 1; } @@ -5942,7 +5940,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::CopyText: - CopyText(wParam, CharPtrFromSPtr(lParam)); + CopyText(wParam, ConstCharPtrFromSPtr(lParam)); break; case Message::Paste: @@ -5958,7 +5956,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { if (!sel.Empty()) { ClearSelection(); // want to replace rectangular selection contents } - InsertPasteShape(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam), PasteShape::rectangular); + InsertPasteShape(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam), PasteShape::rectangular); break; } @@ -6033,20 +6031,16 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::GetSelText: { SelectionText selectedText; CopySelectionRange(&selectedText); - if (lParam == 0) { - return selectedText.LengthWithTerminator(); - } else { + if (lParam) { char *ptr = CharPtrFromSPtr(lParam); size_t iChar = selectedText.Length(); if (iChar) { memcpy(ptr, selectedText.Data(), iChar); - ptr[iChar++] = '\0'; - } else { - ptr[0] = '\0'; } - return iChar; + ptr[iChar] = '\0'; } - } + return selectedText.Length(); + } case Message::LineFromPosition: if (PositionFromUPtr(wParam) < 0) @@ -6076,7 +6070,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return 0; UndoGroup ug(pdoc); ClearSelection(); - const char *replacement = CharPtrFromSPtr(lParam); + const char *replacement = ConstCharPtrFromSPtr(lParam); const Sci::Position lengthInserted = pdoc->InsertString( sel.MainCaret(), replacement, strlen(replacement)); SetEmptySelection(sel.MainCaret() + lengthInserted); @@ -6135,15 +6129,15 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::ReplaceTarget: PLATFORM_ASSERT(lParam); - return ReplaceTarget(false, CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + return ReplaceTarget(false, ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); case Message::ReplaceTargetRE: PLATFORM_ASSERT(lParam); - return ReplaceTarget(true, CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + return ReplaceTarget(true, ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); case Message::SearchInTarget: PLATFORM_ASSERT(lParam); - return SearchInTarget(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + return SearchInTarget(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); case Message::SetSearchFlags: searchFlags = static_cast<FindOption>(wParam); @@ -6270,14 +6264,14 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { if (lParam == 0) return 0; const Sci::Position lengthInserted = pdoc->InsertString( - CurrentPosition(), CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + CurrentPosition(), ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); SetEmptySelection(sel.MainCaret() + lengthInserted); return 0; } case Message::AddStyledText: if (lParam) - AddStyledText(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + AddStyledText(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); return 0; case Message::InsertText: { @@ -6287,7 +6281,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { if (insertPos == -1) insertPos = CurrentPosition(); Sci::Position newCurrent = CurrentPosition(); - const char *sz = CharPtrFromSPtr(lParam); + const char *sz = ConstCharPtrFromSPtr(lParam); const Sci::Position lengthInserted = pdoc->InsertString(insertPos, sz, strlen(sz)); if (newCurrent > insertPos) newCurrent += lengthInserted; @@ -6297,12 +6291,12 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::ChangeInsertion: PLATFORM_ASSERT(lParam); - pdoc->ChangeInsertion(CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + pdoc->ChangeInsertion(ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); return 0; case Message::AppendText: pdoc->InsertString(pdoc->Length(), - CharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); + ConstCharPtrFromSPtr(lParam), PositionFromUPtr(wParam)); return 0; case Message::ClearAll: @@ -6554,11 +6548,10 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { const Sci::Position lineStart = pdoc->LineStart(lineCurrentPos); const Sci::Position lineEnd = pdoc->LineStart(lineCurrentPos + 1); if (lParam == 0) { - return 1 + lineEnd - lineStart; + return lineEnd - lineStart; } - PLATFORM_ASSERT(wParam > 0); char *ptr = CharPtrFromSPtr(lParam); - const Sci::Position len = std::min<uptr_t>(lineEnd - lineStart, wParam - 1); + const Sci::Position len = std::min<uptr_t>(lineEnd - lineStart, wParam); pdoc->GetCharRange(ptr, lineStart, len); ptr[len] = '\0'; return sel.MainCaret() - lineStart; @@ -6603,7 +6596,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::SetStylingEx: // Specify a complete styling buffer if (lParam == 0) return 0; - pdoc->SetStyles(PositionFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->SetStyles(PositionFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::SetBufferedDraw: @@ -6842,7 +6835,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::TextWidth: PLATFORM_ASSERT(wParam < vs.styles.size()); PLATFORM_ASSERT(lParam); - return TextWidth(wParam, CharPtrFromSPtr(lParam)); + return TextWidth(wParam, ConstCharPtrFromSPtr(lParam)); case Message::TextHeight: RefreshStyleData(); @@ -7086,7 +7079,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::MarkerDefinePixmap: if (wParam <= MarkerMax) { - vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam)); + vs.markers[wParam].SetXPM(ConstCharPtrFromSPtr(lParam)); vs.CalcLargestMarkerHeight(); } InvalidateStyleData(); @@ -7275,7 +7268,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { case Message::SetFontLocale: if (lParam) { - vs.SetFontLocaleName(CharPtrFromSPtr(lParam)); + vs.SetFontLocaleName(ConstCharPtrFromSPtr(lParam)); InvalidateStyleRedraw(); } break; @@ -7437,7 +7430,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::ToggleFoldShowText: - pcs->SetFoldDisplayText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pcs->SetFoldDisplayText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); FoldLine(LineFromUPtr(wParam), FoldAction::Toggle); break; @@ -7450,7 +7443,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return static_cast<sptr_t>(foldDisplayTextStyle); case Message::SetDefaultFoldDisplayText: - SetDefaultFoldDisplayText(CharPtrFromSPtr(lParam)); + SetDefaultFoldDisplayText(ConstCharPtrFromSPtr(lParam)); Redraw(); break; @@ -8281,7 +8274,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return static_cast<sptr_t>(marginOptions); case Message::MarginSetText: - pdoc->MarginSetText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->MarginSetText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::MarginGetText: { @@ -8312,7 +8305,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { break; case Message::AnnotationSetText: - pdoc->AnnotationSetText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->AnnotationSetText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::AnnotationGetText: { @@ -8361,7 +8354,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) { return vs.annotationStyleOffset; case Message::EOLAnnotationSetText: - pdoc->EOLAnnotationSetText(LineFromUPtr(wParam), CharPtrFromSPtr(lParam)); + pdoc->EOLAnnotationSetText(LineFromUPtr(wParam), ConstCharPtrFromSPtr(lParam)); break; case Message::EOLAnnotationGetText: { Modified: scintilla/version.txt 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1 +1 @@ -514 +515 Modified: scripts/update-scintilla.sh 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -84,7 +84,7 @@ git apply -p0 scintilla/scintilla_changes.patch || { } echo "Upstream lexer catalogue changes:" -git diff -p -R --src-prefix= --dst-prefix= scintilla/lexilla/src/Lexilla.cxx +git diff -p --src-prefix= --dst-prefix= scintilla/lexilla/src/Lexilla.cxx # show a nice success banner echo "Scintilla update successful!" | sed 'h;s/./=/g;p;x;p;x' Modified: src/sciwrappers.c 18 lines changed, 14 insertions(+), 4 deletions(-) =================================================================== @@ -730,7 +730,10 @@ gchar *sci_get_line(ScintillaObject *sci, gint line_num) GEANY_API_SYMBOL void sci_get_text(ScintillaObject *sci, gint len, gchar *text) { - SSM(sci, SCI_GETTEXT, (uptr_t) len, (sptr_t) text); + if (len > 0) { + SSM(sci, SCI_GETTEXT, (uptr_t) len - 1, (sptr_t) text); + text[len] = '\0'; + } } @@ -749,10 +752,14 @@ gchar *sci_get_contents(ScintillaObject *sci, gint buffer_len) gchar *text; if (buffer_len < 0) - buffer_len = sci_get_length(sci) + 1; + return sci_get_string(sci, SCI_GETTEXT, 0); - text = g_malloc(buffer_len); - SSM(sci, SCI_GETTEXT, (uptr_t) buffer_len, (sptr_t) text); + text = NULL; + if (buffer_len > 0) { + text = g_malloc(buffer_len); + sci_get_text(sci, buffer_len - 1, text); + text[buffer_len - 1] = '\0'; + } return text; } @@ -761,6 +768,9 @@ gchar *sci_get_contents(ScintillaObject *sci, gint buffer_len) * @deprecated sci_get_selected_text is deprecated and should not be used in newly-written code. * Use sci_get_selection_contents() instead. * + * @note You must ensure NUL termination yourself, this function does + * not NUL terminate the buffer itself. + * * @param sci Scintilla widget. * @param text Text buffer; must be allocated sci_get_selected_text_length() + 1 bytes * for null-termination. */ -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 64f6aa: Move function/variable formatting into tm_parser
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Sun, 09 Jan 2022 22:32:40 UTC Commit: 64f6aa66e69747adff9fb56bd1a6d63935dfe781
https://github.com/geany/geany/commit/64f6aa66e69747adff9fb56bd1a6d63935dfe…
Log Message: ----------- Move function/variable formatting into tm_parser Modified Paths: -------------- src/editor.c src/editor.h src/symbols.c src/tagmanager/tm_parser.c src/tagmanager/tm_parser.h Modified: src/editor.c 66 lines changed, 4 insertions(+), 62 deletions(-) =================================================================== @@ -1847,53 +1847,6 @@ static gint find_start_bracket(ScintillaObject *sci, gint pos) } -static gboolean append_calltip(GString *str, const TMTag *tag, GeanyFiletypeID ft_id) -{ - if (! tag->arglist) - return FALSE; - - if (ft_id != GEANY_FILETYPES_PASCAL && ft_id != GEANY_FILETYPES_GO) - { /* usual calltips: "retval tagname (arglist)" */ - if (tag->var_type) - { - guint i; - - g_string_append(str, tag->var_type); - for (i = 0; i < tag->pointerOrder; i++) - { - g_string_append_c(str, '*'); - } - g_string_append_c(str, ' '); - } - if (tag->scope) - { - const gchar *cosep = symbols_get_context_separator(ft_id); - - g_string_append(str, tag->scope); - g_string_append(str, cosep); - } - g_string_append(str, tag->name); - g_string_append_c(str, ' '); - g_string_append(str, tag->arglist); - } - else - { /* special case Pascal/Go calltips: "tagname (arglist) : retval" - * (with ':' omitted for Go) */ - g_string_append(str, tag->name); - g_string_append_c(str, ' '); - g_string_append(str, tag->arglist); - - if (!EMPTY(tag->var_type)) - { - g_string_append(str, ft_id == GEANY_FILETYPES_PASCAL ? " : " : " "); - g_string_append(str, tag->var_type); - } - } - - return TRUE; -} - - static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) { GPtrArray *tags; @@ -1964,10 +1917,13 @@ static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) if (str == NULL) { + gchar *f = tm_parser_format_function(tag->lang, tag->name, + tag->arglist, tag->var_type, tag->scope); str = g_string_new(NULL); if (calltip.tag_index > 0) g_string_prepend(str, "\001 "); /* up arrow */ - append_calltip(str, tag, FILETYPE_ID(ft)); + g_string_append(str, f); + g_free(f); } else /* add a down arrow */ { @@ -2061,20 +2017,6 @@ gboolean editor_show_calltip(GeanyEditor *editor, gint pos) } -gchar *editor_get_calltip_text(GeanyEditor *editor, const TMTag *tag) -{ - GString *str; - - g_return_val_if_fail(editor != NULL, NULL); - - str = g_string_new(NULL); - if (append_calltip(str, tag, editor->document->file_type->id)) - return g_string_free(str, FALSE); - else - return g_string_free(str, TRUE); -} - - /* Current document & global tags autocompletion */ static gboolean autocomplete_tags(GeanyEditor *editor, GeanyFiletype *ft, const gchar *root, gsize rootlen) Modified: src/editor.h 2 lines changed, 0 insertions(+), 2 deletions(-) =================================================================== @@ -325,8 +325,6 @@ void editor_set_indentation_guides(GeanyEditor *editor); void editor_apply_update_prefs(GeanyEditor *editor); -gchar *editor_get_calltip_text(GeanyEditor *editor, const TMTag *tag); - void editor_toggle_fold(GeanyEditor *editor, gint line, gint modifiers); #endif /* GEANY_PRIVATE */ Modified: src/symbols.c 11 lines changed, 3 insertions(+), 8 deletions(-) =================================================================== @@ -946,18 +946,13 @@ static const gchar *get_symbol_name(GeanyDocument *doc, const TMTag *tag, gboole static gchar *get_symbol_tooltip(GeanyDocument *doc, const TMTag *tag) { - gchar *utf8_name = editor_get_calltip_text(doc->editor, tag); + gchar *utf8_name = tm_parser_format_function(tag->lang, tag->name, + tag->arglist, tag->var_type, tag->scope); if (!utf8_name && tag->var_type && tag->type & (tm_tag_field_t | tm_tag_member_t | tm_tag_variable_t | tm_tag_externvar_t)) { - if (tag->lang != TM_PARSER_PASCAL && tag->lang != TM_PARSER_GO) - utf8_name = g_strconcat(tag->var_type, " ", tag->name, NULL); - else - { - const gchar *sep = tag->lang == TM_PARSER_PASCAL ? " : " : " "; - utf8_name = g_strconcat(tag->name, sep, tag->var_type, NULL); - } + utf8_name = tm_parser_format_variable(tag->lang, tag->name, tag->var_type); } /* encodings_convert_to_utf8_from_charset() fails with charset "None", so skip conversion Modified: src/tagmanager/tm_parser.c 70 lines changed, 70 insertions(+), 0 deletions(-) =================================================================== @@ -882,6 +882,76 @@ gboolean tm_parser_enable_kind(TMParserType lang, gchar kind) } +gchar *tm_parser_format_variable(TMParserType lang, const gchar *name, const gchar *type) +{ + if (!type) + return NULL; + + switch (lang) + { + case TM_PARSER_PASCAL: + return g_strconcat(name, " : ", type, NULL); + case TM_PARSER_GO: + return g_strconcat(name, " ", type, NULL); + default: + return g_strconcat(type, " ", name, NULL); + } +} + + +gchar *tm_parser_format_function(TMParserType lang, const gchar *fname, const gchar *args, + const gchar *retval, const gchar *scope) +{ + GString *str; + + if (!args) /* not a function */ + return NULL; + + str = g_string_new(NULL); + + if (scope) + { + g_string_append(str, scope); + g_string_append(str, tm_parser_context_separator(lang)); + } + g_string_append(str, fname); + g_string_append_c(str, ' '); + g_string_append(str, args); + + if (retval) + { + switch (lang) + { + case TM_PARSER_PASCAL: + case TM_PARSER_GO: + { + /* retval after function */ + const gchar *sep; + switch (lang) + { + case TM_PARSER_PASCAL: + sep = " : "; + break; + default: + sep = " "; + break; + } + g_string_append(str, sep); + g_string_append(str, retval); + break; + } + default: + /* retval before function */ + g_string_prepend_c(str, ' '); + g_string_prepend(str, retval); + break; + } + } + + return g_string_free(str, FALSE); +} + + const gchar *tm_parser_context_separator(TMParserType lang) { switch (lang) Modified: src/tagmanager/tm_parser.h 5 lines changed, 5 insertions(+), 0 deletions(-) =================================================================== @@ -130,6 +130,11 @@ gboolean tm_parser_enable_role(TMParserType lang, gchar kind); gboolean tm_parser_enable_kind(TMParserType lang, gchar kind); +gchar *tm_parser_format_variable(TMParserType lang, const gchar *name, const gchar *type); + +gchar *tm_parser_format_function(TMParserType lang, const gchar *fname, const gchar *args, + const gchar *retval, const gchar *scope); + const gchar *tm_parser_context_separator(TMParserType lang); gboolean tm_parser_has_full_context(TMParserType lang); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 424882: Handle calltips of Python constructors like D constructors
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Sun, 09 Jan 2022 22:32:40 UTC Commit: 424882040f890288e98e11e99c2adb8d1bd32a27
https://github.com/geany/geany/commit/424882040f890288e98e11e99c2adb8d1bd32…
Log Message: ----------- Handle calltips of Python constructors like D constructors There were two different ways of how __init__() (or this() in D) constructor calltips were attached to classes so when typing 'MyClass(' the parameters from the constructor were taken: 1. For Python, the arglist of __init__() was attached to the class and when invoking the class, the arglist was shown. The disadvantage of this approach was that it allowed attaching arglist of only one constructor but not multiple ones. 2. For D the query for the calltip was done at the runtime, searching for the constructor inside the corresponding class, allowing multiple constructor tooltips to be shown. Since (2) allows multiple constructors, it is a better approach and can be used for Python too. In addition, this patch creates full scope of the searched constructor so it works also for deeply nested classes. Modified Paths: -------------- src/editor.c src/tagmanager/tm_ctags.c tests/ctags/cython_sample.pyx.tags tests/ctags/py_constructor_arglist.py.tags tests/ctags/simple.py.tags Modified: src/editor.c 17 lines changed, 12 insertions(+), 5 deletions(-) =================================================================== @@ -1850,8 +1850,6 @@ static gint find_start_bracket(ScintillaObject *sci, gint pos) static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) { GPtrArray *tags; - const TMTagType arg_types = tm_tag_function_t | tm_tag_prototype_t | - tm_tag_method_t | tm_tag_macro_with_arg_t; TMTag *tag; GString *str = NULL; guint i; @@ -1868,12 +1866,21 @@ static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) tag = TM_TAG(tags->pdata[0]); - if (ft->id == GEANY_FILETYPES_D && + if ((ft->id == GEANY_FILETYPES_D || ft->id == GEANY_FILETYPES_PYTHON) && (tag->type == tm_tag_class_t || tag->type == tm_tag_struct_t)) { + const TMTagType arg_types = tm_tag_function_t | tm_tag_prototype_t | + tm_tag_method_t | tm_tag_macro_with_arg_t; + const gchar *scope_sep = tm_parser_context_separator(ft->lang); + gchar *scope = EMPTY(tag->scope) ? g_strdup(tag->name) : + g_strjoin(scope_sep, tag->scope, tag->name, NULL); + g_ptr_array_free(tags, TRUE); - /* user typed e.g. 'new Classname(' so lookup D constructor Classname::this() */ - tags = tm_workspace_find("this", tag->name, arg_types, NULL, ft->lang); + /* user typed e.g. 'new Classname(' so lookup D constructor Classname::this() + * same for Python __init__() */ + tags = tm_workspace_find(ft->id == GEANY_FILETYPES_D ? "this" : "__init__", + scope, arg_types, NULL, ft->lang); + g_free(scope); if (tags->len == 0) { g_ptr_array_free(tags, TRUE); Modified: src/tagmanager/tm_ctags.c 33 lines changed, 0 insertions(+), 33 deletions(-) =================================================================== @@ -154,36 +154,6 @@ static gboolean init_tag(TMTag *tag, TMSourceFile *file, const tagEntryInfo *tag } -/* add argument list of __init__() Python methods to the class tag */ -static void update_python_arglist(const TMTag *tag, TMSourceFile *source_file) -{ - guint i; - const gchar *parent_tag_name; - - if (tag->type != tm_tag_method_t || tag->scope == NULL || - g_strcmp0(tag->name, "__init__") != 0) - return; - - parent_tag_name = strrchr(tag->scope, '.'); - if (parent_tag_name) - parent_tag_name++; - else - parent_tag_name = tag->scope; - - /* going in reverse order because the tag was added recently */ - for (i = source_file->tags_array->len; i > 0; i--) - { - TMTag *prev_tag = (TMTag *) source_file->tags_array->pdata[i - 1]; - if (g_strcmp0(prev_tag->name, parent_tag_name) == 0) - { - g_free(prev_tag->arglist); - prev_tag->arglist = g_strdup(tag->arglist); - break; - } - } -} - - static gint write_entry(tagWriter *writer, MIO * mio, const tagEntryInfo *const tag, void *user_data) { TMSourceFile *source_file = user_data; @@ -197,9 +167,6 @@ static gint write_entry(tagWriter *writer, MIO * mio, const tagEntryInfo *const return 0; } - if (tm_tag->lang == TM_PARSER_PYTHON) - update_python_arglist(tm_tag, source_file); - g_ptr_array_add(source_file->tags_array, tm_tag); /* output length - we don't write anything to the MIO */ Modified: tests/ctags/cython_sample.pyx.tags 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -1,5 +1,5 @@ # format=tagmanager -CDefClass�1�(self)�0 +CDefClass�1�0 StdClass�1�0 __init__�128�(self)�CDefClass�0 c_method�128�(self,int i)�CDefClass�0 Modified: tests/ctags/py_constructor_arglist.py.tags 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -3,7 +3,7 @@ HttpResponse HttpResponseBadRequest�32768�0 InterfaceDataValidationError�32768�0 RequestContext�32768�0 -SomeClass�1�(self, filename, pathsep='', treegap=64)�0 +SomeClass�1�0 __init__�128�(self, filename, pathsep='', treegap=64)�SomeClass�0 btopen�32768�0 csrf_exempt�32768�0 Modified: tests/ctags/simple.py.tags 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -14,7 +14,7 @@ even_more foo�16�(�0 ignored_function�16�()�_test�0 more_nesting�16�()�_test.ignored_function�0 -one�1�(self, filename, pathsep='', treegap=64)�0 +one�1�0 only�128�(arg)�two�0 public_function�128�(self, key)�one�0 so_is_this�1�one�0 -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] b814cf: Move language-specific part of constructor calltip lookup to tm_parser
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Sun, 09 Jan 2022 22:32:40 UTC Commit: b814cf666bc9f7c769839417eed267aa56bf6518
https://github.com/geany/geany/commit/b814cf666bc9f7c769839417eed267aa56bf6…
Log Message: ----------- Move language-specific part of constructor calltip lookup to tm_parser Modified Paths: -------------- src/editor.c src/tagmanager/tm_parser.c src/tagmanager/tm_parser.h Modified: src/editor.c 11 lines changed, 5 insertions(+), 6 deletions(-) =================================================================== @@ -1849,6 +1849,7 @@ static gint find_start_bracket(ScintillaObject *sci, gint pos) static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) { + const gchar *constructor_method; GPtrArray *tags; TMTag *tag; GString *str = NULL; @@ -1866,8 +1867,9 @@ static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) tag = TM_TAG(tags->pdata[0]); - if ((ft->id == GEANY_FILETYPES_D || ft->id == GEANY_FILETYPES_PYTHON) && - (tag->type == tm_tag_class_t || tag->type == tm_tag_struct_t)) + /* user typed e.g. 'a = Classname(' in Python so lookup __init__() arguments */ + constructor_method = tm_parser_get_constructor_method(tag->lang); + if (constructor_method && (tag->type == tm_tag_class_t || tag->type == tm_tag_struct_t)) { const TMTagType arg_types = tm_tag_function_t | tm_tag_prototype_t | tm_tag_method_t | tm_tag_macro_with_arg_t; @@ -1876,10 +1878,7 @@ static gchar *find_calltip(const gchar *word, GeanyFiletype *ft) g_strjoin(scope_sep, tag->scope, tag->name, NULL); g_ptr_array_free(tags, TRUE); - /* user typed e.g. 'new Classname(' so lookup D constructor Classname::this() - * same for Python __init__() */ - tags = tm_workspace_find(ft->id == GEANY_FILETYPES_D ? "this" : "__init__", - scope, arg_types, NULL, ft->lang); + tags = tm_workspace_find(constructor_method, scope, arg_types, NULL, ft->lang); g_free(scope); if (tags->len == 0) { Modified: src/tagmanager/tm_parser.c 17 lines changed, 17 insertions(+), 0 deletions(-) =================================================================== @@ -818,6 +818,23 @@ void tm_parser_verify_type_mappings(void) } +/* Get the name of constructor method. Arguments of this method will be used + * for calltips when creating an object using the class name + * (e.g. after the opening brace in 'c = MyClass()' in Python) */ +const gchar *tm_parser_get_constructor_method(TMParserType lang) +{ + switch (lang) + { + case TM_PARSER_D: + return "this"; + case TM_PARSER_PYTHON: + return "__init__"; + default: + return NULL; + } +} + + static gchar *replace_string_if_present(gchar *haystack, gchar *needle, gchar *subst) { if (strstr(haystack, needle)) Modified: src/tagmanager/tm_parser.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -124,6 +124,8 @@ gchar tm_parser_get_tag_kind(TMTagType type, TMParserType lang); TMTagType tm_parser_get_subparser_type(TMParserType lang, TMParserType sublang, TMTagType type); +const gchar *tm_parser_get_constructor_method(TMParserType lang); + gchar *tm_parser_update_scope(TMParserType lang, gchar *scope); gboolean tm_parser_enable_role(TMParserType lang, gchar kind); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 4980a0: Move language-specific parts of whether to trigger scope autocompletion to tm_parser
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Sun, 09 Jan 2022 22:32:40 UTC Commit: 4980a03d50e975f9c64538e8fc8beefd5ea2f8ef
https://github.com/geany/geany/commit/4980a03d50e975f9c64538e8fc8beefd5ea2f…
Log Message: ----------- Move language-specific parts of whether to trigger scope autocompletion to tm_parser Modified Paths: -------------- src/editor.c src/tagmanager/tm_parser.c src/tagmanager/tm_parser.h Modified: src/editor.c 47 lines changed, 20 insertions(+), 27 deletions(-) =================================================================== @@ -642,20 +642,23 @@ static void show_tags_list(GeanyEditor *editor, const GPtrArray *tags, gsize roo } -/* do not use with long strings */ -static gboolean match_last_chars(ScintillaObject *sci, gint pos, const gchar *str) +static gint scope_autocomplete_suffix(ScintillaObject *sci, TMParserType lang, + gint pos, gboolean *scope_sep) { - gsize len = strlen(str); + const gchar *sep = tm_parser_context_separator(lang); + const gsize max_len = 3; + gboolean is_scope_sep; gchar *buf; - g_return_val_if_fail(len < 100, FALSE); + buf = g_alloca(max_len + 1); + sci_get_text_range(sci, pos - max_len, pos, buf); - if ((gint)len > pos) - return FALSE; - - buf = g_alloca(len + 1); - sci_get_text_range(sci, pos - len, pos, buf); - return strcmp(str, buf) == 0; + is_scope_sep = g_str_has_suffix(buf, sep); + if (scope_sep) + *scope_sep = is_scope_sep; + if (is_scope_sep) + return strlen(sep); + return tm_parser_scope_autocomplete_suffix(lang, buf); } @@ -706,6 +709,7 @@ static gboolean autocomplete_scope(GeanyEditor *editor, const gchar *root, gsize gboolean ret = FALSE; const gchar *current_scope; const gchar *context_sep = tm_parser_context_separator(ft->lang); + gint autocomplete_suffix_len; if (autocomplete_scope_shown) { @@ -720,22 +724,13 @@ static gboolean autocomplete_scope(GeanyEditor *editor, const gchar *root, gsize typed = sci_get_char_at(sci, pos - 1); } - /* make sure to keep in sync with similar checks below */ - if (match_last_chars(sci, pos, context_sep)) - { - pos -= strlen(context_sep); - scope_sep_typed = TRUE; - } - else if (typed == '.') - pos -= 1; - else if ((ft->id == GEANY_FILETYPES_C || ft->id == GEANY_FILETYPES_CPP) && - match_last_chars(sci, pos, "->")) - pos -= 2; - else if (ft->id == GEANY_FILETYPES_CPP && match_last_chars(sci, pos, "->*")) - pos -= 3; - else + autocomplete_suffix_len = scope_autocomplete_suffix(sci, ft->lang, pos, + &scope_sep_typed); + if (autocomplete_suffix_len == 0) return FALSE; + pos -= autocomplete_suffix_len; + /* allow for a space between word and operator */ while (pos > 0 && isspace(sci_get_char_at(sci, pos - 1))) pos--; @@ -765,9 +760,7 @@ static gboolean autocomplete_scope(GeanyEditor *editor, const gchar *root, gsize pos -= strlen(name); while (pos > 0 && isspace(sci_get_char_at(sci, pos - 1))) pos--; - /* make sure to keep in sync with similar checks above */ - member = match_last_chars(sci, pos, ".") || match_last_chars(sci, pos, context_sep) || - match_last_chars(sci, pos, "->") || match_last_chars(sci, pos, "->*"); + member = scope_autocomplete_suffix(sci, ft->lang, pos, NULL) > 0; if (symbols_get_current_scope(editor->document, ¤t_scope) == -1) current_scope = ""; Modified: src/tagmanager/tm_parser.c 27 lines changed, 27 insertions(+), 0 deletions(-) =================================================================== @@ -818,6 +818,33 @@ void tm_parser_verify_type_mappings(void) } +/* When the suffix of 'str' is an operator that should trigger scope + * autocompletion, this function should return the length of the operator, + * zero otherwise. */ +gint tm_parser_scope_autocomplete_suffix(TMParserType lang, const gchar *str) +{ + const gchar *sep = tm_parser_context_separator(lang); + + if (g_str_has_suffix(str, sep)) + return strlen(sep); + + switch (lang) + { + case TM_PARSER_C: + case TM_PARSER_CPP: + if (g_str_has_suffix(str, ".")) + return 1; + else if (g_str_has_suffix(str, "->")) + return 2; + else if (lang == TM_PARSER_CPP && g_str_has_suffix(str, "->*")) + return 3; + default: + break; + } + return 0; +} + + /* Get the name of constructor method. Arguments of this method will be used * for calltips when creating an object using the class name * (e.g. after the opening brace in 'c = MyClass()' in Python) */ Modified: src/tagmanager/tm_parser.h 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -124,6 +124,8 @@ gchar tm_parser_get_tag_kind(TMTagType type, TMParserType lang); TMTagType tm_parser_get_subparser_type(TMParserType lang, TMParserType sublang, TMTagType type); +gint tm_parser_scope_autocomplete_suffix(TMParserType lang, const gchar *str); + const gchar *tm_parser_get_constructor_method(TMParserType lang); gchar *tm_parser_update_scope(TMParserType lang, gchar *scope); -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] 7340a8: Remove invalid python-specific code
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Sun, 09 Jan 2022 22:32:40 UTC Commit: 7340a8786b6e60d205ee2df0cff606c30273f334
https://github.com/geany/geany/commit/7340a8786b6e60d205ee2df0cff606c30273f…
Log Message: ----------- Remove invalid python-specific code The code in the comment maybe used to be true some time ago but now no kind maps to namespace for Python. Modified Paths: -------------- src/symbols.c Modified: src/symbols.c 6 lines changed, 1 insertions(+), 5 deletions(-) =================================================================== @@ -2511,11 +2511,7 @@ gint symbols_get_current_function(GeanyDocument *doc, const gchar **tagname) gint symbols_get_current_scope(GeanyDocument *doc, const gchar **tagname) { TMTagType tag_types = (tm_tag_function_t | tm_tag_method_t | tm_tag_class_t | - tm_tag_struct_t | tm_tag_enum_t | tm_tag_union_t); - - /* Python parser reports imports as namespaces which confuses the scope detection */ - if (doc && doc->file_type->lang != filetypes[GEANY_FILETYPES_PYTHON]->lang) - tag_types |= tm_tag_namespace_t; + tm_tag_struct_t | tm_tag_enum_t | tm_tag_union_t | tm_tag_namespace_t); return get_current_tag_name_cached(doc, tagname, tag_types); } -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany] efbfe7: Display python type annotations correctly formatted
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Enrico Tröger <enrico.troeger(a)uvena.de> Date: Sun, 09 Jan 2022 22:32:40 UTC Commit: efbfe7dea7929a53415da0d20412f605a0354c82
https://github.com/geany/geany/commit/efbfe7dea7929a53415da0d20412f605a0354…
Log Message: ----------- Display python type annotations correctly formatted Modified Paths: -------------- src/tagmanager/tm_parser.c Modified: src/tagmanager/tm_parser.c 13 lines changed, 9 insertions(+), 4 deletions(-) =================================================================== @@ -933,10 +933,11 @@ gchar *tm_parser_format_variable(TMParserType lang, const gchar *name, const gch switch (lang) { - case TM_PARSER_PASCAL: - return g_strconcat(name, " : ", type, NULL); case TM_PARSER_GO: return g_strconcat(name, " ", type, NULL); + case TM_PARSER_PASCAL: + case TM_PARSER_PYTHON: + return g_strconcat(name, ": ", type, NULL); default: return g_strconcat(type, " ", name, NULL); } @@ -966,15 +967,19 @@ gchar *tm_parser_format_function(TMParserType lang, const gchar *fname, const gc { switch (lang) { - case TM_PARSER_PASCAL: case TM_PARSER_GO: + case TM_PARSER_PASCAL: + case TM_PARSER_PYTHON: { /* retval after function */ const gchar *sep; switch (lang) { case TM_PARSER_PASCAL: - sep = " : "; + sep = ": "; + break; + case TM_PARSER_PYTHON: + sep = " -> "; break; default: sep = " "; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] 126e01: Improve appearance of file open dialogs
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sun, 09 Jan 2022 21:17:42 UTC Commit: 126e017c02b2f1d1c8a2dc93bbcd6a26f843a717
https://github.com/geany/geany-osx/commit/126e017c02b2f1d1c8a2dc93bbcd6a26f…
Log Message: ----------- Improve appearance of file open dialogs Modified Paths: -------------- Prof-Gnome/gtk-3.0/main-dark.css Prof-Gnome/gtk-3.0/main-light.css Modified: Prof-Gnome/gtk-3.0/main-dark.css 40 lines changed, 0 insertions(+), 40 deletions(-) =================================================================== @@ -666,37 +666,6 @@ button:disabled box-shadow: none; } -filechooser actionbar entry, -filechooser actionbar button, -headerbar entry, -headerbar button -{ - border: 1px solid; - color: @headerbar_text_color; - - border-color: shade((a)headerbar_button_color,0.9); -border-bottom-color: shade((a)headerbar_button_color,0.8); - - box-shadow: inset 0 1px shade((a)headerbar_button_color,1.3), - 0 1px 2px rgba(0, 0, 0, 0.07); - background-image: linear-gradient(to top, shade((a)headerbar_button_color,1.05), - shade((a)headerbar_button_color,1.2)); -} -filechooser actionbar entry:hover, -filechooser actionbar button:hover, -headerbar button:hover -{ - color: @headerbar_text_color; - - border-color: shade((a)headerbar_button_color,0.9); -border-bottom-color: shade((a)headerbar_button_color,0.8); - - box-shadow: inset 0 1px shade((a)headerbar_button_color,1.3), - 0 1px 2px rgba(0, 0, 0, 0.07); - background-image: linear-gradient(to top, shade((a)headerbar_button_color,1.15), - shade((a)headerbar_button_color,1.3)); - -gtk-icon-effect: highlight; -} headerbar button:checked { color: @headerbar_text_color; @@ -6612,15 +6581,6 @@ window.background.csd > box.vertical > scrolledwindow > iconview.view.content-vi filechooser placessidebar.sidebar { background-color:shade(@sidebar_bg_color,1); - background-image: linear-gradient(to top, transparent, - alpha((a)shadows_dark,0.03), - alpha((a)shadows_dark,0.06), - alpha((a)shadows_dark,0.08), - alpha((a)shadows_dark,0.08), - alpha((a)shadows_dark,0.08), - alpha((a)shadows_dark,0.06), - alpha((a)shadows_dark,0.03), - transparent); border-radius: 0; } .nautilus-window placessidebar.sidebar Modified: Prof-Gnome/gtk-3.0/main-light.css 36 lines changed, 0 insertions(+), 36 deletions(-) =================================================================== @@ -664,37 +664,6 @@ button:disabled box-shadow: none; } -filechooser actionbar entry, -filechooser actionbar button, -headerbar entry, -headerbar button -{ - border: 1px solid; - color: @headerbar_text_color; - - border-color: shade((a)headerbar_color,0.9); -border-bottom-color: shade((a)headerbar_color,0.8); - - box-shadow: inset 0 1px shade((a)headerbar_color,1.3), - 0 1px 2px rgba(0, 0, 0, 0.07); - background-image: linear-gradient(to top, shade((a)headerbar_color,1.05), - shade((a)headerbar_color,1.2)); -} -filechooser actionbar entry:hover, -filechooser actionbar button:hover, -headerbar button:hover -{ - color: @headerbar_text_color; - - border-color: shade((a)headerbar_color,0.9); -border-bottom-color: shade((a)headerbar_color,0.8); - - box-shadow: inset 0 1px shade((a)headerbar_color,1.3), - 0 1px 2px rgba(0, 0, 0, 0.07); - background-image: linear-gradient(to top, shade((a)headerbar_color,1.15), - shade((a)headerbar_color,1.3)); - -gtk-icon-effect: highlight; -} headerbar button:checked { color: @headerbar_text_color; @@ -6594,11 +6563,6 @@ window.background.csd > box.vertical > scrolledwindow > iconview.view.content-vi } filechooser placessidebar.sidebar { - background-image: linear-gradient(to top, transparent, - alpha((a)text_color,0.1), - alpha((a)text_color,0.2), - alpha((a)text_color,0.1), - transparent); background-color: @sidebar_bg_color; border-radius: 0; -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
[geany/geany-osx] f5a400: Reduce menu spacing
by Jiří Techet
09 Jan '22
09 Jan '22
Branch: refs/heads/master Author: Jiří Techet <techet(a)gmail.com> Committer: Jiří Techet <techet(a)gmail.com> Date: Sun, 09 Jan 2022 21:07:09 UTC Commit: f5a4004cae9be1be03092249a0aca305c9bee688
https://github.com/geany/geany-osx/commit/f5a4004cae9be1be03092249a0aca305c…
Log Message: ----------- Reduce menu spacing Modified Paths: -------------- Prof-Gnome/gtk-3.0/main-dark.css Prof-Gnome/gtk-3.0/main-light.css Modified: Prof-Gnome/gtk-3.0/main-dark.css 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2789,7 +2789,7 @@ menubar > menuitem, color: @headerbar_text_color; min-height: 16px; - padding: 3px 12px; + padding: 3px 8px; } menubar > menuitem:hover, .menubar > menuitem:hover Modified: Prof-Gnome/gtk-3.0/main-light.css 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -2785,7 +2785,7 @@ menubar > menuitem, color: @headerbar_text_color; min-height: 16px; - padding: 3px 12px; + padding: 3px 8px; } menubar > menuitem:hover, .menubar > menuitem:hover -------------- This E-Mail was brought to you by github_commit_mail.py (Source:
https://github.com/geany/infrastructure
).
1
0
0
0
← Newer
1
2
3
4
5
6
7
Older →
Jump to page:
1
2
3
4
5
6
7
Results per page:
10
25
50
100
200