### 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)

xmargin_end -= minimap_width;
			}
			
			theme_cache.style_normal->draw(ci, Rect2(Point2(), size));
			if (!editable) {
				theme_cache.style_readonly->draw(ci, Rect2(Point2(), size));
				draw_caret = is_drawing_caret_when_editable_disabled();
			}
			if (has_focus()) {
				theme_cache.style_focus->draw(ci, Rect2(Point2(), size));
			}
			int visible_rows = get_visible_line_count() + 1;
			Color color = !editable ? theme_cache.font_readonly_color : theme_cache.font_color;
			if (theme_cache.background_color.a > 0.01) {
				RenderingServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(), get_size()), theme_cache.background_color);
			}
			Vector<BraceMatchingData> brace_matching;
			if (highlight_matching_braces_enabled) {
				brace_matching.resize(carets.size());
				for (int caret = 0; caret < carets.size(); caret++) {
					if (get_caret_line(caret) < 0 || get_caret_line(caret) >= text.size() || get_caret_column(caret) < 0) {
						continue;
					}
					if (get_caret_column(caret) < text[get_caret_line(caret)].length()) {
						
						char32_t c = text[get_caret_line(caret)][get_caret_column(caret)];
						char32_t closec = 0;
						if (c == '[') {
							closec = ']';
						} else if (c == '{') {