### 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 (caret == -1) {
							return;
						}
						carets.write[caret].selection.selecting_line = row;
						carets.write[caret].selection.selecting_column = col;
						last_dblclk = 0;
					} else if (!mb->is_shift_pressed()) {
						caret = 0;
						remove_secondary_carets();
					}
				}
				set_caret_line(row, false, true, 0, caret);
				set_caret_column(col, false, caret);
				selection_drag_attempt = false;
				if (selecting_enabled && mb->is_shift_pressed() && (get_caret_column(caret) != prev_col || get_caret_line(caret) != prev_line)) {
					if (!has_selection(caret)) {
						carets.write[caret].selection.active = true;
						selecting_mode = SelectionMode::SELECTION_MODE_POINTER;
						carets.write[caret].selection.from_column = prev_col;
						carets.write[caret].selection.from_line = prev_line;
						carets.write[caret].selection.to_column = carets[caret].column;
						carets.write[caret].selection.to_line = carets[caret].line;
						if (get_selection_from_line(caret) > get_selection_to_line(caret) || (get_selection_from_line(caret) == get_selection_to_line(caret) && get_selection_from_column(caret) > get_selection_to_column(caret))) {
							SWAP(carets.write[caret].selection.from_column, carets.write[caret].selection.to_column);
							SWAP(carets.write[caret].selection.from_line, carets.write[caret].selection.to_line);
							carets.write[caret].selection.shiftclick_left = false;
						} else {
							carets.write[caret].selection.shiftclick_left = true;
						}
						carets.write[caret].selection.selecting_line = prev_line;