I like your idea of passing a pointer to the config struct, that's cleaner and 
if new options are created, we only add them to the config structure without 
adding new arguments to editor_new().

Silvan Jegen <s.je...@gmail.com> a écrit :

>On Sun, Jan 04, 2015 at 06:12:00PM +0100, Matthias Rabault wrote:
>> Thanks for the patch, I'll check it out this evening (can't yet, I'm
>> using my phone). What I was thinking of was adding code in main() that
>> alters the Editor structure according to config.def.h defines, just
>> before calling the main loop.
>
>When looking at the main function you can see that the editor's statusbar
>field is being set using the "config"-pointer and a corresponding function
>called editor_statusbar_set.
>
>If you want to follow that pattern you can add two setter functions for
>tabwidth and expandtab and set the fields that way (either using the
>Config in config or a "#define"d value).
>
>I wonder though if it wouldn't be cleaner to just pass a pointer to the
>Config struct to the editor_new function and dealing with the field
>value initializations there.
>
>

Reply via email to