### 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 (!changed_indentation) {
				begin_complex_operation();
				changed_indentation = true;
			}
			
			for (int c = 0; c < get_caret_count(); c++) {
				if (get_caret_line(c) != i || caret_columns[c] <= j) {
					continue;
				}
				caret_columns.write[c] += size_diff;
				if (from_selections.write[c].first == -1) {
					continue;
				}
				from_selections.write[c].second = from_selections[c].first == i ? from_selections[c].second + size_diff : from_selections[c].second;
				to_selections.write[c].second = to_selections[c].first == i ? to_selections[c].second + size_diff : to_selections[c].second;
			}
			
			line = line.left(j + ((size_diff < 0) ? size_diff : 0)) + indent_text + line.substr(j + 1);
			space_count = 0;
			j += size_diff;
		}
		if (line_changed) {
			set_line(i, line);
		}
	}
	if (!changed_indentation) {
		return;
	}
	
	for (int c = 0; c < get_caret_count(); c++) {