### Godot version

4.0 stable

### System information

Manjaro Linux, kernel 6.1.1-1-MANJARO, AMD Ryzen 5 3600, AMD RX 580

### Issue description

The `wrap_mode` property of the `TextEdit` node doesn't seem to really do anything. Setting it to `LINE_WRAPPING_BOUNDARY` simply means that there won't be an horizontal scrollbar if the text overshoots the boundary, instead of actually forcing the text to the next line so that it stays visible.

### Steps to reproduce

Create a TextEdit node and set its `wrap_mode` property to `LINE_WRAPPING_BOUNDARY`

### Minimal reproduction project

[WrapBugDemo.zip](https://github.com/godotengine/godot/files/10875969/WrapBugDemo.zip)

}
									if (rtl) {
										gutter_rect.position.x = size.width - gutter_rect.position.x - gutter_rect.size.x;
									}
									icon->draw_rect(ci, gutter_rect, false, get_line_gutter_item_color(line, g));
								} break;
								case GUTTER_TYPE_CUSTOM: {
									if (gutter.custom_draw_callback.is_valid()) {
										Rect2i gutter_rect = Rect2i(Point2i(gutter_offset, ofs_y), Size2i(gutter.width, row_height));
										if (rtl) {
											gutter_rect.position.x = size.width - gutter_rect.position.x - gutter_rect.size.x;
										}
										Variant args[3] = { line, g, Rect2(gutter_rect) };
										const Variant *argp[] = { &args[0], &args[1], &args[2] };
										Callable::CallError ce;
										Variant ret;
										gutter.custom_draw_callback.callp(argp, 3, ret, ce);
									}
								} break;
							}
							gutter_offset += gutter.width;
						}
					}
					
					RID rid = ldata->get_line_rid(line_wrap_index);
					float text_height = TS->shaped_text_get_size(rid).y;
					if (rtl) {
						char_margin = size.width - char_margin - TS->shaped_text_get_size(rid).x;
					}
					for (int c = 0; c < carets.size(); c++) {