Branch: refs/heads/master Author: Dimitar Zhekov dimitar.zhekov@gmail.com Committer: Dimitar Zhekov dimitar.zhekov@gmail.com Date: Thu, 14 Jun 2012 17:59:56 Commit: 331f5e9c2954107669d3d79a124c33b1a906161f https://github.com/geany/geany-plugins/commit/331f5e9c2954107669d3d79a124c33...
Log Message: ----------- geanyextrasel: small fixes
Fixed the prototype of on_column_mode_toggled().
Partially restored ignore_callback to avoid delay on document activate.
Modified Paths: -------------- geanyextrasel/ChangeLog geanyextrasel/src/extrasel.c
Modified: geanyextrasel/ChangeLog 9 files changed, 9 insertions(+), 0 deletions(-) =================================================================== @@ -1,6 +1,15 @@ 2012-06-13 Dimitar Zhekov dimitar.zhekov@gmail.com
* src/extrasel.c: + + Fixed the prototype of on_column_mode_toggled(). + Partially restored ignore_callback to avoid delay on document + activation. + +2012-06-13 Dimitar Zhekov dimitar.zhekov@gmail.com + + * src/extrasel.c: + Fixed on_settings_change() prototype. Fixed on settings changed to reassign the selection keys for all documents, not the current document only.
Modified: geanyextrasel/src/extrasel.c 22 files changed, 15 insertions(+), 7 deletions(-) =================================================================== @@ -54,6 +54,7 @@ enum static gpointer *go_to_line1_item = NULL;
static gint column_mode = FALSE; +static gint plugin_internal_callback = FALSE; static gint select_anchor = 0, select_space = 0;
/* Common functions / macros */ @@ -248,19 +249,22 @@ static void assign_select_keys(ScintillaObject *sci) } }
-static void on_column_mode_toggled(G_GNUC_UNUSED GtkMenuItem *menuitem, - G_GNUC_UNUSED gpointer gdata) +static void on_column_mode_toggled(G_GNUC_UNUSED GtkMenuItem *menuitem) { ScintillaObject *sci = scintilla_get_current();
if (sci) { column_mode = gtk_check_menu_item_get_active(column_mode_item); - assign_select_keys(sci); - g_object_set_data(G_OBJECT(sci), "column_mode", GINT_TO_POINTER(column_mode)); - if (sci_has_selection(sci) && sci_rectangle_selection(sci) != column_mode) - convert_selection(sci, column_mode); gtk_widget_set_sensitive(anchor_rect_select_item, !column_mode); + + if (!plugin_internal_callback) + { + assign_select_keys(sci); + g_object_set_data(G_OBJECT(sci), "column_mode", GINT_TO_POINTER(column_mode)); + if (sci_has_selection(sci) && sci_rectangle_selection(sci) != column_mode) + convert_selection(sci, column_mode); + } } }
@@ -273,7 +277,9 @@ static void on_document_create(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GeanyDo G_GNUC_UNUSED gpointer gdata) { select_anchor = select_space = 0; + plugin_internal_callback = TRUE; gtk_check_menu_item_set_active(column_mode_item, FALSE); + plugin_internal_callback = FALSE; }
static void on_document_activate(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc, @@ -281,8 +287,10 @@ static void on_document_activate(G_GNUC_UNUSED GObject *obj, GeanyDocument *doc, { ScintillaObject *sci = doc->editor->sci;
+ plugin_internal_callback = TRUE; column_mode = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sci), "column_mode")); gtk_check_menu_item_set_active(column_mode_item, column_mode); + plugin_internal_callback = FALSE; select_anchor = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sci), "select_anchor")); select_space = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(sci), "select_space")); } @@ -308,7 +316,7 @@ static void on_settings_change(G_GNUC_UNUSED GObject *obj, G_GNUC_UNUSED GKeyFil
if (column_mode) { - gint i; + guint i;
foreach_document(i) assign_select_keys(documents[i]->editor->sci);
@@ Diff output truncated at 100000 characters. @@
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: TBD).