An Air Manager syntax Highliter for Notepad++

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Message
Author
JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

An Air Manager syntax Highliter for Notepad++

#1 Post by JackZ »

---------------------------------
Edit:
version 1.10: added color syntax to Block comment
version 1.20: added full set of Lua Math and string functions (hopefully)
version 1.30: added the reserved keywords for new API functions in 3.0 (mainly hardware)
version 1.50: corrected the "folding" behaviour of function definitions. You can collapse each function by clicking on the + sign at the beginning of the line
version 1.70: Added all the reserved keywords for the new API functions in AM 3.00 and up to 3.6
version 1.80: Added the new reserved keywords for the API functions in AM 3.50 and up to 3.6, including the Flight Illusion keywords
version 1.90: Added the new reserved keywords for the API functions in AM 4.0 and up to 4.2, including the device() keywords

---------------------------------
Hello to all

I have setup a XML User Defined Language File for the Notepad++ text Editor https://notepad-plus-plus.org/, that allows a syntax highlighting of all Lua functions as well as all the specific AM functions of the API.
Here's the File for those interested. Please let me know if I forgot a keyword!

Air Manager (Lua)1.9 (AM4.2& up).zip
(2.74 KiB) Downloaded 48 times

How to use:
--------------
1- Download the latest version of the .zip file and extract the "Air Manager(Lua).XML" file somewhere in your computer.
2- Launch Notepad++ and select the "Language/Define Your language..." menu.
A new Panel appears.
3-Click on the "Import..." button and browse your computer for the location of the XML file, select the desired file and Click "Open".

Now the Air Manager language is setup and each specific keyword should "automagically" be highlited with different colors to ease reading.

Note 1:
--------
In case Notepad++ doesn't switch automatically to "Air manager(Lua)" language , make sure that:
1- You have restarted Notepad++,
2- You have selected "Air Manager (Lua)" in the "Language" Menu
Note 2:
---------
If you want to change the colors, you can do that for each group of keywords/separator in the "Language/Define Your language" submenu.

Jacques
Attachments
Air Manager(Lua)1.8 .zip
(2.61 KiB) Downloaded 274 times
Air Manager(Lua)1.7.zip
(2.19 KiB) Downloaded 291 times
Air Manager(Lua)1.5.zip
(1.88 KiB) Downloaded 292 times
Air Manager(Lua)1.3.zip
(1.86 KiB) Downloaded 297 times
Last edited by JackZ on Sat Jul 29, 2023 1:23 pm, edited 23 times in total.
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
Ralph
Posts: 7924
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: An Air Manager syntax Highliter for Notepad++

#2 Post by Ralph »

I've changed the extension setting for XML, now it should be possible to upload a XML.

JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Re: An Air Manager syntax Highliter for Notepad++

#3 Post by JackZ »

Great thanks! First post modified

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
Ralph
Posts: 7924
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: An Air Manager syntax Highliter for Notepad++

#4 Post by Ralph »

Very nice! I'm gonna try it out next week.

User avatar
russ
Posts: 593
Joined: Tue Oct 27, 2015 5:37 pm

Re: An Air Manager syntax Highliter for Notepad++

#5 Post by russ »

JZ

Very nice. Thanks a lot.
Russ Barlow
Air Manager Evangelist

flyatr
Posts: 300
Joined: Tue Dec 01, 2015 8:53 am

Re: An Air Manager syntax Highliter for Notepad++

#6 Post by flyatr »

Great, thank you!
I'm curious, what do the different colors mean for the Air Manager functions?

JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Re: An Air Manager syntax Highliter for Notepad++

#7 Post by JackZ »

Well they mean not that much :mrgreen:
As far as I recall, apart the Lua functions group, I grouped the AM functions in three groups: the text and image functions group, the Xplane variable function group and the Fsx subscribe functions group.

Feel free to modify the colors/group to your taste, by entering in the "Language/Define your language" menu, by selecting the Air Manager(Lua) language file, and in the "Keywords" tab, by moving keywords from one group to another. Press the "Style" button above each keyword group to change the color and style of the text.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Re: An Air Manager syntax Highliter for Notepad++

#8 Post by JackZ »

Well, I checked again my setup and to be more precise in my answer to Flyatr, I subdivided the color codes as follow:

1 st group: Lua reserved keywords such as: function, end, if then,...
2nd group: Lua string & math functions (including var-cap and geo_rotate (BTW some Lua Math functions seldom used maybe missing, pls let me know))
3rd group: AM Xplane subscribe functions
4th group: AM FSX subscribe functions
5th group: AM variable subscribe functions
6th group: AM helpers functions (group, timer, persist, nav get, resource_info, ...)
7th group: AM image & text functions
8th group: AM dial and buttons functions

Phew....More groups and colors than I recalled first, in fact :o ...
As said earlier, modify to your taste by pressing the "Styler" button above each group, in the "Keywords Lists" tab of the User Defined Language popup available under "Language/Define your language" menu in Notepad ++

I also discovered a new way to comment a large block of lines by using the --[[ and --]] tags.
Can be done in one click in Notepad++: Select the block of lines, then right click and select "Block Comment/Uncomment" which will type the proper tags for you
All the lines inbetween the two tags should turn green and be ignored by the Lua interpreter.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

JackZ
Posts: 2267
Joined: Mon Feb 22, 2016 1:02 pm

Re: An Air Manager syntax Highliter for Notepad++

#9 Post by JackZ »

A new version of the Airmanager syntax Highlighter for Notepad++ is available (version 1.30).
Added the new API functions (mainly related to hardware) pertaining to the 3.0 version.
You'll find it at the very first post of this thread.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
russ
Posts: 593
Joined: Tue Oct 27, 2015 5:37 pm

Re: An Air Manager syntax Highliter for Notepad++

#10 Post by russ »

Thanks Jacques as I find this a very useful tool. I catch mistyped API functions right away when they don't highlight.
Russ Barlow
Air Manager Evangelist

Post Reply