First character not selected

Jim Gust

Member²
Now and again, I noticed that when statements run, the first character is not captured. This has probably happened to me 15 times in the last 6 months. I cannot recreate it, which leads me to believe it may be related to disconnection.

In the update statement below, notice how the first character is not selected, "U". This obviously results in an "ORA-00900: invalid SQL statement."
1766262013695.png


Closing and reopening the SQL window resolves the issue.
 
I've had this issue intermittently since at least version 11, but I've never been able to reproduce it. Once it starts happening, it happens for every SQL statement in the SQL window. It's like the statement auto-selection parsing gets offset by one character. I also tend to put the semicolons between statements on a new line like the screenshot above, and the problem only happens when the last line in the SQL window is a semicolon possibly followed by a return character.

I correct the issue by selecting all text in the SQL Window, and then cut (ctrl+x) the text and paste the text back into the SQL window. The statement auto-selection works normally after that.
 
I also get this issue intermittently since at least version 11. I cannot reproduce it (and to be fair it has not happened recently), but it's caused by the generation of an odd special character which sometimes appears in my code as I am typing. I can type quite quickly and sometimes PSD does not have time to respond to what I have typed before the next piece is typed (e.g. I have the editor set to make keywords upper case, but if I type end if; really fast the end does not get converted to END). I have not figured out what key combination causes the funny special character to appear, but if you make special characters visible in the editor you can see the character - once that character is removed the auto select of SQL to be executed works fine.
 
It happened again, so I got some screenshots. Copying and pasting the problem text clears the strange character. Saving and reopening the file also clears the strange character. After copying and pasting into Notepad++, Notepad++ shows the strange character as a CRLF, like all other lines.

There is a strange character at the end of line 25:

PLSQL-Developer-bad-char1.png


The queries above line 25 work properly:

PLSQL-Developer-bad-char2.png


The query on line 25 executes without errors, but the blue selection extends into line 26:

PLSQL-Developer-bad-char3.png


The query on line 26 (and all queries below) executes with an error:

PLSQL-Developer-bad-char4.png
 
I have had this issue many times over the years, but was never able to figure out what key sequence was generating the special character. The issue has not arisen for me with the latest version I have (v16.0.8.2176).
 
It happened again and can confirm that the special character cassiusdrow reported is the cause.


1772633672077.png


I copied/pasted the first query below then continued to edit the second query.

I can run the first query with the weird character. The highlight picks up the first character of the next query but the query does run correctly.
1772634585369.png
 
We have found that opening a file where some lines are terminated by just a CR or LF character, but other lines are terminated by CR/LF pairs, will show this behavior.

Copying and pasting or saving and reopening will indeed fix the issue.

We will convert this properly when opening a file as well.
 
OK, happened again. No special keystrokes were used. I added the alias "t", <enter> "ON" and that is when I saw that character appear.
1772741338940.png


I tried to recreate it but I'm not able to. At least I now know for sure I was just typing in the editor without any special keystrokes.
 
Back
Top