On Wed, 12 Nov 2008 12:34:59 +0000, Nick Treleaven nick.treleaven@btinternet.com wrote:
On Mon, 10 Nov 2008 21:17:48 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
thanks for reply. it would be great to move all template related stuff into a plugin. most ide's like eclipse or netbeans or even vs first ask user to select a template and then to specify a name for the new file. if i'm not mistaken eclipse cdt can create unnamed files the same way geany does but in such cases it doesn't use any templates. so geany is just missing asking for a filename. It'd be nice if you make it
Yes, Geany asks first for the filename when the file is actually to be saved, not when creating. I like it this way as it makes creating files more easy and fast.
One idea: maybe when using New with Template and the template uses {filename}, Geany could flag this in a private document field, and not transform it until the file is saved. On saving, Geany could check if the 'replace_template_filename' field is set, and replace all instances of {filename} with the proper filename.
This still won't solve the problem of replacing {filename} with HEADERFILE_H. But maybe we could add another wildcard like {FILENAME} which will replace the filename with an uppercase variant.
Maybe we don't need an additional flag at all when we extend the existing code in replace_header_filename() (document.c) to work on the whole file, not only the first three lines.
But I'd still like to have all this done in a plugin in some way. Either a new one or by extending the classbuilder plugin to be more flexible.
Regards, Enrico