Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Mon, 27 Feb 2017 17:09:59 UTC
Commit: b7900b3f05d37818a1cd38f2c83e2c17e22c47ee
https://github.com/geany/geany/commit/b7900b3f05d37818a1cd38f2c83e2c17e22c4…
Log Message:
-----------
Merge pull request #1399 from techee/osx_start
Avoid gdk_display_get_name() on OS X
Modified Paths:
--------------
src/socket.c
Modified: src/socket.c
7 lines changed, 7 insertions(+), 0 deletions(-)
===================================================================
@@ -284,8 +284,15 @@ gint socket_init(gint argc, gchar **argv)
GdkDisplay *display = gdk_display_get_default();
gchar *p;
+ /* On OS X with quartz backend gdk_display_get_name() returns hostname
+ * using [NSHost currentHost] (it could return more or less whatever string
+ * as display name is a X11 specific thing). This call can lead to network
+ * query and block for several seconds so better skip it. */
+#ifndef GDK_WINDOWING_QUARTZ
if (display != NULL)
display_name = g_strdup(gdk_display_get_name(display));
+#endif
+
if (display_name == NULL)
display_name = g_strdup("NODISPLAY");
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Mon, 27 Feb 2017 13:16:20 UTC
Commit: 6d0062201ee2701acceed9af0227c61e9777037d
https://github.com/geany/geany/commit/6d0062201ee2701acceed9af0227c61e97770…
Log Message:
-----------
Scintilla: speed up converting byte offsets to character offsets
Use a per-line cache to avoid re-computing the offset from the start of
the buffer each time. This dramatically speeds up multiple replacements
on large files.
X-Scintilla-Bug-ID: https://sourceforge.net/p/scintilla/bugs/1910/
Modified Paths:
--------------
scintilla/gtk/ScintillaGTKAccessible.cxx
scintilla/gtk/ScintillaGTKAccessible.h
Modified: scintilla/gtk/ScintillaGTKAccessible.cxx
7 lines changed, 7 insertions(+), 0 deletions(-)
===================================================================
@@ -856,6 +856,13 @@ void ScintillaGTKAccessible::NotifyReadOnly() {
void ScintillaGTKAccessible::Notify(GtkWidget *, gint, SCNotification *nt) {
switch (nt->nmhdr.code) {
case SCN_MODIFIED: {
+ if (nt->modificationType & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT)) {
+ // invalidate character offset cache if applicable
+ const Position line = sci->pdoc->LineFromPosition(nt->position);
+ if (character_offsets.size() > static_cast<size_t>(line + 1)) {
+ character_offsets.resize(line + 1);
+ }
+ }
if (nt->modificationType & SC_MOD_INSERTTEXT) {
int startChar = CharacterOffsetFromByteOffset(nt->position);
int lengthChar = sci->pdoc->CountCharacters(nt->position, nt->position + nt->length);
Modified: scintilla/gtk/ScintillaGTKAccessible.h
16 lines changed, 15 insertions(+), 1 deletions(-)
===================================================================
@@ -20,6 +20,9 @@ class ScintillaGTKAccessible {
GtkAccessible *accessible;
ScintillaGTK *sci;
+ // cache holding character offset for each line start, see CharacterOffsetFromByteOffset()
+ std::vector<Position> character_offsets;
+
// cached length of the deletion, in characters (see Notify())
int deletionLengthChar;
// local state for comparing
@@ -52,7 +55,18 @@ class ScintillaGTKAccessible {
}
int CharacterOffsetFromByteOffset(Position byteOffset) {
- return sci->pdoc->CountCharacters(0, byteOffset);
+ const Position line = sci->pdoc->LineFromPosition(byteOffset);
+ if (character_offsets.size() <= static_cast<size_t>(line)) {
+ if (character_offsets.empty())
+ character_offsets.push_back(0);
+ for (Position i = character_offsets.size(); i <= line; i++) {
+ const Position start = sci->pdoc->LineStart(i - 1);
+ const Position end = sci->pdoc->LineStart(i);
+ character_offsets.push_back(character_offsets[i - 1] + sci->pdoc->CountCharacters(start, end));
+ }
+ }
+ const Position lineStart = sci->pdoc->LineStart(line);
+ return character_offsets[line] + sci->pdoc->CountCharacters(lineStart, byteOffset);
}
void CharacterRangeFromByteRange(Position startByte, Position endByte, int *startChar, int *endChar) {
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Colomban Wendling <ban(a)herbesfolles.org>
Committer: Colomban Wendling <ban(a)herbesfolles.org>
Date: Sun, 26 Feb 2017 19:07:33 UTC
Commit: 1421a3f9c59a41074636a26cca6b431c3af40226
https://github.com/geany/geany/commit/1421a3f9c59a41074636a26cca6b431c3af40…
Log Message:
-----------
scintilla: Fix crash after destroying the widget on GTK < 3.3.6
On GTK2 and GTK3 < 3.3.6 there is no GtkAccessibleClass::widget_unset()
method, so we can't destroy our accessible object right away. So, to
avoid accessing a destroyed widget, we need to check whether the widget
still exists in the the ScintillaGTKAccessible destructor.
In other methods it's not necessary because the wrapping GObject class
makes sure not to forward other when the widget has been destroyed, but
we still have to destroy the C++ instance no matter what, so the check
has to be on this side.
Fixes #1410.
Modified Paths:
--------------
scintilla/gtk/ScintillaGTKAccessible.cxx
Modified: scintilla/gtk/ScintillaGTKAccessible.cxx
4 lines changed, 3 insertions(+), 1 deletions(-)
===================================================================
@@ -162,7 +162,9 @@ ScintillaGTKAccessible::ScintillaGTKAccessible(GtkAccessible *accessible_, GtkWi
}
ScintillaGTKAccessible::~ScintillaGTKAccessible() {
- g_signal_handlers_disconnect_matched(sci->sci, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this);
+ if (gtk_accessible_get_widget(accessible)) {
+ g_signal_handlers_disconnect_matched(sci->sci, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this);
+ }
}
gchar *ScintillaGTKAccessible::GetTextRangeUTF8(Position startByte, Position endByte) {
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Frank Lanitz <frank(a)frank.uvena.de>
Committer: Frank Lanitz <frank(a)frank.uvena.de>
Date: Sun, 26 Feb 2017 11:04:33 UTC
Commit: f4c3363c6943e77cb47c724156ae56fe06881a87
https://github.com/geany/geany/commit/f4c3363c6943e77cb47c724156ae56fe06881…
Log Message:
-----------
Update of Portuguese translation
Modified Paths:
--------------
po/pt.po
Modified: po/pt.po
7 lines changed, 3 insertions(+), 4 deletions(-)
===================================================================
@@ -4,14 +4,14 @@
# This file is distributed under the same license as the geany package.
#
# André Glória <gloria_dot_andre_at_gmail_dot_com> 2009 - 2014
-# Pedro Albuquerque <palbuquerque73(a)gmail.com>, 2015, 2016.
+# Pedro Albuquerque <palbuquerque73(a)gmail.com>, 2015, 2016, 2017.
#
msgid ""
msgstr ""
"Project-Id-Version: Geany 1.30\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-19 19:13+0100\n"
-"PO-Revision-Date: 2016-10-30 15:41+0000\n"
+"PO-Revision-Date: 2017-02-23 09:16+0000\n"
"Last-Translator: Pedro Albuquerque <palbuquerque73(a)gmail.com>\n"
"Language-Team: Português <>\n"
"Language: pt\n"
@@ -1228,9 +1228,8 @@ msgid "Strip trailing spaces and tabs"
msgstr "Remover espaços e tabulações finais"
#: ../data/geany.glade.h:250
-#, fuzzy
msgid "Removes trailing spaces and tabs at the end of lines"
-msgstr "Remove finais de linha e espaços e tabulações finais"
+msgstr "Remove espaços e tabulações nos finais de linha"
#: ../data/geany.glade.h:251 ../src/keybindings.c:666
msgid "Replace tabs with space"
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Thomas Martitz <kugel(a)rockbox.org>
Committer: Thomas Martitz <kugel(a)rockbox.org>
Date: Fri, 24 Feb 2017 15:24:16 UTC
Commit: 7b091809db5d03d6373e39183bd796a8b485e709
https://github.com/geany/geany/commit/7b091809db5d03d6373e39183bd796a8b485e…
Log Message:
-----------
api: new function geany_api_version
This allows plugins to detect the API version of Geany at runtime. This enables
soft dependencies based on Geany's API version, perhaps using a new feature
with a fallback for older API versions. Previously the only alternatives
were hard-depending on a more recent Geany version or ignoring new features.
Modified Paths:
--------------
src/plugindata.h
src/pluginutils.c
src/pluginutils.h
Modified: src/plugindata.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -59,7 +59,7 @@ G_BEGIN_DECLS
* @warning You should not test for values below 200 as previously
* @c GEANY_API_VERSION was defined as an enum value, not a macro.
*/
-#define GEANY_API_VERSION 230
+#define GEANY_API_VERSION 231
/* hack to have a different ABI when built with GTK3 because loading GTK2-linked plugins
* with GTK3-linked Geany leads to crash */
Modified: src/pluginutils.c
16 lines changed, 16 insertions(+), 0 deletions(-)
===================================================================
@@ -52,6 +52,22 @@ typedef struct
PluginDocDataProxy;
+/** Returns the runtime API version Geany was compiled with.
+ *
+ * Unlike @ref GEANY_API_VERSION this version is the value of that
+ * define at the time when Geany itself was compiled. This allows to
+ * establish soft dependencies which are resolved at runtime depending
+ * on Geany's API version.
+ *
+ * @return Geany's API version
+ * @since 1.30 (API 231)
+ **/
+GEANY_API_SYMBOL
+gint geany_api_version(void)
+{
+ return GEANY_API_VERSION;
+}
+
/** Inserts a toolbar item before the Quit button, or after the previous plugin toolbar item.
* A separator is added on the first call to this function, and will be shown when @a item is
* shown; hidden when @a item is hidden.
Modified: src/pluginutils.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -35,6 +35,7 @@ G_BEGIN_DECLS
struct GeanyPlugin;
struct GeanyDocument;
+gint geany_api_version(void);
void plugin_add_toolbar_item(struct GeanyPlugin *plugin, GtkToolItem *item);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).