Jump to content
mikerabat

Tab key in the IDE

Recommended Posts

I'm puzzled... Since Delphi 11 the tab key does not work as it has been the case in all

the previous versions... I tried to setup the editor options the same way as my Delphi 2010 (or 10.4)

installation but the tab key behaves differntly....

 

What I actually want is that when I press tab the cursor shall be placed after the last non whitespace from the previous line

e.g.
if you have

var i : integer;

begin

|<- cursor here

now when pressing tab the cursor shall jump the character after the n

 

Also in Delphi 2010 it was standard if:

 

 if abc then

 begin

         while i < 10 do

         begin

|<- e.g.: cursor here

         end;

 

 

now the first tab jumps just right below the b of begin, a second tab to the end of begin

 

That was standard for us for up until Delphi 10 ... but now in Delphi 11 I cannot get this working.

it either works or it jumps the number of characters that has been defined in the TabStop field.

 

anyone has a clue what there coudl be the problem?

 

A also have DDevextensions and gexperts installed....

 

kind regards

   Mike

 

 

Share this post


Link to post

sorry that doesn't help ... I have to hit tab quite often such that it jumps to the desired place.

Anyone else that has problems with that? Or ... does anyone excatly know what changed in this version?

 

 

Share this post


Link to post

it would be this:  RAD 11.2 Alexandria!

 

image.thumb.png.3ecc83803c7df792670bca804b17ed04.png

 

if not, try this:

  • on RAD 10.4 save your profile (whole) ... using "migrationtool.exe"
  • on RAD 11 do the same, and compare the values using "Beyond Compare" -- Edit->Compare->Beyond Compare
Edited by programmerdelphi2k

Share this post


Link to post

Sorry... the tab key is broken or at least behaves completly different than in Delphi 2010 (or afaik Delphi 10.4) which is ... anoying.

e.g.:

Consider the following code

 Result := Format('%s;%s;%s', [
                           DateToStr( fDay, Fmt),
                           TimeToStr( fFrom, Fmt ),
                           TimeToStr( fTo, Fmt )  ]);

 

when you place the cursor just behind the '[' bracket and then press enter the cursor is placed just below the R of Result... so far so good.

But... In previous Delphi versions - when tab is invoked - the cursor jumps to the ":" then to "F" of format. Now the tab just moves the cursor

by 2 (acording to the setting) which is actually anyoing.

 

Another case: Consider the following code (we like to have the then else block that way in case the statement is only one line aka without begin end):

if fLunchLen > 0.01
then
       Result := Result + Format(';%s;%.1fh', [TimeToStr(fLunch, Fmt), fLunchLen], Fmt)
else
      Result := Result + ';;'; // no free lunch... it bloody friday!

 

When you place the cursor behind then, press enter -> press tab in previous delphi versions the cursor was placed just right below the then... now it only jumps by 2.

 

any comments on how to get that old behaviour back is highly appreciated...

 

kind regards

  Mike

Share this post


Link to post
45 minutes ago, mikerabat said:

In previous Delphi versions - when tab is invoked - the cursor jumps to the ":" then to "F" of format. Now the tab just moves the cursor

by 2 (acording to the setting) which is actually anyoing.

I can verify the expected behavior from previous versions with the following settings in Editor options - Language (Delphi):

image.thumb.png.8e719c35670c5deb5f353807542dc5f9.png

 

07-12-2022_15-13-24.thumb.gif.327b7274083e5ecac9818ee0206c7e32.gif

 

Disabling Smart tab results in the annoying behavior you describe.

 

Embarcadero® Delphi 11 Version 28.0.46481.1287 

 

Share this post


Link to post

That is actually interesting... If I use the same settings I got a different result (aka the annoying one). (sorry I cannot create such a neat little

video 🙂 )

I'll check if GExperts or DDevextension interfere here...

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×