Does anybody use tabs in the code editor? If yes, how do you do that?


Does anybody use tabs in the code editor? If yes, how do you do that?

In all my installations the following happens:

procedure bla;
begin
blub;

pressing enter results in

procedure bla;
begin
blub;


So, the tab remains, but the new line is indented by spaces.

I have enabled
Tools -> Options -> Editor Options -> Source Options
* Use tab character
* Show tab character
* Show space character

The example is in Delphi 10.2.2 but I have experienced the same behaviour in Delphi 2007 and XE2.

Comments

  1. I don't. Too many issues with too many editors and indentation settings.

    Tab handling has been broken in Delphi since, well maybe forever.

    ReplyDelete
  2. I'm asking because somebody reported a bug in the GExperts Code Proofreader Expert:
    sourceforge.net - GExperts / Bugs / #37 Code proofreader fails with tabs in line
    So for the first time in 25 years I have tried to use tabs in Delphi, and failed.

    ReplyDelete
  3. I avoid tabs as much as I can because of different settings on other computers and editors mess it up. But in your case shouldn't smart tab and optimal fill do what you want?

    ReplyDelete
  4. I use tabs but they don't always indent the text properly. I particularly like the feature when you select a line then you can shift-Tab the text to the beginning of the line and then indent it with a straight tab

    ReplyDelete
  5. Roland Bengtsson Hm, I didn't even know what "Optimal Fill" does, but apparently it replaces spaces by tabs + additional spaces if necessary. Smart Tabs doesn't matter in that case. Thanks, with Optimal Fill it is actually possible to use tabs.
    (Not that I will do that but it explains why the reporter was able to run into this problem at all.)

    ReplyDelete
  6. Thomas Mueller In the German IDE "Optimal Fill" is "Füllen mit Tabs".

    ReplyDelete
  7. Uwe Raabe Wow, the first time the translation is better than the original.

    ReplyDelete
  8. Thomas Mueller Optimal fill begins every auto-indented line with the minimum number of characters possible, using tabs and spaces as necessary. From:

    http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Source_Options

    I think I keep it on for most of my installs. I need to update Tokyo with my D6 settings.

    FWIW, I'm not a tab kinda guy. I tried it years ago.

    ReplyDelete

Post a Comment