You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
External editor improvements and fixes
Notable changes:
- Now ScriptLanguages have the option to override the global external editor setting.
If `ScriptLanguage::open_in_external_editor()` returns `ERR_UNAVAILABLE` (which it does by default), then the global external editor option will be used.
- Added formatting to the external editor execution arguments. Now it's possible to write something like this: `{project} -g {file}:{line}:{col}`.
- `VisualScript::get_member_line()` now can return the line of functions (well, it returns the id of the _Function_ node of the function). I guess there is nothing else we can get a "line" from.
Fixes:
- Fixes a bug where `ScriptEditor::script_goto_method()` would not work if the script is not already open in the built-in editor.
- Fixes wrong DEFVAL for `cursor_set_column` and `cursor_set_line` in TextEdit.
- `Script::get_member_line()` now returns -1 ("found nothing") by default.
This commit is contained in:
@@ -69,26 +69,6 @@ Ref<Script> ScriptTextEditor::get_edited_script() const {
|
||||
return script;
|
||||
}
|
||||
|
||||
bool ScriptTextEditor::goto_method(const String &p_method) {
|
||||
|
||||
Vector<String> functions = get_functions();
|
||||
|
||||
String method_search = p_method + ":";
|
||||
|
||||
for (int i = 0; i < functions.size(); i++) {
|
||||
String function = functions[i];
|
||||
|
||||
if (function.begins_with(method_search)) {
|
||||
|
||||
int line = function.get_slice(":", 1).to_int();
|
||||
goto_line(line - 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ScriptTextEditor::_load_theme_settings() {
|
||||
|
||||
TextEdit *text_edit = code_editor->get_text_edit();
|
||||
@@ -296,7 +276,7 @@ void ScriptTextEditor::tag_saved_version() {
|
||||
}
|
||||
|
||||
void ScriptTextEditor::goto_line(int p_line, bool p_with_error) {
|
||||
code_editor->get_text_edit()->cursor_set_line(p_line);
|
||||
code_editor->get_text_edit()->call_deferred("cursor_set_line", p_line);
|
||||
}
|
||||
|
||||
void ScriptTextEditor::ensure_focus() {
|
||||
|
||||
Reference in New Issue
Block a user