Bug 67448

Summary: Indentation should be project option, not global option
Product: [Applications] kdevelop Reporter: Jon Smirl <jonsmirl>
Component: AstyleAssignee: KDevelop Developers <kdevelop-devel>
Severity: wishlist CC: kdeveloper.megan, richard, sebas, wstephenson
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jon Smirl 2003-11-06 22:30:58 UTC
Version:           CVS (using KDE Devel)
Installed from:    Compiled sources

I am working on serveral Open Source projects and they are all using different indentations. It would be nice to all setting indent size and 'tabs or space' as a project option. Right now I have to adjust this manually when I switch projects.

An added bonus would be to have a hot key for running 'indent' with per project rules. These rules would take into account the project indentation setting and language.
Comment 1 ptruog 2003-11-12 23:04:17 UTC
I disagree.  I think that this setting should be global as the default behavior, with a per project setting to override global option if one exists.

Comment 2 Amilcar do Carmo Lucas 2003-12-01 22:41:23 UTC
*** Bug 69470 has been marked as a duplicate of this bug. ***
Comment 3 Jon Smirl 2004-01-02 05:05:05 UTC
Also, there should not be separate controls for indentation in the source formatter and editor. This should be a single setting per project, with a global default.
Comment 4 Sebastian K├╝gler 2005-02-10 16:34:45 UTC
I'd also very much appreciate to be able to set indentation style on a per-project basis. I'm working on different (Python & PHP) projects at the same time, and I have to change "Use spaces instead of tabs to indent" everytime I switch between those project. Since I'm lazy, I'd like to have that done automatically. :-)

Comment 5 Megan Webb 2006-12-03 19:58:55 UTC
SVN commit 610150 by webb:

BUG: 67448
Include the project level formating options.
Corrected bug with formatting options being lost.

 M  +1 -1      Makefile.am  
 M  +25 -32    astyle_adaptor.cpp  
 M  +6 -2      astyle_adaptor.h  
 M  +127 -17   astyle_part.cpp  
 M  +23 -2     astyle_part.h  
 M  +123 -89   astyle_widget.cpp  
 M  +2 -2      astyle_widget.h  
 M  +21 -0     astyleconfig.ui  
Comment 6 Will Stephenson 2007-02-15 14:03:50 UTC

I'm not sure how to make use in 3.4.0 of the feature introduced by your commit .  I have chosen, in Project->Project Options, Formatting, 'User defined' and chosen to use spaces instead of tabs for a project that uses that formatting (kaddressbook), but the behaviour of both the tab key and the automatic indentation on newline comes from the Settings->Configure Editor...->Indentation settings config.  

Can you explain how to use it?  As I'm always bugfixing different KDE apps at work it would be very helpful to not have to change expandtabs by hand all of the time.
Comment 7 Will Stephenson 2007-02-15 15:10:58 UTC
Ok, Andreas Pakulat explained to me on IRC that "the formatting options can obly be applied by using Reformat Source in the Edit menu; that will either reformat the whole current file according to the options set, or the selection that is active.  Indentation/formatting while typing is solely done by kate and its indenter sucks a bit."

Adymo solved it for me by pointing me at http://kate-editor.org/article/.kateconfig and saying that setting the 'search depth for config file' in Configure Editor...->Open/Save to some value large enough that Kate will find a .kateconfig file in the root of the svn module, for any source file in the module - kate starts its search in the directory where the file being opened is located.

My .kateconfigs contain either
kate: space-indent on; tab-width 2; indent-width 2; replace-tabs on; eol unix;
kate: space-indent off; tab-indent on; tab-width 4; indent-width 4; replace-tabs off; eol unix;