Can't write script in script editor

hi,everyone,I want to write some script to rename my directory name.but when i enter the script editor,it looks weird,
seems can't select the whole line,and can not move to the end of line(as the attachment),how can i fix it?

There's a problem with the edit control used in the script editor where the selection highlight doesn't line up properly when some types of characters are on the line.

In the default script as pictures, it should only affect the comments on the right of each line, and if you go to the end of the lines and backspace, it should remove them fine. Editing should work, it just doesn't look right.

(Replacing that edit control is on our to-do list. It also affects the button editor.)