View Issue Details

IDProjectCategoryView StatusLast Update
0020256LazarusIDEpublic2011-11-07 04:03
ReporterGraeme Geldenhuys Assigned ToMartin Friebe  
Status resolvedResolutionfixed 
Platformx86_64OSUbuntu Linux 
Product Version0.9.31 (SVN) 
Fixed in Version0.9.31 (SVN) 
Summary0020256: Block indent via Tab key always inserts spaces
DescriptionI have Tabs enabled - instead of Spaces in my Sourcecode Editor settings.
Indenting a single line by using the Tab key works correctly by inserting a Tab character. As you can see in the attachments, the tab character is shown with the >> symbol.

But when I do Block Indentation [also using the Tab key], then spaces are ALWAYS inserted, instead of the Tab characters.
TagsNo tags attached.
Fixed in Revision33382
Attached Files


2011-09-15 14:19


Screenshot-IDE Options.png (21,777 bytes)   
Screenshot-IDE Options.png (21,777 bytes)   

2011-09-15 14:19


Screenshot-Source Editor.png (3,162 bytes)   
Screenshot-Source Editor.png (3,162 bytes)   

Martin Friebe

2011-11-07 04:03

manager   ~0053876

The "copy space and tabs" option only affects auto-indent. It was however mislabelled, and placed apart from this option.
Auto-indent only acts on newly inserted lines, and does not have to deal with pre-existing tabs or spaces on that line.


Block intend does have to deal with this.
Therefore the existing block indent inserted new spaces always at the end of the leading white-spaces. So they would not disappear into a tab (inserting 2 spaces in front of a tab (w=4) would not necessarily move the text behind the tab.


In order to implement any indent-block-by-tabs features, there were 2 possibilities:
- a new option, indicating, that the spaces in the block-indent field should be converted to tabs
- allow the user to directly specify the amount of tabs

I believe the 2nd to be more flexible, so I have added an option to allow specifying the amount of tabs (and set spaces to 0)

Tabs and spaces can also be mixed (e.g 1 tab + 2 spaces)


The following behaviour is now expected:

* On indent:
- spaces are inserted at the end of the existing leading space/tab mix
- tabs are inserted at the very begin of the line (before the existing mix)

* On unindent:
- spaces are removed from the end of the existing leading space/tab mix
  If the to be removed part contains tabs, then they are first replaced by spaces.
  The unindent then removes from those replaced spaces
- tabs are removed from the very begin of the line (before the existing mix)
  if there are spaces at the start at the line then unindent removes tab-width amount of spaces for each to-be-removed tab
  If the spaces are leading into a tab, half way through then the tab (and the spaces that are in the tab0 are removed. (1 tabwidth worth of white-spaces)


Please close if ok

Issue History

Date Modified Username Field Change
2011-09-15 14:19 Graeme Geldenhuys New Issue
2011-09-15 14:19 Graeme Geldenhuys File Added: Screenshot-IDE Options.png
2011-09-15 14:19 Graeme Geldenhuys File Added: Screenshot-Source Editor.png
2011-09-15 14:23 Martin Friebe Status new => assigned
2011-09-15 14:23 Martin Friebe Assigned To => Martin Friebe
2011-11-07 04:03 Martin Friebe Fixed in Revision => 33382
2011-11-07 04:03 Martin Friebe LazTarget => 0.99.0
2011-11-07 04:03 Martin Friebe Status assigned => resolved
2011-11-07 04:03 Martin Friebe Fixed in Version => 0.9.31 (SVN)
2011-11-07 04:03 Martin Friebe Resolution open => fixed
2011-11-07 04:03 Martin Friebe Note Added: 0053876
2011-11-07 04:03 Martin Friebe Target Version => 0.99.0