Page 1 of 1

Configuring Code Completetion

Posted: Wed May 08, 2019 1:19 pm
by emollusc
Hi, I hope somene can help...

When writing C++ code I would like to edit the default behaviour of the code completion. For example when typing

#include

the I get the following

#include ""

where I want

#include <>

or nothing as I am able to type the <> comands quite quickly. As yet I've not found any way to edit this behavior and would appreciate some help.

Brian

Re: Configuring Code Completetion

Posted: Thu May 09, 2019 12:26 am
by jussij
Hi Brian,
When writing C++ code I would like to edit the default behaviour of the code completion.

This default C++ code completion is found here:

1. Options, Editor Options, Document Types menu
2. C/C++ Document Type
3. Templates
4. 'Include Headers' Smart Template

All the if, for,while, switch, case etc C/C++templates are define here.

So if you decide you want to make big changes to all these templates I would recommend doing this:

1. Export the current setting using the Backup button
2. Backup that export file just in case
3. Edit the export file and then just do a import which will replace the current templates

Now back to your question.

The behaviour you are seeing is defined by the following template found in that list of templates:

Code: Select all

        Keyword: #include
      Menu Text: Include Headers
 Expansion Text: $MacroExecute<includes.lua>

What this all means is as follows:

1. The template is trigger by the #include text
2. The Menu Text is the text displayed in the menu/navigator panel
3. The Expansion Text is what is used to replace the trigger

In this case the expansion text is running the includes.lua macro.

To open that macro file type this text into a new Zeus document:

Code: Select all

zScript\includes.lua

Next, place the cursor on that line and use the View, Open File menu to open the file.

In that macro you will see this text in a few places:

Code: Select all

-- fire off the default text
output_buffer("#include \"\\c\"")

Change that text to be:

Code: Select all

-- fire off the default text
output_buffer("#include <\\c\>")

That will need changes to lines 88, 99, 109 , 113, 117 and 121.
or nothing as I am able to type the

You can naturally configure it to this as well.

FYI the \c in that text represents the final cursor location.

Cheers Jussi

Re: Configuring Code Completetion

Posted: Thu May 09, 2019 11:07 am
by emollusc
Hi Jussi,

thanks for the comprehensive reply,

Brian