Spaces to Tabs lazarus / 9-Editor ---------------------------------------------------------------------- lt.col.blair · 2011-07-14 07:52 Hi, since I prefer tabs to indent my code, I wonder, whether there is a way to tell Lazarus to use Tabs wherever possible. I use the following settings: Auto Indent on Smart Tabs off Tabs to Spaces off Block Indent 2 Tab Width 2 Auto Indent Mode: Space/Tab I edited the indentation example file so that all indentations in that file are made with tabs. Still all indentions in new lines are made with spaces - even if the indention in the previous line is made with tabs - and if I start editing a line beyond it's line end, the space is filled with spaces (nice pun, eh? ). If this is a feature and not a bug, I would like to vote for a "SpacesToTabs" function as a reverse to "TabsToSpaces". ---------------------------------------------------------------------- Martin_fr · 2011-07-14 10:45 There are 2 indent modes: The editor itself which uses a constant indent. It adheres to the "copy tabs last line" Codetools (configure under codetools/generic) which increases/decrease indent after begin/end,etc... No idea, how/if it works with tabs. If you have the codetools feature on, it overrides the editor's build- in indent. ---- Also note that trim spaces, must not be set to "position only" as explained here: http://wiki.lazarus.freepascal.org/IDE_Window:_Editor_ Options_General_Misc#Trim_trailing_spaces That is also what happens if you insert text, behind the end of line. You can add feature request if you want, but please make sure that the following a different features 9not to be reported into one issue): - Codetool indent to use tabs (IF it can not already be configured to do so, which I do not know). - The editor to convert space to tabs. This will not affect any source inserted by codetools, but ONLY act on user-typed text. I can see 2 scenarios, that would trigger. a) Fill behind end of line with tab/space mix (that would be an extension to trim spaces) b) if you got (tab-width = 4), the text of 3 spaces (starting at a tab pos) and you type one space, then the one space you type, converts the 3+1 to 1 tab... Top be honest, b isn't a likely feature... ---------------------------------------------------------------------- lt.col.blair · 2011-07-14 14:09 You're right, it is the CodeTools indention for pascal source that overrides the editor's default behaviour. I disabled it and - voila - the indentation worked like described. In that case I prefer using spaces in my code over losing the good CodeTools auto indent features.