|
@@ -549,16 +549,17 @@ void TextEdit::_notification(int p_what) {
|
|
MessageQueue::get_singleton()->push_call(this, "_cursor_changed_emit");
|
|
MessageQueue::get_singleton()->push_call(this, "_cursor_changed_emit");
|
|
if (text_changed_dirty)
|
|
if (text_changed_dirty)
|
|
MessageQueue::get_singleton()->push_call(this, "_text_changed_emit");
|
|
MessageQueue::get_singleton()->push_call(this, "_text_changed_emit");
|
|
- update_wrap_at();
|
|
|
|
|
|
+ _update_wrap_at();
|
|
} break;
|
|
} break;
|
|
case NOTIFICATION_RESIZED: {
|
|
case NOTIFICATION_RESIZED: {
|
|
|
|
|
|
_update_scrollbars();
|
|
_update_scrollbars();
|
|
- update_wrap_at();
|
|
|
|
|
|
+ call_deferred("_update_wrap_at");
|
|
} break;
|
|
} break;
|
|
case NOTIFICATION_THEME_CHANGED: {
|
|
case NOTIFICATION_THEME_CHANGED: {
|
|
|
|
|
|
_update_caches();
|
|
_update_caches();
|
|
|
|
+ _update_wrap_at();
|
|
} break;
|
|
} break;
|
|
case MainLoop::NOTIFICATION_WM_FOCUS_IN: {
|
|
case MainLoop::NOTIFICATION_WM_FOCUS_IN: {
|
|
window_has_focus = true;
|
|
window_has_focus = true;
|
|
@@ -3643,7 +3644,7 @@ int TextEdit::get_total_visible_rows() const {
|
|
return total_rows;
|
|
return total_rows;
|
|
}
|
|
}
|
|
|
|
|
|
-void TextEdit::update_wrap_at() {
|
|
|
|
|
|
+void TextEdit::_update_wrap_at() {
|
|
|
|
|
|
wrap_at = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - wrap_right_offset;
|
|
wrap_at = get_size().width - cache.style_normal->get_minimum_size().width - cache.line_number_w - cache.breakpoint_gutter_width - cache.fold_gutter_width - wrap_right_offset;
|
|
update_cursor_wrap_offset();
|
|
update_cursor_wrap_offset();
|
|
@@ -6091,6 +6092,7 @@ void TextEdit::_bind_methods() {
|
|
ClassDB::bind_method(D_METHOD("_click_selection_held"), &TextEdit::_click_selection_held);
|
|
ClassDB::bind_method(D_METHOD("_click_selection_held"), &TextEdit::_click_selection_held);
|
|
ClassDB::bind_method(D_METHOD("_toggle_draw_caret"), &TextEdit::_toggle_draw_caret);
|
|
ClassDB::bind_method(D_METHOD("_toggle_draw_caret"), &TextEdit::_toggle_draw_caret);
|
|
ClassDB::bind_method(D_METHOD("_v_scroll_input"), &TextEdit::_v_scroll_input);
|
|
ClassDB::bind_method(D_METHOD("_v_scroll_input"), &TextEdit::_v_scroll_input);
|
|
|
|
+ ClassDB::bind_method(D_METHOD("_update_wrap_at"), &TextEdit::_update_wrap_at);
|
|
|
|
|
|
BIND_ENUM_CONSTANT(SEARCH_MATCH_CASE);
|
|
BIND_ENUM_CONSTANT(SEARCH_MATCH_CASE);
|
|
BIND_ENUM_CONSTANT(SEARCH_WHOLE_WORDS);
|
|
BIND_ENUM_CONSTANT(SEARCH_WHOLE_WORDS);
|