[Geany-devel] Changes to templates

Colomban Wendling lists.ban at xxxxx
Tue Mar 15 16:54:28 UTC 2011


Le 15/03/2011 04:12, Matthew Brush a écrit :
> [...]
> 
> Make a constant for the amount of indentation used for template
> comments, so that they are consistent and also set to a more reasonable
> value of 3 instead of 8.  Related to feature request: Specify spacing
> before fileheader - ID: 3193527[1].

Sounds good -- though, we may want to make this a setting at some point.
Committed, renaming GEANY_TEMPLATES_HEADER_INDENT to
GEANY_TEMPLATES_INDENT since it's not only for headers anymore.

> Strip all leading and trailing whitespace on the text read from template
> files.

What if somebody *wants* whitepaces/newlines at the end of her template?
I can easily imagine one wants this, for example for function
descriptions [1] or whatever (it's seems to be the case with the Geany's
default function template).
Moreover, Geany's default templates seems to work OK without the patch,
don't they?
Currently you "just" need to write your template carefully, with this
change, it won't be possible at all.

So... I'm not sure about this one.

> Fix filetypes.c to use /* */ style comments rather than C++ style comments.

I'd personally agree with this change, but it has a drawback: multi-line
C comments can't be nested. So the comment/un-comment command becomes a
little less useful since it'd break if commenting stuff including comments.
Maybe a better fix would be to allow a filetype to define both
single-line and multi-line comments, and use them when appropriate?
(e.g. multi-lines comment for template comments, single-lines for ^E)

> There is still the issue Lex brought up about the encoding of the text
> being read from file and set into Scintilla.

True, this should be fixed. I'll take a look at it.

Cheers,
Colomban


[1] though they should use GeanyGenDoc plugin in this particular case :D



More information about the Devel mailing list