Hi,
In my GeanyGenDoc plugin I was using sci_insert_text() to insert the generated documentation comment; but I wanted to be able to indent the inserted comment to follow the indentation at the insertion position.
I found editor_insert_text_block() which seemed quite interesting, but it didn't do what I expected -- and still no indentation. Of course when going a bit in the code, since I inserted my comment at the start of the line, and editor_insert_text_block() adds the indentation that is found between the start of the line and the insertion position… which are the same in my case. Then, I wondered how to fix my problem, and finally found a solution that consists to insert at start of line + sci_get_line_indentation() [1].
But I have some questions: 1) How editor_insert_text_block() is meant to be used to get the right indentation, since (if I'm right) we need to insert at the right position in the first line? Is the solution I've found the right one, or is there a cleaner/simpler solution? 2) If this is a good way to proceed, could we have sci_get_line_indentation() in the plugin API? Even though it is easy to reproduce [2] it would be nicer to have it directly.
Regards, Colomban
[1] http://geany-plugins.svn.sourceforge.net/viewvc/geany-plugins/trunk/geanygen... [2] http://geany-plugins.svn.sourceforge.net/viewvc/geany-plugins/trunk/geanygen...