Page Scrolling Hides Matching Brace Highlighting

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

Page Scrolling Hides Matching Brace Highlighting

Post by Rat »

If I highlight a brace so that its matching partner is also highlighted and the partner brace is currently out of view, then scrolling the document will hide the brace highlighting as soon as the first brace goes out of view.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The issue here is that Zeus by design will always keep the cursor on the current screen.

So what has happened in this case is the initial scroll has left the cursor off the screen. The design feature described above has then moved the cursor back onto the screen, which in turn has removed the matching brace indication.

Cheers Jussi
Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

Post by Rat »

Hmmm... but the brace stays highlighted until it scrolls of screen?
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Could you post some code that highlights this issue :?:

Cheers Jussi
Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

Post by Rat »

Here you go Jussi...

In the code example below, just move the caret until the top brace is highlighted, then scroll the page down either using the mouse wheel or by clicking on the vertical scrollbar down arrow.

As soon as the top brace scrolls out of view the brace-pair highlighting is "lost".

Code: Select all

function Test()
{
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
 //    
}
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

As soon as the top brace scrolls out of view the brace-pair highlighting is "lost".

This is what I see.

When the cursor is on the brace the matching brace is shown.

If the cursor is on the bottom brace and the top brace is scrolled off the page the highlight is retained.

If the cursor is on the top brace and it is scrolled off the page then the highlight is lost.

This is by design.

As I said earlier, the in the last case the action of scrolling the page has moved the cursor off the brace so naturally there is no longer a matching brace.

Cheers Jussi
Rat
Posts: 68
Joined: Wed Jun 15, 2011 1:18 am

Post by Rat »

Ok understood...

In that case therefore, I would humbly suggest that the caret position should be retained when it is scrolled out of view. This seems more intuitive to me and in any case finding a matching brace using highlighting won't work when the enclosed block exceeds the visible page region.

Note: A quick survey on my workstation indicates that the majority of editors seem to work this way, (i.e. retaining the caret position out of view). This includes NetBeans, SciTE, Notepad, Wordpad, MS Word, LibreOffice Writer and Notepad++, but not CodeWright.
Post Reply