Center script line when double clicked on error in debugger

This commit is contained in:
Dawid Wdowiak 2019-01-04 13:09:01 +01:00 committed by Dawid Wdowiak
parent 4d6ad16ac4
commit 0f14489ecb
6 changed files with 17 additions and 1 deletions

View file

@ -306,8 +306,11 @@ void ScriptEditor::_goto_script_line(REF p_script, int p_line) {
editor->push_item(p_script.ptr());
ScriptEditorBase *current = _get_current_editor();
if (current)
if (ScriptTextEditor *script_text_editor = Object::cast_to<ScriptTextEditor>(current)) {
script_text_editor->goto_line_centered(p_line);
} else if (current) {
current->goto_line(p_line, true);
}
}
}
}