Posted 17 June 2014 - 07:47 PM
Yeah, this is for Notepad++ users only. Don't hate me.
Scrolling, scrolling and more scrolling. That's what you do when you have a big project and the source files keep growing. Notepad++ offers us the Function list, which allows us to jump around from function to function. The only problem is, it doesn't have a clue about Lua's syntax. So no Function list for Lua. What a pity.
Solving that little problem is what this topic is about.
Scrolling, scrolling and more scrolling. That's what you do when you have a big project and the source files keep growing. Notepad++ offers us the Function list, which allows us to jump around from function to function. The only problem is, it doesn't have a clue about Lua's syntax. So no Function list for Lua. What a pity.
Solving that little problem is what this topic is about.
Do it the easy way
Download this and overwrite %appdata%\Notepad++\functionList.xml with it.Do it the hard way
Open your functionList.xml (%appdata%\Notepad++\functionList.xml), insert the node below into NotepadPlus.functionList.associationMap:<association langid="23" id="lua_function"/>
and the the node below into NotepadPlus.associationMap.parsers:<parser id="lua_function" displayName="Lua" commentExpr="((--\[=*\[.*?)\]=*\]|(--.*?$))">
<function
mainExpr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|function\s+([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?[_A-Za-z][\w_]*\s*\("
displayMode="$className->$functionName">
<functionName>
<nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|\s([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?[_A-Za-z][\w_]*\s*\("/>
<nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|[_A-Za-z][\w_]*\s*\("/>
<nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|[_A-Za-z][\w_]*"/>
</functionName>
<className>
<nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|\s([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?[_A-Za-z][\w_]*\s*\("/>
<nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|\s([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?"/>
<nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|([_A-Za-z][\w_]*\.\s*)*([_A-Za-z][\w_]*[\.:]\s*)?"/>
<nameExpr expr="function\(\s*(([_A-Za-z][\w_]*|\.\.\.)\s*,?\s*)*\)|([_A-Za-z][\w_]*\.\s*)*[_A-Za-z][\w_]*\s*[\.:]"/>
<nameExpr expr="function|([_A-Za-z][\w_]*\.\s*)*[_A-Za-z][\w_]*\s*"/>
</className>
</function>
</parser>
(The editor on the forum might have messed this up; if it has, well, I'm sorry.)Edited on 17 June 2014 - 08:16 PM