Code Editor Tab vs. Indenting

Started by Paul Squires, January 26, 2010, 06:18:03 PM

Previous topic - Next topic

Paul Squires

I have modified the way that tab and indent works... well, changed it a little bit.

For example, if you define the Tab size to be 8 then pressing the Tab key will move the caret to every multiple of 8 positions. So, if you are at caret position 5 then pressing tab will take you to position 8. Before this change then it would take you to position 13 (ie. position 5 + 8 spaces). This previous functionality is still available in FireFly. Right below the textbox where you enter the Tab Size is a new checkbox called: "Treat tab as indent spaces".

This change will be in v3.07.
Paul Squires
PlanetSquires Software

Roger Garstang

How hard would it be to store as tab chars, but expand to spaces this way. Then if someone has theirs setup for 8 space tabs and you have 3 space then each will see the source file the way they like and when copy/pasting between two different size files it won't paste as 3 when you needed 4, etc.  I had this issue a lot in FF2 where work PC was set to 3 spaces and home at 4 or something and copy/paste never positioned the text right.  It would save file size too using what PB Bob called Tab Compression so spaces are just shown, not saved. If the code has multiple spaces at the beginning of lines from manually typing or pasting from another source you could even parse it out and store the number of tabs needed to space that far and any extra add spaces it not a full tab.  Just the beginning of the line too, not anywhere else.

Robert Rioja

I hate the way FF 3 does tabbing.  I agree with Paul that the way he proposes doing it in 3.07 is much better.  I also agree with Roger that a tab is a tab, not a bunch of spaces.  In my opinion, good text editors accept the tab as a way of positioning, not as a short cut for multiple spaces.  It is up to the user to select the tab positions (multiple of 3 or some other number) when setting up the editor's options.

Robert