Revision: 2742
http://geany.svn.sourceforge.net/geany/?rev=2742&view=rev
Author: ntrel
Date: 2008-07-02 06:40:06 -0700 (Wed, 02 Jul 2008)
Log Message:
-----------
Add document_close() to the plugin API.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/plugindata.h
trunk/src/plugins.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-02 11:58:01 UTC (rev 2741)
+++ trunk/ChangeLog 2008-07-02 13:40:06 UTC (rev 2742)
@@ -5,6 +5,8 @@
are set as keybindings for Go to Line Start/End.
This uses a new ignore_keybinding variable because changing
KeyCallback to return gboolean would break plugin keybindings.
+ * src/plugindata.h, src/plugins.c:
+ Add document_close() to the plugin API.
2008-07-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/src/plugindata.h
===================================================================
--- trunk/src/plugindata.h 2008-07-02 11:58:01 UTC (rev 2741)
+++ trunk/src/plugindata.h 2008-07-02 13:40:06 UTC (rev 2742)
@@ -36,7 +36,7 @@
/* The API version should be incremented whenever any plugin data types below are
* modified or appended to. */
-static const gint api_version = 72;
+static const gint api_version = 73;
/* The ABI version should be incremented whenever existing fields in the plugin
* data types below have to be changed or reordered. It should stay the same if fields
@@ -217,6 +217,7 @@
void (*set_encoding) (struct GeanyDocument *doc, const gchar *new_encoding);
void (*set_text_changed) (struct GeanyDocument *doc, gboolean changed);
void (*set_filetype) (struct GeanyDocument *doc, struct GeanyFiletype *type);
+ gboolean (*close) (GeanyDocument *doc);
}
DocumentFuncs;
Modified: trunk/src/plugins.c
===================================================================
--- trunk/src/plugins.c 2008-07-02 11:58:01 UTC (rev 2741)
+++ trunk/src/plugins.c 2008-07-02 13:40:06 UTC (rev 2742)
@@ -106,7 +106,8 @@
&document_reload_file,
&document_set_encoding,
&document_set_text_changed,
- &document_set_filetype
+ &document_set_filetype,
+ &document_close
};
static EditorFuncs editor_funcs = {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 2741
http://geany.svn.sourceforge.net/geany/?rev=2741&view=rev
Author: ntrel
Date: 2008-07-02 04:58:01 -0700 (Wed, 02 Jul 2008)
Log Message:
-----------
Fix behaviour of Home and End keys in non-editor widgets when they
are set as keybindings for Go to Line Start/End.
This uses a new ignore_keybinding variable because changing
KeyCallback to return gboolean would break plugin keybindings.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/keybindings.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-07-01 14:20:16 UTC (rev 2740)
+++ trunk/ChangeLog 2008-07-02 11:58:01 UTC (rev 2741)
@@ -1,3 +1,12 @@
+2008-07-02 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/keybindings.c:
+ Fix behaviour of Home and End keys in non-editor widgets when they
+ are set as keybindings for Go to Line Start/End.
+ This uses a new ignore_keybinding variable because changing
+ KeyCallback to return gboolean would break plugin keybindings.
+
+
2008-07-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/treeviews.c, src/callbacks.c, src/document.c, src/document.h:
Modified: trunk/src/keybindings.c
===================================================================
--- trunk/src/keybindings.c 2008-07-01 14:20:16 UTC (rev 2740)
+++ trunk/src/keybindings.c 2008-07-02 11:58:01 UTC (rev 2741)
@@ -51,6 +51,8 @@
/* keyfile group name for non-plugin KB groups */
const gchar keybindings_keyfile_group_name[] = "Bindings";
+static gboolean ignore_keybinding = FALSE;
+
static GtkAccelGroup *kb_accel_group = NULL;
static const gboolean swap_alt_tab_order = FALSE;
@@ -916,6 +918,7 @@
if (check_snippet_completion(keyval, state))
return TRUE;
+ ignore_keybinding = FALSE;
for (g = 0; g < keybinding_groups->len; g++)
{
KeyBindingGroup *group = g_ptr_array_index(keybinding_groups, g);
@@ -931,7 +934,7 @@
/* call the corresponding callback function for this shortcut */
kb->callback(i);
- return TRUE;
+ return !ignore_keybinding;
}
}
}
@@ -1361,22 +1364,22 @@
{
case GEANY_KEYS_GOTO_BACK:
navqueue_go_back();
- break;
+ return;
case GEANY_KEYS_GOTO_FORWARD:
navqueue_go_forward();
- break;
+ return;
case GEANY_KEYS_GOTO_LINE:
on_go_to_line1_activate(NULL, NULL);
- break;
+ return;
case GEANY_KEYS_GOTO_MATCHINGBRACE:
goto_matching_brace(doc);
- break;
+ return;
case GEANY_KEYS_GOTO_TOGGLEMARKER:
{
gboolean set = sci_is_marker_set_at_line(doc->sci, cur_line, 1);
sci_set_marker_at_line(doc->sci, cur_line, ! set, 1);
- break;
+ return;
}
case GEANY_KEYS_GOTO_NEXTMARKER:
{
@@ -1387,7 +1390,7 @@
sci_set_current_line(doc->sci, mline);
editor_display_current_line(doc, 0.5F);
}
- break;
+ return;
}
case GEANY_KEYS_GOTO_PREVIOUSMARKER:
{
@@ -1398,16 +1401,25 @@
sci_set_current_line(doc->sci, mline);
editor_display_current_line(doc, 0.5F);
}
- break;
+ return;
}
case GEANY_KEYS_GOTO_TAGDEFINITION:
if (check_current_word())
symbols_goto_tag(editor_info.current_word, TRUE);
- break;
+ return;
case GEANY_KEYS_GOTO_TAGDECLARATION:
if (check_current_word())
symbols_goto_tag(editor_info.current_word, FALSE);
- break;
+ return;
+ }
+ /* only check editor-sensitive keybindings when editor has focus */
+ if (gtk_window_get_focus(GTK_WINDOW(main_widgets.window)) != GTK_WIDGET(doc->sci))
+ {
+ ignore_keybinding = TRUE;
+ return;
+ }
+ switch (key_id)
+ {
case GEANY_KEYS_GOTO_LINESTART:
sci_cmd(doc->sci, editor_prefs.smart_home_key ? SCI_VCHOME : SCI_HOME);
break;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.