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

Vector2i caret_pos;
		
		if (ime_text.length() != 0 && ime_selection.x != 0) {
			caret_pos.x = _get_column_x_offset_for_line(get_caret_column(p_caret) + ime_selection.x, get_caret_line(p_caret), get_caret_column(p_caret));
		} else {
			caret_pos.x = _get_column_x_offset_for_line(get_caret_column(p_caret), get_caret_line(p_caret), get_caret_column(p_caret));
		}
		
		if (ime_text.length() != 0) {
			if (ime_selection.y != 0) {
				caret_pos.y = _get_column_x_offset_for_line(get_caret_column(p_caret) + ime_selection.x + ime_selection.y, get_caret_line(p_caret), get_caret_column(p_caret));
			} else {
				caret_pos.y = _get_column_x_offset_for_line(get_caret_column(p_caret) + ime_text.size(), get_caret_line(p_caret), get_caret_column(p_caret));
			}
		} else {
			caret_pos.y = caret_pos.x;
		}
		if (MAX(caret_pos.x, caret_pos.y) > (first_visible_col + visible_width)) {
			first_visible_col = MAX(caret_pos.x, caret_pos.y) - visible_width + 1;
		}
		if (MIN(caret_pos.x, caret_pos.y) < first_visible_col) {
			first_visible_col = MIN(caret_pos.x, caret_pos.y);
		}
	} else {
		first_visible_col = 0;
	}
	h_scroll->set_value(first_visible_col);
	queue_redraw();
}
void TextEdit::center_viewport_to_caret(int p_caret) {