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