<p><b>@codebrainz</b> requested changes on this pull request.</p>
<p>I didn't review the code in-depth since there are so many simple things wrong.</p>
<p>It seems to me it might be better to use the WebHelper plugin or develop a new plugin for real-time editing of other formats. I could possibly be persuaded otherwise though.</p><hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/822#discussion_r270689706">treebrowser/src/treebrowser.c</a>:</p>
<pre style='color:#555'>> @@ -122,7 +122,7 @@ PLUGIN_VERSION_CHECK(224)
PLUGIN_SET_TRANSLATABLE_INFO(
LOCALEDIR,
GETTEXT_PACKAGE,
- _("TreeBrowser"),
+ _("FileTreeBrowser"),// affects the alphabetical sorting in sidebar, puts TreeBrowser just after "Documents"
</pre>
<p>This is unrelated to the pull request.</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/822#discussion_r270689754">markdown/src/viewer.c</a>:</p>
<pre style='color:#555'>> @@ -383,7 +389,8 @@ markdown_viewer_update_view(MarkdownViewer *self)
* substituting the file's basename for `index.html`. */
if (DOC_VALID(doc) && doc->real_path != NULL) {
gchar *base_dir = g_path_get_dirname(doc->real_path);
- base_path = g_build_filename(base_dir, "index.html", NULL);
+ //base_path = g_build_filename(base_dir, "index.html", NULL);
</pre>
<p>There's no need to comment out-lines, the old code can be found in Git history.</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/822#discussion_r270689831">markdown/src/viewer.c</a>:</p>
<pre style='color:#555'>> @@ -337,6 +337,12 @@ markdown_viewer_get_html(MarkdownViewer *self)
update_internal_text(self, "");
}
+ if((self->priv->text->len > 1) && (self->priv->text->str[0]=='<') )
+ {
+ html = g_malloc(strlen(self->priv->text->str) + 1);
+ strcpy(html, self->priv->text->str); html[strlen(self->priv->text->str)]='\0';
+ }
+ else
</pre>
<p>Weird code formatting and indentation and stuff. Please follow the same style and formatting as the other code.</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/822#discussion_r270689849">markdown/src/plugin.c</a>:</p>
<pre style='color:#555'>> @@ -166,12 +166,24 @@ update_markdown_viewer(MarkdownViewer *viewer)
{
GeanyDocument *doc = document_get_current();
- if (DOC_VALID(doc) && g_strcmp0(doc->file_type->name, "Markdown") == 0) {
+ if (DOC_VALID(doc) && g_strcmp0(doc->file_type->name, "Markdown") == 0)
+ {
</pre>
<p>Why move the brace down?</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/822#discussion_r270689869">markdown/src/plugin.c</a>:</p>
<pre style='color:#555'>> gchar *text;
text = (gchar*) scintilla_send_message(doc->editor->sci, SCI_GETCHARACTERPOINTER, 0, 0);
markdown_viewer_set_markdown(viewer, text, doc->encoding);
gtk_widget_set_sensitive(g_export_html, TRUE);
- } else {
+ }
+ else if (DOC_VALID(doc) && doc->file_name)
+ { if( strrchr(doc->file_name,'.') && ( (g_strcmp0(strrchr(doc->file_name,'.'), ".svg")==0) || (g_strcmp0(strrchr(doc->file_name,'.' ), ".html")==0) ) )
+ {
+ gchar *text;
+ text = (gchar*) scintilla_send_message(doc->editor->sci, SCI_GETCHARACTERPOINTER, 0, 0);
+ markdown_viewer_set_markdown(viewer, text, doc->encoding);
+ gtk_widget_set_sensitive(g_export_html, FALSE);
+ }
+ }
+ else
+ {
</pre>
<p>Weird formatting and indentation. Please follow the style and formatting of the other code.</p>
<hr>
<p>In <a href="https://github.com/geany/geany-plugins/pull/822#discussion_r270689884">markdown/src/plugin.c</a>:</p>
<pre style='color:#555'>> @@ -43,7 +43,7 @@ PLUGIN_SET_TRANSLATABLE_INFO(LOCALEDIR, GETTEXT_PACKAGE,
# define MARKDOWN_HELP_FILE MARKDOWN_DOC_DIR "/html/help.html"
#endif
-#define MARKDOWN_PREVIEW_LABEL _("Markdown Preview")
+#define MARKDOWN_PREVIEW_LABEL _("Markdown")
</pre>
<p>This doesn't have anything to do with the pull request.</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/822#pullrequestreview-220888943">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ5spqVk7X8Xy663IQkqsBFrH5hpVks5vcT9zgaJpZM4a7eqs">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJwsKQnHd5J3GJyYe-Csiu4wTpJRQks5vcT9zgaJpZM4a7eqs.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany-plugins","title":"geany/geany-plugins","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany-plugins"}},"updates":{"snippets":[{"icon":"PERSON","message":"@codebrainz requested changes on #822"}],"action":{"name":"View Pull Request","url":"https://github.com/geany/geany-plugins/pull/822#pullrequestreview-220888943"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany-plugins/pull/822#pullrequestreview-220888943",
"url": "https://github.com/geany/geany-plugins/pull/822#pullrequestreview-220888943",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>