summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-04-30 10:53:23 +0200
committerGitHub <noreply@github.com>2019-04-30 10:53:23 +0200
commit5313ce232dc81ed454d1ee7de6da84336e4ff30c (patch)
treec6f36bcb82e35646ba993e5d02a935da9ca8646d
parentceebd748b94a3ba5d294b24a863a9e9c70a1b721 (diff)
parentd87021de93a2620de3a2a13815d37ebd484fc545 (diff)
Merge pull request #27870 from mawenzy/pr_gotoline
Bind goto_line function for Script Editor
-rw-r--r--doc/classes/ScriptEditor.xml9
-rw-r--r--editor/plugins/script_editor_plugin.cpp1
2 files changed, 10 insertions, 0 deletions
diff --git a/doc/classes/ScriptEditor.xml b/doc/classes/ScriptEditor.xml
index 666ab15802..28e1f75ac1 100644
--- a/doc/classes/ScriptEditor.xml
+++ b/doc/classes/ScriptEditor.xml
@@ -55,6 +55,15 @@
Returns an array with all [Script] objects which are currently open in editor.
</description>
</method>
+ <method name="goto_line">
+ <return type="void">
+ </return>
+ <argument index="0" name="line_number" type="int">
+ </argument>
+ <description>
+ Goes to the specified line in the current script.
+ </description>
+ </method>
<method name="open_script_create_dialog">
<return type="void">
</return>
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index d84a5a1e48..0982da784f 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2950,6 +2950,7 @@ void ScriptEditor::_bind_methods() {
ClassDB::bind_method(D_METHOD("can_drop_data_fw", "point", "data", "from"), &ScriptEditor::can_drop_data_fw);
ClassDB::bind_method(D_METHOD("drop_data_fw", "point", "data", "from"), &ScriptEditor::drop_data_fw);
+ ClassDB::bind_method(D_METHOD("goto_line", "line_number"), &ScriptEditor::_goto_script_line2);
ClassDB::bind_method(D_METHOD("get_current_script"), &ScriptEditor::_get_current_script);
ClassDB::bind_method(D_METHOD("get_open_scripts"), &ScriptEditor::_get_open_scripts);
ClassDB::bind_method(D_METHOD("open_script_create_dialog", "base_name", "base_path"), &ScriptEditor::open_script_create_dialog);