Branch: refs/heads/master
Author: Jiří Techet <techet(a)gmail.com>
Committer: Jiří Techet <techet(a)gmail.com>
Date: Tue, 07 May 2019 04:51:09 UTC
Commit: 0d553fdef020213ba331b919b42cbd5087145fc9
https://github.com/geany/geany-plugins/commit/0d553fdef020213ba331b919b42cb…
Log Message:
-----------
vimode: don't use g_ptr_array_find_with_equal_func()
It's only available in new versions of glib.
Modified Paths:
--------------
vimode/src/excmd-prompt.c
Modified: vimode/src/excmd-prompt.c
7 lines changed, 4 insertions(+), 3 deletions(-)
===================================================================
@@ -91,10 +91,11 @@ static gboolean on_prompt_key_press_event(GtkWidget *widget, GdkEventKey *event,
case GDK_KEY_KP_Enter:
case GDK_KEY_ISO_Enter:
{
- guint index;
+ guint i;
- if (g_ptr_array_find_with_equal_func(history, text + 1, g_str_equal, &index))
- g_ptr_array_remove_index(history, index);
+ for (i = 0; i < history->len; i++)
+ if (g_str_equal(text + 1, history->pdata[i]))
+ g_ptr_array_remove_index(history, i);
if (strlen(text) > 1)
g_ptr_array_add(history, g_strdup(text + 1));
if (history->len > 20) // default vim history size
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).