Repository: godotengine/godot
File: editor/script/script_editor_plugin.cpp (C++)

Code before:
}

void ScriptEditorPlugin::_window_visibility_changed(bool p_visible) {
	_focus_another_editor();
	if (p_visible) {
		script_editor->add_theme_style_override(SceneStringName(panel), script_editor->get_theme_stylebox("ScriptEditorPanelFloating", EditorStringName(EditorStyles)));
	} else {
		script_editor->add_theme_style_override(SceneStringName(panel), script_editor->get_theme_stylebox("ScriptEditorPanel", EditorStringName(EditorStyles)));
	}
}

void ScriptEditorPlugin::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_TRANSLATION_CHANGED: {
			window_wrapper->set_window_title(vformat(TTR("%s - Godot Engine"), TTR("Script Editor")));
		} break;
		case NOTIFICATION_ENTER_TREE: {
			connect("main_screen_changed", callable_mp(this, &ScriptEditorPlugin::_save_last_editor));
		} break;
		case NOTIFICATION_EXIT_TREE: {
			disconnect("main_screen_changed", callable_mp(this, &ScriptEditorPlugin::_save_last_editor));
		} break;
	}
}

bool ScriptEditorPlugin::open_in_external_editor(const String &p_path, int p_line, int p_col, bool ignore_project) {
	const String path = EDITOR_GET("text_editor/external/exec_path");
	if (path.is_empty()) {
		return false;
	}

	String flags = EDITOR_GET("text_editor/external/exec_flags");

	List<String> args;
	bool has_file_flag = false;

	if (!flags.is_empty()) {
		flags = flags.replacen("{line}", itos(MAX(p_line + 1, 1)));
		flags = flags.replacen("{col}", itos(p_col + 1));
		flags = flags.strip_edges().replace("\\\\", "\\");

		int from = 0;
		int num_chars = 0;
		bool inside_quotes = false;

		for (int i = 0; i < flags.size(); i++) {
			if (flags[i] == '"' && (!i || flags[i - 1] != '\\')) {
				if (!inside_quotes) {
					from++;
				}
				inside_quotes = !inside_quotes;

Review comment (suggestion):
```suggestion
bool ScriptEditorPlugin::open_in_external_editor(const String &p_path, int p_line, int p_col, bool p_ignore_project) {
```

Code after:
}

void ScriptEditorPlugin::_window_visibility_changed(bool p_visible) {
	_focus_another_editor();
	if (p_visible) {
		script_editor->add_theme_style_override(SceneStringName(panel), script_editor->get_theme_stylebox("ScriptEditorPanelFloating", EditorStringName(EditorStyles)));
	} else {
		script_editor->add_theme_style_override(SceneStringName(panel), script_editor->get_theme_stylebox("ScriptEditorPanel", EditorStringName(EditorStyles)));
	}
}

void ScriptEditorPlugin::_notification(int p_what) {
	switch (p_what) {
		case NOTIFICATION_TRANSLATION_CHANGED: {
			window_wrapper->set_window_title(vformat(TTR("%s - Godot Engine"), TTR("Script Editor")));
		} break;
		case NOTIFICATION_ENTER_TREE: {
			connect("main_screen_changed", callable_mp(this, &ScriptEditorPlugin::_save_last_editor));
		} break;
		case NOTIFICATION_EXIT_TREE: {
			disconnect("main_screen_changed", callable_mp(this, &ScriptEditorPlugin::_save_last_editor));
		} break;
	}
}

bool ScriptEditorPlugin::open_in_external_editor(const String &p_path, int p_line, int p_col, bool p_ignore_project) {
	const String path = EDITOR_GET("text_editor/external/exec_path");
	if (path.is_empty()) {
		return false;
	}

	String flags = EDITOR_GET("text_editor/external/exec_flags");

	List<String> args;
	bool has_file_flag = false;

	if (!flags.is_empty()) {
		flags = flags.replacen("{line}", itos(MAX(p_line + 1, 1)));
		flags = flags.replacen("{col}", itos(p_col + 1));
		flags = flags.strip_edges().replace("\\\\", "\\");

		int from = 0;
		int num_chars = 0;
		bool inside_quotes = false;

		for (int i = 0; i < flags.size(); i++) {
			if (flags[i] == '"' && (!i || flags[i - 1] != '\\')) {
				if (!inside_quotes) {
					from++;
				}
				inside_quotes = !inside_quotes;