<p><b>@LarsGit223</b> requested changes on this pull request.</p>
<p>Fine for me, except that <code>cb_table_convert_change_document</code> should also be a static function.</p><hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/922#discussion_r333131757">tableconvert/src/tableconvert.c</a>:</p>
<pre style='color:#555'>> @@ -35,6 +35,19 @@ PLUGIN_SET_TRANSLATABLE_INFO(
GeanyPlugin *geany_plugin;
GeanyData *geany_data;
+
+PluginCallback plugin_callbacks[] =
+{
+ { "editor-notify", (GCallback) &cb_table_convert_change_document, FALSE, NULL },
+ { "document-activate", (GCallback) &cb_table_convert_change_document, FALSE, NULL },
+ { "document-filetype-set", (GCallback) &cb_table_convert_change_document, FALSE, NULL },
+ { "document-new", (GCallback) &cb_table_convert_change_document, FALSE, NULL},
+ { "geany-startup-complete", (GCallback) &cb_table_convert_change_document, FALSE, NULL },
+ { "document-close", (GCallback) &cb_table_convert_change_document, FALSE, NULL},
+ { NULL, NULL, FALSE, NULL }
+};
</pre>
<p>I guess that's fine now.</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/922#discussion_r333132583">tableconvert/src/tableconvert.c</a>:</p>
<pre style='color:#555'>> @@ -338,6 +351,31 @@ void cb_table_convert_type(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gp
convert_to_table(TRUE, GPOINTER_TO_INT(gdata));
}
+void cb_table_convert_change_document(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer gdata)
</pre>
<p>Should still be static. Unless you prefer it that way.</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/922#discussion_r333135212">tableconvert/src/tableconvert.c</a>:</p>
<pre style='color:#555'>> @@ -338,6 +351,31 @@ void cb_table_convert_type(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gp
convert_to_table(TRUE, GPOINTER_TO_INT(gdata));
}
+void cb_table_convert_change_document(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer gdata)
+{
+ set_activate_state();
+}
+
+void set_activate_state()
+{
+ // getting document
+ GeanyDocument *doc = NULL;
+ doc = document_get_current();
+
+ if (
+ doc != NULL && (
</pre>
<p>Ok, when the events are fired, a document is most likely just opened or switched to so there most likely cannot be a selection (yet).</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/922#discussion_r333137915">tableconvert/src/tableconvert.h</a>:</p>
<pre style='color:#555'>> @@ -70,6 +70,6 @@ extern TableConvertRule tablerules[];
extern void cb_table_convert(G_GNUC_UNUSED GtkMenuItem *menuitem, G_GNUC_UNUSED gpointer gdata);
extern void cb_table_convert_type(G_GNUC_UNUSED GtkMenuItem *menuitem, gpointer gdata);
-extern void convert_to_table(gboolean header, gint file_type);
+extern void cb_table_convert_change_document(G_GNUC_UNUSED GtkMenuItem *menuitem, gpointer gdata);
</pre>
<p>See above. Should be static and removed from the header file.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany-plugins/pull/922?email_source=notifications&email_token=AAIOWJ6GEN2IDN7DDPXZCGDQNYH7XA5CNFSM4I53SLH2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCHNQLNQ#pullrequestreview-299566518">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ7B3TT53OKE4TI7SYLQNYH7XANCNFSM4I53SLHQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAIOWJ4EATPJJ6FPS4HWA3DQNYH7XA5CNFSM4I53SLH2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCHNQLNQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/pull/922?email_source=notifications\u0026email_token=AAIOWJ6GEN2IDN7DDPXZCGDQNYH7XA5CNFSM4I53SLH2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCHNQLNQ#pullrequestreview-299566518",
"url": "https://github.com/geany/geany-plugins/pull/922?email_source=notifications\u0026email_token=AAIOWJ6GEN2IDN7DDPXZCGDQNYH7XA5CNFSM4I53SLH2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCHNQLNQ#pullrequestreview-299566518",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>