I suspected some misunderstanding.
Now lets get some feedback, on how could the names (and grouping) of them be improved.
And also the help:
https://wiki.lazarus.freepascal.org/IDE_Window:_Editor_Options_General#Indent_and_TabsOne issue is the difference between
- tab-width (or tab-stop-every-n / at which columns tab-chars do stop)
- tab-char (the actual #9 in the text)
- tab key (that may or may not insert #9)
- space: the space char #32 or the amount of column in tab-width
So the combobox "Tab width" indicates at which columns there is a tab stop. Technically its "Tab stop distance" (but that is imho a bad name).
The 2 combo boxes that confused you "Block indent (tabs)" and "Block indent (spaces)" refer to the amount of #9 and #32 that are inserted. (So if you insert several #9 then that is several tab stops).
I guess you thought, it means: insert X tabs, each of a width of N spaces. But that can't be, because tabs inserted by this must have the same width as any other tab, after all, once they are inserted, they are a #9 with no knowledge what inserted them.
To complicate matters, SynEdit support something called "elastic tabs" where the tab width dynamically changes depending on the text in the surrounding lines. (a bit like a html table).
In that case "Tab width" becomes sort of a "minimum tab width" (one of 2 minimums)
"Tab width": minimum, counted from the previous tab stop
"Elastic min width": minimum, counted from the end of the text before the #9 (i.e. minimum amount of columns that are blank)
With a "tab width"=4 and "elastic min" =2, the text
The first tab can not be at pos 4, because the text FooBar has 6 chars, and would not fit, so it would the first tab stop would be at 7 (making the tab 1 column).
But because of "elastic min"=2, it gets further pushed to 8, so the tabstop actually will be at 8.
If the text was
then the first tab stop can be at 4. Forced by "Tab width", and if "Tab Width was 1, then the first tab stop would be at 2 (assuming "elastic min"=1), or at 3 (for "elastic min"=2).
And there is "smart tabs" which will fill the line with #9 and #32 to align with the next column of the line above.
Pressing tab-key ( | = caret pos), will fill the line with #9 and #32 to match the position at the start of "Bar".
This will search multiple lines above, if the line directly above is too short.
But even in this mode, if #9 are used (if "Tabs to spaces" is off), the setting of "Tab Width" still matters. (and if changed, the alignment is lost).
So consider all that, how to best display?
- "Tab Width" (better name???)
- "Tab to spaces"
affect every mode/setting (Not sure have to test block indent...)
So those 2 should be an the very top.
* "Elastic tab" and "Elastic min" could get their own section
* "Smart tabs", not sure...
- A section for the one setting only? Not really.
- Put it with "Tab width" as current? But it does not affect "Block indent"
- Maybe put it with "Elastic"? Name the section "Tab mode" ? (name suggestions welcome)
- ?
* Auto indent (on line break, have to check if there are other triggers)
Another section?
Should be different from "Block indent
* And at last, a section only "Block indent"
But that still does not explain that "Block indent (tabs)" is the count of tab chars, using the tab width from the very first section.
And with all that I still left out, moving the tab settings from codetools to this page. But that requires more work, than any of the above. The above is just moving controls in the form designer.
Moving the codetools stuff needs code in other units to be changed, so it saves the correct settings. Otherwise settings can get lost...