From: Daniel Carl Date: Sat, 23 Mar 2013 23:08:37 +0000 (+0100) Subject: Used macro GET_TEXT() where it where not used before. X-Git-Url: https://git.owens.tech/style.css/style.css/git?a=commitdiff_plain;h=80b576e5479cd3f626d8ecc8dad94903953493df;p=vimb.git Used macro GET_TEXT() where it where not used before. --- diff --git a/src/completion.c b/src/completion.c index ae16674..6d5797e 100644 --- a/src/completion.c +++ b/src/completion.c @@ -41,7 +41,7 @@ static void completion_free(Completion* completion); gboolean completion_complete(gboolean back) { - const char* input = gtk_entry_get_text(GTK_ENTRY(vb.gui.inputbox)); + const char* input = GET_TEXT(); GList* source = NULL; if (vb.comps.completions diff --git a/src/hints.c b/src/hints.c index 7118c31..173da0e 100644 --- a/src/hints.c +++ b/src/hints.c @@ -181,7 +181,7 @@ static void hints_observe_input(gboolean observe) static gboolean hints_changed_callback(GtkEditable *entry) { - const char* text = gtk_entry_get_text(GTK_ENTRY(vb.gui.inputbox)); + const char* text = GET_TEXT(); /* skip hinting prefixes like '.', ',', ';y' ... */ hints_create(text + vb.hints.prefixLength, vb.hints.mode, vb.hints.prefixLength); diff --git a/src/history.c b/src/history.c index 43eeb6c..e97f30b 100644 --- a/src/history.c +++ b/src/history.c @@ -45,7 +45,7 @@ const char* history_get(const int step) /* get the search prefix only on start of history search */ if (!vb.state.history_active) { - OVERWRITE_STRING(vb.state.history_prefix, gtk_entry_get_text(GTK_ENTRY(vb.gui.inputbox))); + OVERWRITE_STRING(vb.state.history_prefix, GET_TEXT()); /* generate new history list with the matching items */ for (GList* l = vb.behave.history; l; l = l->next) { diff --git a/src/main.c b/src/main.c index f76dd71..1ac51b7 100644 --- a/src/main.c +++ b/src/main.c @@ -446,7 +446,7 @@ static void vb_inputbox_activate_cb(GtkEntry *entry) } /* do not free or modify text */ - text = gtk_entry_get_text(entry); + text = GET_TEXT(); /* duplicate the content because this may change for example if * :set varName? is used the text is changed to the new printed diff --git a/src/main.h b/src/main.h index 7f22567..5631c5e 100644 --- a/src/main.h +++ b/src/main.h @@ -51,7 +51,7 @@ #define TIMER_END #endif -#define GET_TEXT() (gtk_entry_get_text(GTK_ENTRY(vp.gui.inputbox))) +#define GET_TEXT() (gtk_entry_get_text(GTK_ENTRY(vb.gui.inputbox))) #define CLEAN_MODE(mode) ((mode) & ~(VB_MODE_COMPLETE)) #define CLEAR_INPUT() (vb_echo(VB_MSG_NORMAL, "")) #define PRIMARY_CLIPBOARD() gtk_clipboard_get(GDK_SELECTION_PRIMARY) diff --git a/src/setting.c b/src/setting.c index 790b49d..ac7ccc7 100644 --- a/src/setting.c +++ b/src/setting.c @@ -449,7 +449,7 @@ static gboolean setting_input_style(const Setting* s, const SettingType type) } if (type != SETTING_GET) { /* vb_update_input_style seems to take no immediatly effect */ - vb_echo(VB_MSG_NORMAL, FALSE, gtk_entry_get_text(GTK_ENTRY(vb.gui.inputbox))); + vb_echo(VB_MSG_NORMAL, FALSE, GET_TEXT()); } return TRUE;