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

text_editor->begin_complex_operation();
	Vector<int> caret_edit_order = text_editor->get_caret_index_edit_order();
	for (const int &c : caret_edit_order) {
		const int cursor_column = text_editor->get_caret_column(c);
		int from_line = text_editor->get_caret_line(c);
		int to_line = text_editor->get_caret_line(c);
		int from_column = 0;
		int to_column = 0;
		int cursor_new_line = to_line + 1;
		int cursor_new_column = text_editor->get_caret_column(c);
		String new_text = "\n" + text_editor->get_line(from_line);
		bool selection_active = false;
		text_editor->set_caret_column(text_editor->get_line(from_line).length(), c == 0, c);
		if (text_editor->has_selection(c)) {
			from_column = text_editor->get_selection_from_column(c);
			to_column = text_editor->get_selection_to_column(c);
			from_line = text_editor->get_selection_from_line(c);
			to_line = text_editor->get_selection_to_line(c);
			cursor_new_line = to_line + text_editor->get_caret_line(c) - from_line;
			cursor_new_column = to_column == cursor_column ? 2 * to_column - from_column : to_column;
			new_text = text_editor->get_selected_text(c);
			selection_active = true;
			text_editor->set_caret_line(to_line, c == 0, true, 0, c);
			text_editor->set_caret_column(to_column, c == 0, c);
		}