### Godot version

4.0.2

### System information

Windows 11

### Issue description

Double clicking on `$MyNode` in the script editor will select the whole name including the "$".

But double clicking on `%MyNode` (unique name) will select the name but will not include the "%".

Dragging a node from the scene tree into the script editor brings up the property/method hint list, even though a "." has not been typed. Pressing enter appends "new()" even though this makes no sense as there is no period so it is just appending it directly to the node name: `$MyNodenew()`


### Steps to reproduce

Type `%MyNode` in a script and double click on it.

Type `@onready var x =` in a script, drag a node from the scene tree, then press enter.


### Minimal reproduction project

N/A
if (!is_editable()) {
		return;
	}
	begin_complex_operation();
	Vector<int> caret_edit_order = get_caret_index_edit_order();
	for (const int &c : caret_edit_order) {
		
		
		
		int removed_characters = 0;
		int initial_selection_end_column = 0;
		int initial_cursor_column = get_caret_column(c);
		int start_line = get_caret_line(c);
		int end_line = start_line;
		if (has_selection(c)) {
			start_line = get_selection_from_line(c);
			end_line = get_selection_to_line(c);
			
			initial_selection_end_column = get_selection_to_column(c);
			if (initial_selection_end_column == 0) {
				end_line--;
			}
		}
		bool first_line_edited = false;
		bool last_line_edited = false;
		for (int i = start_line; i <= end_line; i++) {