Skip to content

Commit

Permalink
Textedit changes to support Enu
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrw committed Nov 2, 2021
1 parent 23955fc commit ec840ce
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions scene/gui/text_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1284,11 +1284,7 @@ void TextEdit::_notification(int p_what) {
int marker_width = cache.breakpoint_gutter_width - (horizontal_gap * 2) + icon_extra_size;
cache.executing_icon->draw_rect(ci, Rect2(cache.style_normal->get_margin(MARGIN_LEFT) + horizontal_gap - 2 - icon_extra_size / 2, ofs_y + vertical_gap - icon_extra_size / 2, marker_width, marker_height), false, Color(cache.executing_line_color.r, cache.executing_line_color.g, cache.executing_line_color.b));
} else {
#ifdef TOOLS_ENABLED
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y + get_row_height() - EDSCALE, xmargin_end - xmargin_beg, EDSCALE), cache.executing_line_color);
#else
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, xmargin_end - xmargin_beg, get_row_height()), cache.executing_line_color);
#endif
}
}

Expand Down Expand Up @@ -7230,6 +7226,19 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_minimap_width", "width"), &TextEdit::set_minimap_width);
ClassDB::bind_method(D_METHOD("get_minimap_width"), &TextEdit::get_minimap_width);

ClassDB::bind_method(D_METHOD("set_indent_size", "size"), &TextEdit::set_indent_size);
ClassDB::bind_method(D_METHOD("get_indent_size"), &TextEdit::get_indent_size);

ClassDB::bind_method(D_METHOD("set_indent_using_spaces", "enabled"), &TextEdit::set_indent_using_spaces);
ClassDB::bind_method(D_METHOD("is_indent_using_spaces"), &TextEdit::is_indent_using_spaces);

ClassDB::bind_method(D_METHOD("set_line_as_marked", "line", "marked"), &TextEdit::set_line_as_marked);
ClassDB::bind_method(D_METHOD("set_executing_line", "line"), &TextEdit::set_executing_line);
ClassDB::bind_method(D_METHOD("clear_executing_line"), &TextEdit::clear_executing_line);

ADD_PROPERTY(PropertyInfo(Variant::BOOL, "indent_using_spaces"), "set_indent_using_spaces", "is_indent_using_spaces");
ADD_PROPERTY(PropertyInfo(Variant::INT, "indent_size", PROPERTY_HINT_RANGE, "0,8,1,or_greater"), "set_indent_size", "get_indent_size");

ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "readonly"), "set_readonly", "is_readonly");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_current_line"), "set_highlight_current_line", "is_highlight_current_line_enabled");
Expand Down

0 comments on commit ec840ce

Please sign in to comment.