#741 Makefiles have hard tabs of 4


When opening a make file, hard tabs are always of 4 (in fact the indent width). As we use spaces/hard tabs with indent of 4 and hard tabs of 8, it switches to hard tabs width of 4 with makefiles.
If you poen a C file the hard tabs are of 8, which is normal. Then, if you switch the file type to makefile, the hard tabs become of width 4. If you reset the original file type to C (yes it's silly :)), the hard tabs width remains to 4.

I have modified the source of editor.c to correct this behaviour. For me it works, but I am not sure it will work in all cases.
The patch is joined.
Geany version: svn revision #5886


  • Philippe Poilbarbe

    Patch to correct the bug

  • Colomban Wendling

    I'm not sure I can reproduce the problem, but let me explain what I think you see happening:

    The Makefile file type has hardcoded "tab" indentation type [1]; so when you switch from e.g. filetype C to Makefile, the indentation type changes to "tabs", thus leading to display tabs at the size of the indentation rather than the hard tab width.
    For somebody that uses tabs for indenting with indent_width != 8 (e.g. Geany, but many other do), it looks perfectly fine.

    So, until we have per-filetype indentation settings (which would be cool, but needs to be done and integrated with the UI), I think what you see is "not a bug but a feature" (the face Makefile filetype uses tab-only indentation mode), yet I understand your concern.

    [1] The rationale is that makefile rules *need* to start with a tab, so we though it was desired that the indentation type help on this.

  • Philippe Poilbarbe

    Yep... but in Makefile tab is not indentation it is.... well it is makefile stuff.
    For all other file types, hard tab width is set to 8. Which is consistent with all print devices: it will keep indentation (try to print a file with many levels of indentation donne with hard tabs of width 2, for example you'll get everything on the right column of wrapped).

    If you switch from a c file to type make and the back to type C the tab width have definitely changed (this IS a bug, but not very important since this kind of operation is a nonsense, I have just done to see what happens).

    Nevertheless, if is is not considered as a bug, I will apply the patch each time I will get the source of geany, it will not happen every five minutes :)

  • Colomban Wendling

    • assigned_to: nobody --> colombanw
    • status: open --> closed-fixed
  • Colomban Wendling

    I added per-filetype indentation settings in SVN r5902, configurable from the filetype definition file. This should allow you to tune the thing as you want.

    Also, the indentation settings are now only applied upon first filetype change, which should even fix your problem.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks