Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Thu, 28 May 2015 19:21:54 UTC
Commit: 8eaaf723b8c1fff2c752d7ae31d19e42ef023018
https://github.com/geany/geany/commit/8eaaf723b8c1fff2c752d7ae31d19e42ef023…
Log Message:
-----------
Don't resize message window when changing Geany's window height
At the moment the message window is set to resize when the height of the
main window changes. This is a bit annoying when the message window size
is set to fit all the tabs exactly and when shrinking the window, the
tabs don't fit the shrinked message window.
Set the flag not to resize the notebook_info notebook (similar thing is
already done with the sidebar in the horizontal direction so no change
needed there).
Works fine also when the message window is set to be on the right side.
Modified Paths:
--------------
data/geany.glade
Modified: data/geany.glade
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -8327,7 +8327,7 @@
</child>
</object>
<packing>
- <property name="resize">True</property>
+ <property name="resize">False</property>
<property name="shrink">True</property>
</packing>
</child>
--------------
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, 15 Jun 2015 12:56:07 UTC
Commit: 6f60de3656b48b954da5d2b3dd1dc46c96844025
https://github.com/geany/geany/commit/6f60de3656b48b954da5d2b3dd1dc46c96844…
Log Message:
-----------
Merge pull request #514 from techee/linear_tag_remove
Add linear tag remove path for cases where not many files are open
Modified Paths:
--------------
tagmanager/src/tm_tag.c
Modified: tagmanager/src/tm_tag.c
74 lines changed, 50 insertions(+), 24 deletions(-)
===================================================================
@@ -828,37 +828,63 @@ gboolean tm_tags_sort(GPtrArray *tags_array, TMTagAttrType *sort_attributes,
void tm_tags_remove_file_tags(TMSourceFile *source_file, GPtrArray *tags_array)
{
guint i;
- GPtrArray *to_delete = g_ptr_array_sized_new(source_file->tags_array->len);
-
- for (i = 0; i < source_file->tags_array->len; i++)
+
+ /* Now we choose between an algorithm with complexity O(tags_array->len) and
+ * O(source_file->tags_array->len * log(tags_array->len)). The latter algorithm
+ * is better when tags_array contains many times more tags than
+ * source_file->tags_array so instead of trying to find the removed tags
+ * linearly, binary search is used. The constant 20 is more or less random
+ * but seems to work well. It's exact value isn't so critical because it's
+ * the extremes where the difference is the biggest: when
+ * source_file->tags_array->len == tags_array->len (single file open) and
+ * source_file->tags_array->len << tags_array->len (the number of tags
+ * from the file is a small fraction of all tags).
+ */
+ if (source_file->tags_array->len != 0 &&
+ tags_array->len / source_file->tags_array->len < 20)
{
- guint j;
- guint tag_count;
- TMTag **found;
- TMTag *tag = source_file->tags_array->pdata[i];
-
- found = tm_tags_find(tags_array, tag->name, FALSE, TRUE, &tag_count);
-
- for (j = 0; j < tag_count; j++)
+ for (i = 0; i < tags_array->len; i++)
{
- if (*found != NULL && (*found)->file == source_file)
+ TMTag *tag = tags_array->pdata[i];
+
+ if (tag->file == source_file)
+ tags_array->pdata[i] = NULL;
+ }
+ }
+ else
+ {
+ GPtrArray *to_delete = g_ptr_array_sized_new(source_file->tags_array->len);
+
+ for (i = 0; i < source_file->tags_array->len; i++)
+ {
+ guint j;
+ guint tag_count;
+ TMTag **found;
+ TMTag *tag = source_file->tags_array->pdata[i];
+
+ found = tm_tags_find(tags_array, tag->name, FALSE, TRUE, &tag_count);
+
+ for (j = 0; j < tag_count; j++)
{
- /* we cannot set the pointer to NULL now because the search wouldn't work */
- g_ptr_array_add(to_delete, found);
- /* no break - if there are multiple tags of the same name, we would
- * always find the first instance and wouldn't remove others; duplicates
- * in the to_delete list aren't a problem */
+ if (*found != NULL && (*found)->file == source_file)
+ {
+ /* we cannot set the pointer to NULL now because the search wouldn't work */
+ g_ptr_array_add(to_delete, found);
+ /* no break - if there are multiple tags of the same name, we would
+ * always find the first instance and wouldn't remove others; duplicates
+ * in the to_delete list aren't a problem */
+ }
+ found++;
}
- found++;
}
- }
- for (i = 0; i < to_delete->len; i++)
- {
- TMTag **tag = to_delete->pdata[i];
- *tag = NULL;
+ for (i = 0; i < to_delete->len; i++)
+ {
+ TMTag **tag = to_delete->pdata[i];
+ *tag = NULL;
+ }
+ g_ptr_array_free(to_delete, TRUE);
}
- g_ptr_array_free(to_delete, TRUE);
tm_tags_prune(tags_array);
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).