@@ -764,7 +764,7 @@ void TextEdit::_notification(int p_what) {
764764 }
765765 }
766766
767- bool draw_placeholder = text. size () == 1 && text[ 0 ]. is_empty () && ime_text. is_empty ();
767+ bool draw_placeholder = _using_placeholder ();
768768
769769 // Get the highlighted words.
770770 String highlighted_text = get_selected_text (0 );
@@ -2849,6 +2849,10 @@ void TextEdit::_update_placeholder() {
28492849 }
28502850}
28512851
2852+ bool TextEdit::_using_placeholder () const {
2853+ return text.size () == 1 && text[0 ].is_empty () && ime_text.is_empty ();
2854+ }
2855+
28522856void TextEdit::_update_theme_item_cache () {
28532857 Control::_update_theme_item_cache ();
28542858
@@ -7840,10 +7844,10 @@ void TextEdit::_update_scrollbars() {
78407844 h_scroll->set_begin (Point2 (0 , size.height - hmin.height ));
78417845 h_scroll->set_end (Point2 (size.width - vmin.width , size.height ));
78427846
7843- bool draw_placeholder = text. size () == 1 && text[ 0 ]. length () == 0 ;
7847+ bool draw_placeholder = _using_placeholder () ;
78447848
78457849 int visible_rows = get_visible_line_count ();
7846- int total_rows = draw_placeholder ? placeholder_wraped_rows.size () - 1 : get_total_visible_line_count ();
7850+ int total_rows = draw_placeholder ? placeholder_wraped_rows.size () : get_total_visible_line_count ();
78477851 if (scroll_past_end_of_file_enabled && !fit_content_height) {
78487852 total_rows += visible_rows - 1 ;
78497853 }
@@ -7921,7 +7925,7 @@ void TextEdit::_scroll_moved(double p_to_val) {
79217925 }
79227926 if (v_scroll->is_visible_in_tree ()) {
79237927 // Set line ofs and wrap ofs.
7924- bool draw_placeholder = text. size () == 1 && text[ 0 ]. length () == 0 ;
7928+ bool draw_placeholder = _using_placeholder () ;
79257929
79267930 int v_scroll_i = floor (get_v_scroll ());
79277931 int sc = 0 ;
0 commit comments