### Godot version

Godot 4.0 statble

### System information

Windows 10

### Issue description

TextEdit boundary wrapmode not works, it only removes the horizontal scrollbar

### Steps to reproduce

Add a textedit in editor, set  the wrap mode to boundary, type something.

### Minimal reproduction project

![image](https://user-images.githubusercontent.com/9168814/224538077-2efb4e67-8976-496e-9223-c460365ecc28.png)
![image](https://user-images.githubusercontent.com/9168814/224538084-af773b86-d73a-4e8b-9b66-a0fb4bde1168.png)

carets.write[c].draw_pos.y = ofs_y + ldata->get_line_descent(line_wrap_index);
							if (ime_text.is_empty() || ime_selection.y == 0) {
								
								CaretInfo ts_caret;
								if (!str.is_empty() || !ime_text.is_empty()) {
									
									ts_caret = TS->shaped_text_get_carets(rid, ime_text.is_empty() ? get_caret_column(c) : get_caret_column(c) + ime_selection.x);
								} else {
									
									int h = theme_cache.font->get_height(theme_cache.font_size);
									if (rtl) {
										ts_caret.l_dir = TextServer::DIRECTION_RTL;
										ts_caret.l_caret = Rect2(Vector2(xmargin_end - char_margin + ofs_x, -h / 2), Size2(caret_width * 4, h));
									} else {
										ts_caret.l_dir = TextServer::DIRECTION_LTR;
										ts_caret.l_caret = Rect2(Vector2(char_ofs, -h / 2), Size2(caret_width * 4, h));
									}
								}
								if ((ts_caret.l_caret != Rect2() && (ts_caret.l_dir == TextServer::DIRECTION_AUTO || ts_caret.l_dir == (TextServer::Direction)input_direction)) || (ts_caret.t_caret == Rect2())) {
									carets.write[c].draw_pos.x = char_margin + ofs_x + ts_caret.l_caret.position.x;
								} else {
									carets.write[c].draw_pos.x = char_margin + ofs_x + ts_caret.t_caret.position.x;
								}
								if (get_caret_draw_pos(c).x >= xmargin_beg && get_caret_draw_pos(c).x < xmargin_end) {
									carets.write[c].visible = true;
									if (draw_caret || drag_caret_force_displayed) {
										if (caret_type == CaretType::CARET_TYPE_BLOCK || overtype_mode) {
											
											int h = theme_cache.font->get_height(theme_cache.font_size);
											if (ts_caret.t_caret != Rect2()) {