| 218 | } |
| 219 | |
| 220 | void CtrlrLuaMethod::triggerSourceChangeFromEditor(const bool recompile) |
| 221 | { |
| 222 | if (methodCodeEditor == nullptr || methodCodeEditor.wasObjectDeleted()) |
| 223 | { |
| 224 | jassertfalse; // no editor and we got a trigger from it ? that's just fucked up |
| 225 | return; |
| 226 | } |
| 227 | |
| 228 | if (isSourceInFile()) |
| 229 | { |
| 230 | // replace the contents of the file with the editors content |
| 231 | getSourceFile().replaceWithText (methodCodeEditor->getCodeDocument().getAllContent()); |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | // replace the contents of the property with the editors content |
| 236 | methodTree.setProperty (Ids::luaMethodCode, methodCodeEditor.get()->getCodeDocument().getAllContent(), nullptr); |
| 237 | } |
| 238 | |
| 239 | if (recompile) |
| 240 | { |
| 241 | // we need to recompile our code |
| 242 | setCodeInternal (getCode()); |
| 243 | } |
| 244 | else |
| 245 | { |
| 246 | errorString.clear(); |
| 247 | errorString.append (Time::getCurrentTime().formatted (getName()+" saved at %m/%d/%y %H:%M:%S\n"), out, Colours::black); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | int CtrlrLuaMethod::getCodeSize() |
| 252 | { |
no test coverage detected