Revision: 2017 http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=2017&view=re... Author: eht16 Date: 2011-04-10 12:33:54 +0000 (Sun, 10 Apr 2011)
Log Message: ----------- Minor code improvements
Modified Paths: -------------- trunk/geany-plugins/spellcheck/src/gui.c trunk/geany-plugins/spellcheck/src/gui.h
Modified: trunk/geany-plugins/spellcheck/src/gui.c =================================================================== --- trunk/geany-plugins/spellcheck/src/gui.c 2011-04-09 15:10:16 UTC (rev 2016) +++ trunk/geany-plugins/spellcheck/src/gui.c 2011-04-10 12:33:54 UTC (rev 2017) @@ -342,13 +342,13 @@ gtk_widget_show(menu_item); gtk_container_add(GTK_CONTAINER(sc_info->edit_menu_sub), menu_item); g_signal_connect(menu_item, "activate", - G_CALLBACK(menu_addword_item_activate_cb), GINT_TO_POINTER(0)); + G_CALLBACK(menu_addword_item_activate_cb), GINT_TO_POINTER(FALSE));
menu_item = image_menu_item_new(GTK_STOCK_REMOVE, _("Ignore All")); gtk_widget_show(menu_item); gtk_container_add(GTK_CONTAINER(sc_info->edit_menu_sub), menu_item); g_signal_connect(menu_item, "activate", - G_CALLBACK(menu_addword_item_activate_cb), GINT_TO_POINTER(1)); + G_CALLBACK(menu_addword_item_activate_cb), GINT_TO_POINTER(TRUE));
if (suggs != NULL) sc_speller_dict_free_string_list(suggs); @@ -396,6 +396,12 @@ }
+static gint sci_get_eol_mode(GeanyDocument *doc) +{ + return scintilla_send_message(doc->editor->sci, SCI_GETEOLMODE, 0, 0); +} + + /* Checks only the last word before the current cursor position -> check as you type. */ gboolean sc_gui_key_release_cb(GtkWidget *widget, GdkEventKey *ev, gpointer data) { @@ -413,8 +419,7 @@
doc = document_get_current();
- if (ev->keyval == '\r' && - scintilla_send_message(doc->editor->sci, SCI_GETEOLMODE, 0, 0) == SC_EOL_CRLF) + if (ev->keyval == '\r' && sci_get_eol_mode(doc) == SC_EOL_CRLF) { /* prevent double line checking */ return FALSE; }
Modified: trunk/geany-plugins/spellcheck/src/gui.h =================================================================== --- trunk/geany-plugins/spellcheck/src/gui.h 2011-04-09 15:10:16 UTC (rev 2016) +++ trunk/geany-plugins/spellcheck/src/gui.h 2011-04-10 12:33:54 UTC (rev 2017) @@ -43,7 +43,7 @@
void sc_gui_update_toolbar(void);
-void sc_gui_update_menu(); +void sc_gui_update_menu(void);
void sc_gui_init(void);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
plugins-commits@lists.geany.org