Updated split_code_edit.gd to be editable and sync changes - #166
Updated split_code_edit.gd to be editable and sync changes#166themipper wants to merge 2 commits into
Conversation
…rce and split The split edit is now editable and syncs changes between the original. If the original is closed the split is also closed.
|
When I type something in the split Also when I close the Tab, the right side will be empty and still in split mode. This feels weird. I like the idea of the synchronization but it most be more user friendly IMO. |
| editable = true | ||
| caret_draw_when_editable_disabled = true | ||
| set_v_scroll.call_deferred(last_v_scroll) | ||
| set_v_scroll.call_deferred(last_v_scroll) |
| extends CodeEdit | ||
|
|
||
| var last_v_scroll: float | ||
| var pause_text_changed = false |
| static func new_from(from_code_edit: CodeEdit) -> CodeEdit: | ||
| var new_code_edit: CodeEdit = new() | ||
|
|
||
| if not from_code_edit.tree_exiting.is_connected(new_code_edit.exit_tree.bind(new_code_edit)): |
| to.scroll_vertical = scroll | ||
| pause_text_changed = false | ||
|
|
||
| func to_changed(from:CodeEdit,to:CodeEdit) -> void: |
There was a problem hiding this comment.
Please always leave an empty space after the :, e.g. from: CodeEdit
|
I will add the save indicator and close the split tab when the main file is closed. |
don't worry, take your time! If you are stuck, tell me, I may have a look as well. |
Made the split_code_edit.gd editable.
Changes are synced between source and split.
Scroll-position and caret-position are preserved.