A Quadrilateral Cowboy clone intended to help me learn Game Dev
at main 47 lines 2.0 kB view raw
1## The CodeEdit that is used when the editor is split, to show the split script. 2@tool 3extends CodeEdit 4 5var last_v_scroll: float 6 7func _ready() -> void: 8 editable = false 9 caret_draw_when_editable_disabled = true 10 set_v_scroll.call_deferred(last_v_scroll) 11 12static func new_from(from_code_edit: CodeEdit) -> CodeEdit: 13 var new_code_edit: CodeEdit = new() 14 15 new_code_edit.text = from_code_edit.text 16 new_code_edit.syntax_highlighter = from_code_edit.syntax_highlighter 17 new_code_edit.highlight_all_occurrences = from_code_edit.highlight_all_occurrences 18 new_code_edit.highlight_current_line = from_code_edit.highlight_current_line 19 20 new_code_edit.use_default_word_separators = from_code_edit.use_default_word_separators 21 new_code_edit.use_custom_word_separators = from_code_edit.use_custom_word_separators 22 new_code_edit.custom_word_separators = from_code_edit.custom_word_separators 23 24 new_code_edit.line_folding = from_code_edit.line_folding 25 new_code_edit.line_length_guidelines = from_code_edit.line_length_guidelines 26 27 new_code_edit.gutters_draw_line_numbers = from_code_edit.gutters_draw_line_numbers 28 new_code_edit.gutters_draw_fold_gutter = from_code_edit.gutters_draw_fold_gutter 29 30 new_code_edit.minimap_draw = from_code_edit.minimap_draw 31 new_code_edit.minimap_width = from_code_edit.minimap_width 32 33 new_code_edit.delimiter_strings = from_code_edit.delimiter_strings 34 new_code_edit.delimiter_comments = from_code_edit.delimiter_comments 35 36 new_code_edit.indent_automatic = from_code_edit.indent_automatic 37 new_code_edit.indent_size = from_code_edit.indent_size 38 new_code_edit.indent_use_spaces = from_code_edit.indent_use_spaces 39 new_code_edit.indent_automatic_prefixes = from_code_edit.indent_automatic_prefixes 40 41 new_code_edit.draw_control_chars = from_code_edit.draw_control_chars 42 new_code_edit.draw_tabs = from_code_edit.draw_tabs 43 new_code_edit.draw_spaces = from_code_edit.draw_spaces 44 45 new_code_edit.last_v_scroll = from_code_edit.scroll_vertical 46 47 return new_code_edit