void CodeEditorComponent::State::restoreState (CodeEditorComponent& editor) const
{
    editor.selectRegion (CodeDocument::Position (editor.getDocument(), lastSelectionEnd),
                         CodeDocument::Position (editor.getDocument(), lastCaretPos));

    if (lastTopLine > 0 && lastTopLine < editor.getDocument().getNumLines())
        editor.scrollToLine (lastTopLine);
}
void CtrlrLuaMethodEditor::searchResultClicked (const String &methodName, const int lineNumber, const int resultPositionStart, const int resultPositionEnd)
{
//	_DBG("CtrlrLuaMethodEditor::searchResultClicked");
//	_DBG("\t"+methodName+" ln:"+STR(lineNumber)+" s:"+STR(resultPositionStart)+" e:"+STR(resultPositionEnd));

	CtrlrLuaMethod *method = getMethodManager().getMethodByName(methodName);
	if (method != nullptr)
	{
		setEditedMethod (method->getUuid());

		if (method->getCodeEditor())
		{
			CodeEditorComponent *ed = method->getCodeEditor()->getCodeComponent();
			CodeDocument &doc		= method->getCodeEditor()->getCodeDocument();
			if (ed)
			{
				ed->selectRegion (CodeDocument::Position(doc,resultPositionStart), CodeDocument::Position(doc,resultPositionEnd));
			}
		}
	}
}