GNOME Bugzilla – Bug 567606
Auto-indentation in Anjuta gets tab indentation wrong for function paramaters
Last modified: 2009-02-10 09:18:07 UTC
Consider this one. I will write a \t as '[tab]', a newline as a '\n' and a space as a dot, '.', to illustrate this bug in a text-only field like this bugzilla's. This is how Anjuta does auto-indentation right now: static void\n my_calling_funcion_wrong (void);\n [tab]MyItem1 *item1;\n [tab]MyItem2 *item2;\n [tab]MyItem3 *item3;\n \n [tab]my_long_funcion (item1,\n [tab][tab][tab][tab]..item2, \n [tab][tab][tab][tab]..item3);\n }\n This is wrong, it should instead do this: static void\n my_calling_funcion_right (void);\n [tab]MyItem1 *item1;\n [tab]MyItem2 *item2;\n [tab]MyItem3 *item3;\n \n [tab]my_long_funcion (item1, \n [tab].................item2, \n [tab].................item3);\n }\n The reason for that is compatibility with other people's editor settings for the tab size. For example with _wrong if the original author wrote it with 8-spaces per tab in mind, then another author who has his editor set to use 4-spaces per tab will often see the function as mis-indented. This wouldn't have happened if it was indented the way _right is indented. I'm not asking to replace all tabs with spaces. That's for strange people who don't get the clue. Let's see another example: static void\n my_calling_funcion_right (void);\n [tab]MyItem1 *item1;\n [tab]MyItem2 *item2;\n [tab]MyItem3 *item3;\n \n [tab]while (TRUE) {\n [tab][tab]while (TRUE) {\n [tab][tab][tab]my_long_funcion (item1, \n [tab][tab][tab].................item2, \n [tab][tab][tab].................item3); \n [tab][tab]}\n [tab]}\n }\n Note how easy it becomes to move indentation from more tabs to less tabs without having to worry about 8-space-sized tabs vs. 4-space-sized tabs.
Hmm, your are right. Shouldn't be too difficult to fix, at least I hope so.
This is fixed in svn now. You can verify this by using View->Editors->White Spaces. Thanks for reporting.
Great news!