How to disable autocomplete code statements in code editor?
Asked Answered
Q

3

5

Every time I type if and press the space bar, Delphi completes it with if True then and a new empty line above.

Is there a way to remove this "autocomplete" feature or at least edit it to not create the new line?

Quoth answered 24/5, 2013 at 14:54 Comment(0)
M
6

That's called a live template, and you can edit the list of live templates in the template window, from the View menu.

Find the template you don't like, select it, and click the "remove template code" button.

Mycenae answered 24/5, 2013 at 15:3 Comment(2)
Yes, I could edit it and remove the unnecessary empty line, which was there because a word wrap in the XML text.Quoth
Then save all, exit the IDE and go back. +1, this was bothering me also on a reinstall.Temptation
O
12

From the Tools | Options | Editor Options | Code Insight menu, deselect the Auto complete check box under Code template completion.

enter image description here

Once you disable template auto complete then you need to manually invoke the template if you want it. Do that with CTRL+J.

Orangewood answered 24/5, 2013 at 15:3 Comment(2)
for Delphi 10.4, it's under Tools | Options | User Interface | Editor | Source, hidden in the Code Insight tabIsiahisiahi
Note: In the try of disabling autocomplete, I just switched "Code insight manager" to "none". This will enable some of the auto-completions, so make sure you keep "Delphi (....)" selected there.Altostratus
M
6

That's called a live template, and you can edit the list of live templates in the template window, from the View menu.

Find the template you don't like, select it, and click the "remove template code" button.

Mycenae answered 24/5, 2013 at 15:3 Comment(2)
Yes, I could edit it and remove the unnecessary empty line, which was there because a word wrap in the XML text.Quoth
Then save all, exit the IDE and go back. +1, this was bothering me also on a reinstall.Temptation
P
0

Since the default location for the live code templates is C:\Program Files (x86)\Embarcadero\Studio\16.0\ObjRepos\en\Code_Templates (for XE8, similar for other editions), you will need to change the permissions on this directory (and its subdirectories) in order to edit or add live templates. Default permissions do not include write permission to this directory.

Parra answered 28/9, 2016 at 13:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.