Thread Tools Display Modes
09-13-08, 09:17 PM   #1
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
Lua syntax highlights for Notepad++, UltraEdit, etc.. + WoW Ace2 Ace3 API recognition

Last thread update: 05 July 2010



This is a project for World of Warcraft AddOn authors providing the LUA/XML syntax highlighting script updated for the major text editors, the project now supports Notepad++, UltraEdit, PSPad and RjTextEd

Notepad++ uses a homemade plugin based on External lexers and GmodLua, and I completely rewrote the folding procedures so they performs better on Lua code

The API extractions are now done automatically through an addon so I will provide more frequent updates, there is no more missing API and no more deprecated functions.

By default the text editors use the same colors:
  • COMMENTS: green
  • NUMBERS: orange
  • LUA INSTRUCTIONS: bold blue
  • LUA CONSTANTS: red
  • WOW GLOBAL FUNCTIONS: blue
  • WOW UIOBJECTS FUNCTIONS: soft blue
  • ACE2 FUNCTIONS/CONSTANTS: soft purple
  • ACE3 FUNCTIONS/CONSTANTS: purple
http://luawow.googlecode.com
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)

Last edited by Mera : 07-06-10 at 01:36 PM. Reason: link update, syntax updates, more editors, the API list is more accurate now and done automatically
  Reply With Quote
09-13-08, 10:07 PM   #2
Tristanian
Andúril
Premium Member
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 279
Very helpful, my old UltraEdit lua.txt was old as hell. Nice job Mera
  Reply With Quote
09-13-08, 10:19 PM   #3
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
Heh, I've been updating my UltraEdit wordfile a lot lately just getting ready for LK -- stunned at how much has been added since Capnbry's file ages ago.

Last edited by VincentSDSH : 09-13-08 at 10:22 PM.
  Reply With Quote
09-14-08, 01:40 AM   #4
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Very helpful, thank you.

I've been adding things to my own highlight file too but not a systematic effort.
This is a definite timesaver
  Reply With Quote
09-14-08, 04:38 AM   #5
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
At a glance I noticed one thing present in my personal file that's missing.
Maybe you'd like to add it.

Near the top of the lua section after the /delimiters /function string lines
I have
Code:
/Open Fold Strings = "{" "function" "then" "else" "do" "until" "for" "while"
/Close Fold Strings = "}" "end" "else" "elseif"
/Open Comment Fold Strings = "<<"
/Close Comment Fold Strings = ">>"
This makes it so you can collapse blocks
(and comment blocks if you put '<<' and '>>' inside block section,
especially handy for big comment blocks containing license, documentation etc)


I also noticed in the keywords section there's 'UIParent'.
Any reason for it?

Another little detail, you could add
** -0 -1 -2 -3 -4 -5 -6 -7 -8 -9
as a substring to any of your Cx color code sections so that negative numbers are colored as well.
(I usually make an extra color code group just for that but I see you've used the 8 allowed)

Last little comment/question (sorry )
I see a
Code:
Block Comment On Alt = --
near the start.
Does that take care of the limitation in UEdit regarding block/line comments that start with the same substring?
To clarify, if you input the -- line comment, block comments break as UEdit
stops processing the after '--' and '[[' part is ignored hence doesn't understand
it's the beginning of a block comment instead treats it as a line comment.

If the alternate block comment definition solves that; neat trick!
If not I used to differentiate the 2 by making a
Code:
Line Comment = ---
3 '-' instead of 2, it's still a valid lua line comment and I combine it with a macro
that I run on my .lua files replacing occurrences of '--' with '---' on first pass and then '---[[' with '--[[' (to restore block comments).

Last edited by Dridzt : 09-14-08 at 04:53 AM.
  Reply With Quote
09-14-08, 05:36 AM   #6
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
Thanks you all for the nice feedbacks I will of course update it to be even better with your help =)

Originally Posted by Dridzt View Post
At a glance I noticed one thing present in my personal file that's missing.
Maybe you'd like to add it.

Near the top of the lua section after the /delimiters /function string lines
I have
Code:
/Open Fold Strings = "{" "function" "then" "else" "do" "until" "for" "while"
/Close Fold Strings = "}" "end" "else" "elseif"
/Open Comment Fold Strings = "<<"
/Close Comment Fold Strings = ">>"
This makes it so you can collapse blocks
(and comment blocks if you put '<<' and '>>' inside block section,
especially handy for big comment blocks containing license, documentation etc)


I also noticed in the keywords section there's 'UIParent'.
Any reason for it?

Another little detail, you could add
** -0 -1 -2 -3 -4 -5 -6 -7 -8 -9
as a substring to any of your Cx color code sections so that negative numbers are colored as well.
(I usually make an extra color code group just for that but I see you've used the 8 allowed)

Last little comment/question (sorry )
I see a
Code:
Block Comment On Alt = --
near the start.
Does that take care of the limitation in UEdit regarding block/line comments that start with the same substring?
To clarify, if you input the -- line comment, block comments break as UEdit
stops processing the after '--' and '[[' part is ignored hence doesn't understand
it's the beginning of a block comment instead treats it as a line comment.

If the alternate block comment definition solves that; neat trick!
If not I used to differentiate the 2 by making a
Code:
Line Comment = ---
3 '-' instead of 2, it's still a valid lua line comment and I combine it with a macro
that I run on my .lua files replacing occurrences of '--' with '---' on first pass and then '---[[' with '--[[' (to restore block comments).
awesome dude I will work on all that, the option to open/close function is very awesome and helpful however I found a bug yet do you see why I'm unable to close the first function in this small test code

PHP Code:
function test:u()
    for 
ij in ipairs(a) do
        
local test
    end
    
for ij in ipairs(a) do
        
local test
    end
end 
With your script I can open close the second for loop but never the first one. I'm looking to find a patch but if you have one feel free to share =) Thanks again for the kind comments all, took me all day yesterday to revamp it

//EDIT: I think I have found the glitch, with "for" and "do" on the same line it is looking for 2x "end" statements and then breaking the open/close function, should be patchable that, will look closely the help file to check for possible workarounds
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)

Last edited by Mera : 09-14-08 at 05:56 AM.
  Reply With Quote
09-14-08, 09:17 AM   #7
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
Originally Posted by Dridzt View Post
I also noticed in the keywords section there's 'UIParent'.
Any reason for it?

Another little detail, you could add
** -0 -1 -2 -3 -4 -5 -6 -7 -8 -9
as a substring to any of your Cx color code sections so that negative numbers are colored as well.
(I usually make an extra color code group just for that but I see you've used the 8 allowed)
I have removed UIParent because I wsnt really sure if I need to highlight it, else I do not see what do you mean with numbers because I haven't defined rules for numbers because they are already handled by ultraedit and they are correctly highlighted with or without a - in front, not you ? maybe are you using an old uedit version me I have 14.10
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)

Last edited by Mera : 09-14-08 at 09:31 AM.
  Reply With Quote
09-14-08, 10:08 AM   #8
Mera
Retired of WoW, In ESO :)
 
Mera's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 331
I think that's why it fail on you because the highlight feature has changed since this old version

Originally Posted by Dridzt View Post
Last little comment/question (sorry )
I see a
Code:
Block Comment On Alt = --
near the start.
Does that take care of the limitation in UEdit regarding block/line comments that start with the same substring?
To clarify, if you input the -- line comment, block comments break as UEdit
stops processing the after '--' and '[[' part is ignored hence doesn't understand
it's the beginning of a block comment instead treats it as a line comment.

If the alternate block comment definition solves that; neat trick!
If not I used to differentiate the 2 by making a
Code:
Line Comment = ---
3 '-' instead of 2, it's still a valid lua line comment and I combine it with a macro
that I run on my .lua files replacing occurrences of '--' with '---' on first pass and then '---[[' with '--[[' (to restore block comments).
1)

not sure what you mean here but do you mean if I have a block like that for example

--[[
line1
line2
--line3
line4
line5
]]

you mean if the "--" will break the full block and the block will stops at line3 instead of line5 ? if that what you mean I have tested and "--" does not break the full block and what is commented is from line1 to line5

2) Else I have got the idea to add another section like /C8"WoW Default Frames" to highlight the calls of blizzard frames like UIParent, DessupFrame etc etc, dunno if thats a good idea , maybe too much , will add more apis anyway I have to browse blizz files now
__________________
If you need to reach me I'm in ESO, @class101 or "Fathis Ules i"
addons: SpamBayes, BrokerCPU
projects: ThunderBayes
Mera[xeh]? - La CroisadeEcarlate (wow)

Last edited by Mera : 09-14-08 at 10:41 AM.
  Reply With Quote
04-29-11, 12:36 PM   #9
Morsker
A Fallenroot Satyr
 
Morsker's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 22
I'm using Notepad++, and can't get user-controlled comment folding to work. It's supposed to be part of the GmodLua this is based off of.

At least this wiki page says
A line with either --{, --}, //{ or //} will also fold.
edit: I found the code responsible and WowLua doesn't use it because it rewrote the folding logic. I could add the feature back, if you have some information about how this is compiled, which version of Visual Studio, and what other projects it depends on. I know the C++, but not all the details of how the build environment is setup for this.

Last edited by Morsker : 05-16-11 at 12:32 PM.
  Reply With Quote
08-06-13, 09:01 AM   #10
mec666
A Deviate Faerie Dragon
 
mec666's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 13
any chance this will get updated anytime soon?
  Reply With Quote
07-18-14, 08:52 AM   #11
mec666
A Deviate Faerie Dragon
 
mec666's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2013
Posts: 13
still no updates?
the current notepad++ hates the plugin keeps saying its to old
  Reply With Quote
07-18-14, 04:55 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
It's been a year since you last necro-ed this thread, and it had been dead for a year before that, so I think it's safe to say that no, there are still no updates, and there aren't ever going to be any updates, so you should probably just give up already, unless you want to update the project yourself.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote

WoWInterface » Developer Discussions » Dev Tools » Lua syntax highlights for Notepad++, UltraEdit, etc.. + WoW Ace2 Ace3 API recognition


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off