Toad World® Forums

Annoying Highlighting


Hi Guys,

Put this in your sql editor

select * from dual – WHERE
– x != 46001 AND
–) GROUP BY tracking_number
– AND x = ‘er30303’

select * from dual;
–GROUP BY ROLLUP(er.tracking_number, adc.dest_country_name, total_expensed_amt )
–ORDER BY dest_country_name;

 --    (li.approved_amt)

Do an f8 on the first select from dual.

For some reason it stays highlighted no matter where you click until you run a different query in the same editor.

Really weird error I know.



Hi Jet,

A quick workaround is to click on the script tab before editing.



Hi Joe,

When you execute a script with multiple queries, Code Editor creates a sub-tab for each query where results are displayed. The highlighting simply shows to which query the results on the sub-tab belong. It changes when you switch result sub-tabs. When you switch to the main script tab, it doesn’t have the highlighting (since no results are displayed). This is how Code Editor was designed to handle multiple queries in a script. We can improve this in one of two ways:

  1. make text in result tabs non-editable
  2. make the highlighting disappear when a change to text in a sub-tab is made

Please let us know which solution you prefer.

Thank you,


Hi Roman

My 2 cents…

I think that 1) would be expected behavior (like extract DDL, etc)



I think Jet is onto something.

When I hit F8 in a script editor which has multiple SQL statements, my expectation as a user is for the tool to respond in the same way as if I had run the query while only one SQL statement was in the window. In prior versions it has never spawned a Result tab when only a single query is run - everything stayed in the Script tab.

Additionally, as Jet points out, the behavior is different if I hit F8 for the bottom query. In that case the result tab is not created and thus no highlighting.

Yet a third thing to note is that if you run the top query from the top line, you won’t get the result tab or highlighting that goes along with it.

I’d recommend never creating a separate result tab for single query (F8) executions.


I’m on board with Hunter. I guess I didn’t even look to see the result tab created because I only executed one statement.

As for the other question when you do run multiple queries. The biggest part of the problem is the highlighting that you chose. It appears that the text is selected when, in fact, it isn’t.

Now, you can’t make the editor read only, that would be counter intuitive and a pain because you would have to click in the script tab to make a modification. What I would suggest is a more obvious indicator in the gutter to indicate which statement results you’re looking at. Maybe a red arrow. Another alternative would be to underline the query that was executed.

I think either of those solutions would be better than the current highlighting.



I agree that pressing F8 should give the same result as F9 with single statement. In fact, the problem you refer to happens only when the statement has more than one line. I’ve just looked at the code and found a bug. It’s quite easy to fix, so I hope it will make into 6.2 GA.



Thanks Roman,

I would also hope that you guys revisit the type of highlighting you are using. It really looks like a “selection”, but it doesn’t behave like selection. Maybe you can use underlining or something else?

Or, allow it to be customized? It is very, very difficult to work with that highlighting as you can’t see where the cursor is and you can’t get rid of it.



Hi Jet,

I have raised an enhancement request for this. We will look into it after the 6.2 release.



Well, I’m glad you’re fixing it, but it really needs to be fixed soon. It’s very hard to use cuz the highlighting that is being used doesn’t allow you to see your cursor. I’ve postd on that before too. It’s a lousy choice of highlighting. It looks like it’s selected (it’s not) and you can’t see where your cursor is. Blah



Hi Jet,

I agree this is an annoying behaviour that we need to review. We had a discussion today in our team on whether or not to get rid of the the highlighting when the user starts editing the text. As a result of this change, after editing, clicking on the result tabs won’t highlight anything unless the user rerun the statements. Our concern is this may upset some customers that are used to this behaviour.
Since it’s not a critical bug, we thought it’s best to leave it for now. I hope you understand and continue to give feedback on how we can improve this feature.



Although it may not be as convenient, switching to the script tab before editing will solve the issue of the highlighting masking the cursor position.



Well, I’m not sure you’re understanding the problem. The problem is when I execute only one SQL statement using F8. It shouldn’t open a new tab and highlight anything. In fact, if you execute the last statement in window, it does it correctly. The problem comes from when you execute any statements above. Again, I’m only executing one statement. It’s unnecessary to open a new tab at all! This is a recent change that I don’t believe happened in 6.0. In other words, I think you broke something in this release.

Is this more clear now?



Hi Jet,

There are 2 issues being dicussed in this thread. One is with pressing F8 openning a new tab and the other one is with statement highlighting.

The first one has been fixed in our internal build as it’s a regression from previous version like you said. Pressing F8 to execute now will not open a new tab and the statement will not be highlighted.

The second one is from your feedback that the highlighting looks like a selection but does not behave like a selection. It also does not disappear when you start editing. This issue will be addressed in a later version.



Ah, right, sorry. It’s been awhile since I’ve looked at the thread. My mistake.