Wasnt there this tool that autoreloads, parses errorlines in the autolog and jumps to that in notepad++? That with notepad always on top and spring windowed actually is the ide(al) dev enviroment.
You can use the NppExec plugin to parse errors from Spring or from "luac5.1 -p", the Lua compiler in syntax check mode. It can jump to errors lines too. You'll need to fiddle a bit with the options though.
A question to the more experienced devs - how do you refactor lua code? At least how do you deal with basic things such as renaming functions/methods/fields that span multiple files?
It's probably no surprise, but when you start writing lua for spring, especially if you haven't written much lua in your life, there are many things that you will do wrong.
I have a couple of global utility functions, such as "GetIndex(array, value)", "GetValuesWithName(array, name)", and even stuff more specific to my project, such as "MakeVariablePanel(parent, varType)", and later I've discovered you can prefix function names so you don't pollute the global namespace, by creating stuff like "SCEN_EDIT.MakeVariablePanel(parent, varType)" and so I need to rename those occurrences in many files, which is a bit annoying to do. Same thing applies to when I decided to move things into the global namespace with my "SCEN_EDIT." prefix instead of having it as a field in many objects.
Also how do you do the try/catch mechanics in lua? I've tried pcall but it seems weird, do you use that?
Joined: 17 Sep 2008, 03:36 Location: your imagination
I find a nice way to replace certain text in lots of files to be a nice simple sed (stream editor unix utility) 1-liner.
sed -i 's/OldText/NewText/g' *.lua
'-i' means it will overwrite the old file (instead of making a new one) 's' means substitute 'OldText' is the text you will find to replace 'NewText' is the new text you replace it with 'g' means global, so it will swap the text for all occurances, not just the first
*.lua is the target (so any files with the lua extension in the current directory)
If you check the manual or google you can expand or change the functionality as needed, like to make it run recursively and such.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum