Revision: 4371 http://geany.svn.sourceforge.net/geany/?rev=4371&view=rev Author: ntrel Date: 2009-10-26 18:13:50 +0000 (Mon, 26 Oct 2009)
Log Message: ----------- Improve 'Detect from file' indentation pref by ignoring lines with indentation wider than 24 characters as this is more likely to be alignment than indentation.
Modified Paths: -------------- trunk/ChangeLog trunk/src/document.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-10-26 15:45:12 UTC (rev 4370) +++ trunk/ChangeLog 2009-10-26 18:13:50 UTC (rev 4371) @@ -19,6 +19,10 @@ * src/prefs.c, src/ui_utils.c, doc/geany.txt, doc/geany.html: Disable switching the sidebar to the right on Windows as it will probably fail like the Split Window plugin. + * src/document.c: + Improve 'Detect from file' indentation pref by ignoring lines with + indentation wider than 24 characters as this is more likely to be + alignment than indentation.
2009-10-25 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2009-10-26 15:45:12 UTC (rev 4370) +++ trunk/src/document.c 2009-10-26 18:13:50 UTC (rev 4371) @@ -1097,6 +1097,11 @@ gint pos = sci_get_position_from_line(sci, line); gchar c;
+ /* most code will have indent total <= 24, otherwise it's more likely to be + * alignment than indentation */ + if (sci_get_line_indentation(sci, line) > 24) + continue; + c = sci_get_char_at(sci, pos); if (c == '\t') tabs++;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.