[geany/geany-plugins] 3fa279: Merge pull request #563 from eht16/addons_markword_for_new_documents_issue562
Frank Lanitz
git-noreply at xxxxx
Tue Apr 18 16:42:36 UTC 2017
Branch: refs/heads/master
Author: Frank Lanitz <frank at frank.uvena.de>
Committer: GitHub <noreply at github.com>
Date: Tue, 18 Apr 2017 16:42:36 UTC
Commit: 3fa279b48ec2addea77689a259ed69f1d7f954e1
https://github.com/geany/geany-plugins/commit/3fa279b48ec2addea77689a259ed69f1d7f954e1
Log Message:
-----------
Merge pull request #563 from eht16/addons_markword_for_new_documents_issue562
Enable Mark Word also for newly opened documents
Modified Paths:
--------------
addons/src/addons.c
addons/src/ao_markword.c
addons/src/ao_markword.h
Modified: addons/src/addons.c
10 lines changed, 10 insertions(+), 0 deletions(-)
===================================================================
@@ -104,6 +104,7 @@ static AddonsInfo *ao_info = NULL;
static void ao_update_editor_menu_cb(GObject *obj, const gchar *word, gint pos,
GeanyDocument *doc, gpointer data);
static void ao_document_activate_cb(GObject *obj, GeanyDocument *doc, gpointer data);
+static void ao_document_new_cb(GObject *obj, GeanyDocument *doc, gpointer data);
static void ao_document_open_cb(GObject *obj, GeanyDocument *doc, gpointer data);
static void ao_document_save_cb(GObject *obj, GeanyDocument *doc, gpointer data);
static void ao_document_before_save_cb(GObject *obj, GeanyDocument *doc, gpointer data);
@@ -120,6 +121,7 @@ PluginCallback plugin_callbacks[] =
{ "update-editor-menu", (GCallback) &ao_update_editor_menu_cb, FALSE, NULL },
{ "editor-notify", (GCallback) &ao_editor_notify_cb, TRUE, NULL },
+ { "document-new", (GCallback) &ao_document_new_cb, TRUE, NULL },
{ "document-open", (GCallback) &ao_document_open_cb, TRUE, NULL },
{ "document-save", (GCallback) &ao_document_save_cb, TRUE, NULL },
{ "document-close", (GCallback) &ao_document_close_cb, TRUE, NULL },
@@ -199,6 +201,14 @@ static void ao_document_activate_cb(GObject *obj, GeanyDocument *doc, gpointer d
}
+static void ao_document_new_cb(GObject *obj, GeanyDocument *doc, gpointer data)
+{
+ g_return_if_fail(doc != NULL && doc->is_valid);
+
+ ao_mark_document_new(ao_info->markword, doc);
+}
+
+
static void ao_document_open_cb(GObject *obj, GeanyDocument *doc, gpointer data)
{
g_return_if_fail(doc != NULL && doc->is_valid);
Modified: addons/src/ao_markword.c
7 lines changed, 7 insertions(+), 0 deletions(-)
===================================================================
@@ -172,6 +172,13 @@ static gboolean on_editor_button_press_event(GtkWidget *widget, GdkEventButton *
}
+void ao_mark_document_new(AoMarkWord *mw, GeanyDocument *document)
+{
+ /* there is nothing different to handling open documents, so do the same */
+ ao_mark_document_open(mw, document);
+}
+
+
void ao_mark_document_open(AoMarkWord *mw, GeanyDocument *document)
{
g_return_if_fail(DOC_VALID(document));
Modified: addons/src/ao_markword.h
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -41,6 +41,7 @@ typedef struct _AoMarkWordClass AoMarkWordClass;
GType ao_mark_word_get_type (void);
AoMarkWord* ao_mark_word_new (gboolean enable, gboolean single_click_deselect);
+void ao_mark_document_new (AoMarkWord *mw, GeanyDocument *document);
void ao_mark_document_open (AoMarkWord *mw, GeanyDocument *document);
void ao_mark_document_close (AoMarkWord *mw, GeanyDocument *document);
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list