Let's end the formatting mess
david.nolden.kdevelop at art-master.de
Thu Nov 10 20:01:47 UTC 2011
2011/11/10 Milian Wolff <mail at milianw.de>:
> Forwarding to devel list again.
> On Thursday 10 November 2011 20:25:09 David Nolden wrote:
>> 2011/11/10 Milian Wolff <mail at milianw.de>:
>> > On Thursday 10 November 2011 17:42:09 David Nolden wrote:
>> >> 2011/11/10 Milian Wolff <mail at milianw.de>:
>> >> > Yes but that requires work on Kate to be able to read/write the editor
>> >> > settings. Which is not yet possible, but another long standing wish
>> >> > request.
>> >> I've just seen that all these things can be sent to kate through the
>> >> CommandInterface, eg. "set-indent-length 2" and "set-replace-tabs
>> >> true" lead to standard 2-space indentation.
>> > True, but this is pretty hackish and can break easily in the future
>> > without us getting notified via compile issues...
>> > Menaing: I still think it is required to get a proper editor interface for
>> > this.
>> Meanwhile I've implemented this. Now the user simply has to edit the
>> source-formatter settings, and the editor settings are adapted
>> automatically. The only problem is that modelines are re-evaluated
>> after every saving, so wrong modelines will lead to wrong indentation
>> after the first save. However, reformatting now also fixes modelines
>> even if "Add Kate Modeline" is not checked.
>> I think we have a great overall source-formatting support now.
> I have yet to try it out, but modelines should always take preference over
> session-wide formatter settings as there is no other way to set custom
> settings for just one file or just one sub dir otherwise.
The "format_sources" files allow specifying formatting options also on
a directory or file level. For the astyle settings it's true though,
so maybe the settings should only be overridden if there's no
More information about the KDevelop-devel