[Geany-devel] Changes to templates

Lex Trotman elextr at xxxxx
Sat Mar 19 01:32:51 UTC 2011


On 19 March 2011 10:26, Colomban Wendling <lists.ban at herbesfolles.org> wrote:
> Le 18/03/2011 23:52, Lex Trotman a écrit :
>> Hi Colomban,
>>
>> [..]
>>>
>>> Do you (all) think it's OK to strip the last new line of the end of
>>> template files, since it's most likely to be an "implicit" new line?
>>>
>>> Attached the possible patch, if you like to test it before.
>>
>> I think its ok to strip only one newline, then people who actually do
>> want extra blank lines in their templates can still have them, they
>> just have to remember one gets stripped.
>
> Yep, and the idea of stripping one being that most editors add it
> implicitly, at least on Unices.
>
>> Only comment on the patch is that you have swapped the order of
>> frame_end and template_eol_char at the end of the template. (compare
>> lines 21 and 67/68 of the patch)
>
> It was indented actually (not as swapping though):
> * I added a line before the frame_end since the template no longer have
> a trailing new line.

Maybe ok, I don't care up to to others to say.

> * I removed the newline after because it added implicitly an extra
> newline in e.g. template files (main.c, etc.) after the comment, but
> maybe we better keep it (e.g. inserting a template comment adds a new
> line); not sure.

Needs the eol after the comment close, otherwise if I insert a
function description before a function the prototype ends up on the
same line as the comment close, yuk.

>
[...]
> Maybe. Not sure the distinction is really needed though.

Well then we need (at least) a third set of options, better to leave
it to the plugin.

Cheers
Lex
>
> Cheers,
> Colomban
>



More information about the Devel mailing list