Hi Enrico,<br><br>Thanks for your advices. Since I don't develop pretty much in C, I don't know the geany-standards very well. I'll correct that :-) For formatting the current selection there are two technical problems I see :<br>
- The selected text must be a valid XML (from start node to its closing tag).<br>- How do I get the depth of the selected node ?<br><br>Currently, my parser just take a char* and formats it, so I can send it the selection (since it is a XML) and it will format it. I didn't have care of just formatting one part, but maybe I'll try in a futur version :-)<br>
<br>I just sent you a request to join the geany project on sourceforge.<br><br>Best regards,<br>Cedric<br><br><div class="gmail_quote">2009/8/9 Enrico Tröger <span dir="ltr"><<a href="mailto:enrico.troeger@uvena.de">enrico.troeger@uvena.de</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Sat, 8 Aug 2009 14:00:52 +0200, Cédric wrote:<br>
<br>
Heyho,<br>
<br>
about compiling and your friend using Ubuntu:<br>
sharing binary files (.so) between different systems and especially<br>
between different distributions usually don't work (we are not on<br>
Windows...) and it's not designed to work. Instead, compile the code<br>
from source on the target platform, that should do the trick. If your<br>
friend still don't get the plugin listed in the plugin manager dialog,<br>
tell him to check Help->Debug Messages for details. There should be a<br>
message indicating why it could not be loaded.<br>
<div class="im"><br>
<br>
>Okay, here is an update => in case of invalid char, it won't shut down<br>
<br>
</div>Just for clarity, "shut down" seems the wrong term here. You are surely<br>
talking about a crash. A shut down is something normal which is<br>
expected but you are talking about a crash which happened because of<br>
wrong code, I guess.<br>
<div class="im"><br>
<br>
>geany. I also correct some other bugs, but DOCTYPE is currently not<br>
>supported.<br>
>I'll try to add the options with what you sent me !<br>
<br>
</div>A few unsorted notes after having a short look at the plugin:<br>
<br>
- it's a great idea. I personally probably won't use it much as I don't<br>
use XML much but in general it's getting probably pretty useful for<br>
many users.<br>
<br>
- If you would use g_warning() and/or other g_foo() log functions, your<br>
messages would also be available in Help->Debug Messages which makes<br>
searching for information/warnings/errors easier as most users don't<br>
run Geany from a console.<br>
<br>
- If the menu item is activated, it always works on the whole document.<br>
I think it's more intuitive and even more usable if it would work only<br>
on the current selection if there is any and the whole document if<br>
there is no selection. This is how most text modifiying functions work<br>
in Geany (and other applications as well). Some very basic example code<br>
could look like this:<br>
gchar *buffer;<br>
gint length;<br>
if (sci_has_selection(sco))<br>
{<br>
        length = sci_get_selected_text_length(sco);<br>
        buffer = g_malloc0(len + 1);<br>
        if (buffer == NULL) { exit(-1); } //malloc error<br>
        sci_get_selected_text(sco, buffer);<br>
}<br>
else<br>
{<br>
        length = sci_get_length(sco);<br>
        buffer = g_malloc0(length + 1);<br>
        if (buffer == NULL) { exit(-1); } //malloc error<br>
        //retrieves the text<br>
        sci_get_text(sco, length, buffer);<br>
}<br>
<br>
<br>
And remember I suggested to join the geany-plugins project [1] so your<br>
code would be in the SVN repository and will be released with the next<br>
geany-plugins combined release.<br>
<br>
<br>
[1] <a href="http://lists.uvena.de/pipermail/geany-devel/2009-June/000747.html" target="_blank">http://lists.uvena.de/pipermail/geany-devel/2009-June/000747.html</a><br>
<div><div></div><div class="h5"><br>
Regards,<br>
Enrico<br>
<br>
--<br>
Get my GPG key from <a href="http://www.uvena.de/pub.asc" target="_blank">http://www.uvena.de/pub.asc</a><br>
</div></div><br>_______________________________________________<br>
Geany-devel mailing list<br>
<a href="mailto:Geany-devel@uvena.de">Geany-devel@uvena.de</a><br>
<a href="http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel" target="_blank">http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel</a><br>
<br></blockquote></div><br>