Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Tue, 17 May 2016 20:58:47 UTC
Commit: 9356514e457c34da3169b6531862b538e1a961bb
https://github.com/geany/geany/commit/9356514e457c34da3169b6531862b538e1a96…
Log Message:
-----------
Perform typename re-colourisation only when typename list changes
To detect the change of typename list since the last time the colourisation
happened, we could store the complete typename string used during the
last colourization and compare it with the current string. For lots of
typenames this might be quite a huge string stored for every opened tab
(well, it's also stored in Scintilla already for every document but better
not to have it twice). Instead, we can store an uint hash of the string.
We could also use a better hash function with longer hash value but
uint size should be enough for this case (and in the case of a collision
nothing terrible happens).
Modified Paths:
--------------
src/document.c
src/documentprivate.h
Modified: src/document.c
11 lines changed, 9 insertions(+), 2 deletions(-)
===================================================================
@@ -2750,10 +2750,17 @@ void document_highlight_tags(GeanyDocument *doc)
keywords_str = symbols_find_typenames_as_string(doc->file_type->lang, FALSE);
if (keywords_str)
{
+ guint hash;
+
keywords = g_string_free(keywords_str, FALSE);
- sci_set_keywords(doc->editor->sci, keyword_idx, keywords);
+ hash = g_str_hash(keywords);
+ if (hash != doc->priv->keyword_hash)
+ {
+ sci_set_keywords(doc->editor->sci, keyword_idx, keywords);
+ queue_colourise(doc); /* force re-highlighting the entire document */
+ doc->priv->keyword_hash = hash;
+ }
g_free(keywords);
- queue_colourise(doc); /* force re-highlighting the entire document */
}
}
Modified: src/documentprivate.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -90,6 +90,7 @@ typedef struct GeanyDocumentPrivate
/* Used so Undo/Redo works for encoding changes. */
FileEncoding saved_encoding;
gboolean colourise_needed; /* use document.c:queue_colourise() instead */
+ guint keyword_hash; /* hash of keyword string used for typename colourisation */
gint line_count; /* Number of lines in the document. */
gint symbol_list_sort_mode;
/* indicates whether a file is on a remote filesystem, works only with GIO/GVfs */
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Tue, 17 May 2016 20:09:48 UTC
Commit: 9313b17559f4ea60acae95db96523dbd02c80e35
https://github.com/geany/geany/commit/9313b17559f4ea60acae95db96523dbd02c80…
Log Message:
-----------
Don't accumulate multiple colourises
I don't know if this ever happens but the check shouldn't hurt.
Modified Paths:
--------------
src/document.c
Modified: src/document.c
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -512,6 +512,9 @@ static gint document_get_new_idx(void)
static void queue_colourise(GeanyDocument *doc)
{
+ if (doc->priv->colourise_needed)
+ return;
+
/* Colourise the editor before it is next drawn */
doc->priv->colourise_needed = TRUE;
--------------
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: Tue, 17 May 2016 00:45:03 UTC
Commit: d7750a44796b0ddc1c7a8968fd53aad91382d686
https://github.com/geany/geany/commit/d7750a44796b0ddc1c7a8968fd53aad91382d…
Log Message:
-----------
Fix canceling keybinding overriding by discarding the dialog
Properly handle discarding the dialog asking whether to override a
keybinding as canceling it rather than as allowing multiple identical
keybindings.
In the way, simplify and fix dialogs_show_prompt() not to perform odd
and useless response mapping that effectively go round back, and that
don't handle what the comment above it suggests. Simply document it
can return GTK_RESPONSE_DELETE_EVENT and handle it in the caller side,
as it's a possibly valuable information. Only one current caller is
affected, and it doesn't change anything as it doesn't change behavior
but only documents it.
Closes #714.
Modified Paths:
--------------
src/dialogs.c
src/prefs.c
Modified: src/dialogs.c
8 lines changed, 2 insertions(+), 6 deletions(-)
===================================================================
@@ -1291,7 +1291,7 @@ void dialogs_show_file_properties(GeanyDocument *doc)
/* extra_text can be NULL; otherwise it is displayed below main_text.
* if parent is NULL, main_widgets.window will be used
* btn_1, btn_2, btn_3 can be NULL.
- * returns response_1, response_2 or response_3 */
+ * returns response_1, response_2, response_3, or GTK_RESPONSE_DELETE_EVENT if the dialog was discarded */
static gint show_prompt(GtkWidget *parent,
const gchar *btn_1, GtkResponseType response_1,
const gchar *btn_2, GtkResponseType response_2,
@@ -1345,18 +1345,14 @@ static gint show_prompt(GtkWidget *parent,
if (btn_1 != NULL)
gtk_dialog_add_button(GTK_DIALOG(dialog), btn_1, response_1);
- /* For a cancel button, use cancel response so user can press escape to cancel */
- btn = gtk_dialog_add_button(GTK_DIALOG(dialog), btn_2,
- utils_str_equal(btn_2, GTK_STOCK_CANCEL) ? GTK_RESPONSE_CANCEL : response_2);
+ btn = gtk_dialog_add_button(GTK_DIALOG(dialog), btn_2, response_2);
/* we don't want a default, but we need to override the apply button as default */
gtk_widget_grab_default(btn);
gtk_dialog_add_button(GTK_DIALOG(dialog), btn_3, response_3);
ret = gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy(dialog);
- if (ret == GTK_RESPONSE_CANCEL)
- ret = response_2;
return ret;
}
Modified: src/prefs.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -1497,7 +1497,7 @@ static gboolean kb_find_duplicate(GtkTreeStore *store, GtkWidget *parent, GtkTre
/* carry on looking for other duplicates if overriding */
continue;
}
- return ret == GTK_RESPONSE_NO;
+ return ret != GTK_RESPONSE_APPLY;
}
}
while (gtk_tree_model_iter_next(model, &iter));
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
Branch: refs/heads/master
Author: elextr <elextr(a)gmail.com>
Committer: elextr <elextr(a)gmail.com>
Date: Sat, 14 May 2016 09:36:24 UTC
Commit: b81f41ce3288dc3c83612ce71e4aef11d1639557
https://github.com/geany/geany/commit/b81f41ce3288dc3c83612ce71e4aef11d1639…
Log Message:
-----------
Merge pull request #1024 from Yanpas/java-review
Reviewed java keywords
Modified Paths:
--------------
data/filedefs/filetypes.java
Modified: data/filedefs/filetypes.java
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -2,7 +2,7 @@
[styling=C]
[keywords]
-primary=abstract assert break case catch class const continue default do else enum extends final finally for future generic goto if implements import inner instanceof interface native new outer package private protected public rest return static strictfp super switch synchronized this throw throws transient try var volatile while true false null
+primary=abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while true false null
secondary=boolean byte char double float int long short void
# documentation keywords for javadoc
doccomment=author deprecated exception param return see serial serialData serialField since throws todo version
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).