### 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
String line_text = get_line(i);
			if (line_text.begins_with("\t")) {
				line_text = line_text.substr(1, line_text.length());
				set_line(i, line_text);
				removed_characters = 1;
				first_line_edited = (i == start_line) ? true : first_line_edited;
				last_line_edited = (i == end_line) ? true : last_line_edited;
				continue;
			}
			if (line_text.begins_with(" ")) {
				
				
				
				int spaces_to_remove = _calculate_spaces_till_next_left_indent(get_first_non_whitespace_column(i));
				line_text = line_text.substr(spaces_to_remove, line_text.length());
				set_line(i, line_text);
				removed_characters = spaces_to_remove;
				first_line_edited = (i == start_line) ? true : first_line_edited;
				last_line_edited = (i == end_line) ? true : last_line_edited;
			}
		}
		if (has_selection(c)) {
			
			if (first_line_edited) {
				select(get_selection_from_line(c), get_selection_from_column(c) - removed_characters, get_selection_to_line(c), initial_selection_end_column, c);
			}
			
			if (last_line_edited) {
				select(get_selection_from_line(c), get_selection_from_column(c), get_selection_to_line(c), initial_selection_end_column - removed_characters, c);
			}