mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Merge pull request #66300 from KoBeWi/📝🧭
Split script navigation state and edit state
This commit is contained in:
commit
121e1df55b
8 changed files with 43 additions and 21 deletions
|
|
@ -566,7 +566,7 @@ void ScriptEditor::_save_history() {
|
|||
Node *n = tab_container->get_current_tab_control();
|
||||
|
||||
if (Object::cast_to<ScriptEditorBase>(n)) {
|
||||
history.write[history_pos].state = Object::cast_to<ScriptEditorBase>(n)->get_edit_state();
|
||||
history.write[history_pos].state = Object::cast_to<ScriptEditorBase>(n)->get_navigation_state();
|
||||
}
|
||||
if (Object::cast_to<EditorHelp>(n)) {
|
||||
history.write[history_pos].state = Object::cast_to<EditorHelp>(n)->get_scroll();
|
||||
|
|
@ -601,7 +601,7 @@ void ScriptEditor::_go_to_tab(int p_idx) {
|
|||
Node *n = tab_container->get_current_tab_control();
|
||||
|
||||
if (Object::cast_to<ScriptEditorBase>(n)) {
|
||||
history.write[history_pos].state = Object::cast_to<ScriptEditorBase>(n)->get_edit_state();
|
||||
history.write[history_pos].state = Object::cast_to<ScriptEditorBase>(n)->get_navigation_state();
|
||||
}
|
||||
if (Object::cast_to<EditorHelp>(n)) {
|
||||
history.write[history_pos].state = Object::cast_to<EditorHelp>(n)->get_scroll();
|
||||
|
|
@ -3360,7 +3360,7 @@ void ScriptEditor::_update_history_pos(int p_new_pos) {
|
|||
Node *n = tab_container->get_current_tab_control();
|
||||
|
||||
if (Object::cast_to<ScriptEditorBase>(n)) {
|
||||
history.write[history_pos].state = Object::cast_to<ScriptEditorBase>(n)->get_edit_state();
|
||||
history.write[history_pos].state = Object::cast_to<ScriptEditorBase>(n)->get_navigation_state();
|
||||
}
|
||||
if (Object::cast_to<EditorHelp>(n)) {
|
||||
history.write[history_pos].state = Object::cast_to<EditorHelp>(n)->get_scroll();
|
||||
|
|
@ -3371,11 +3371,12 @@ void ScriptEditor::_update_history_pos(int p_new_pos) {
|
|||
|
||||
n = history[history_pos].control;
|
||||
|
||||
if (Object::cast_to<ScriptEditorBase>(n)) {
|
||||
Object::cast_to<ScriptEditorBase>(n)->set_edit_state(history[history_pos].state);
|
||||
Object::cast_to<ScriptEditorBase>(n)->ensure_focus();
|
||||
ScriptEditorBase *seb = Object::cast_to<ScriptEditorBase>(n);
|
||||
if (seb) {
|
||||
seb->set_edit_state(history[history_pos].state);
|
||||
seb->ensure_focus();
|
||||
|
||||
Ref<Script> script = Object::cast_to<ScriptEditorBase>(n)->get_edited_resource();
|
||||
Ref<Script> script = seb->get_edited_resource();
|
||||
if (script != nullptr) {
|
||||
notify_script_changed(script);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue