Bug 67448 - Indentation should be project option, not global option
Summary: Indentation should be project option, not global option
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Astyle (show other bugs)
Version: git master
Platform: Compiled Sources Linux
: NOR wishlist with 45 votes (vote)
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
: 69470 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-11-06 22:30 UTC by Jon Smirl
Modified: 2007-02-15 15:10 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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. :-)

Thanks!
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
Megan,

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;
or 
kate: space-indent off; tab-indent on; tab-width 4; indent-width 4; replace-tabs off; eol unix;