This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 218095 - Mark occurrences sometimes stuck on previous selection
Summary: Mark occurrences sometimes stuck on previous selection
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Parsing & Indexing (show other bugs)
Version: 7.3
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: RANDOM
Depends on: 218893
Blocks:
  Show dependency tree
 
Reported: 2012-09-11 06:44 UTC by Vladimir Riha
Modified: 2012-09-24 11:26 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
simple screencast with this issue (168.99 KB, video/ogg)
2012-09-11 06:44 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-09-11 06:44:25 UTC
Created attachment 124132 [details]
simple screencast with this issue

Mark occurrences sometimes does not work and previously selected element remain highlighted while cursor is already inside another one. It's reproducible with this simple code:

=== CODE START
var pes = 1;
function sum(a, b) {
    pes++;
    return a + b + 1;
}

==== CODE END


Now try to (no heuristic here) click on "a", "sum" and "pes" and repeat it for a while. After a few attempts (sometimes on a first try), the occurences of "pes" are no longer highlighted and random repeating selects it again after a few attempts. Similar sometimes "pes" is still highlighted while cursor is inside "s|um" 


Product Version: NetBeans IDE Dev (Build 201209110001)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2012-09-21 09:15:41 UTC
the same with occurrences for values of class attribute in HTML, please evaluate


Product Version: NetBeans IDE 7.3 Beta (Build 201209201306)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)
Comment 2 Svata Dedic 2012-09-21 10:11:02 UTC
Do you really think this defect is P1/beta stopper ?
Comment 3 Vladimir Riha 2012-09-21 10:16:42 UTC
I also think it may not be stopper, but it is used in J1 demo. Mariane, what do think?
Comment 4 Svata Dedic 2012-09-21 10:23:03 UTC
CursorSensitiveScheduler and BreadcrumbsScheduler overwrite each other events; if Breadcrumbs wins, tasks scheduled by CursorSensitveScheduler (e.g occurences highlighter) will get null event as if the editor was not opened for the source.

Moving to parsing API, which performs the event overwrite.
Comment 5 Marian Mirilovic 2012-09-21 10:35:42 UTC
(In reply to comment #3)
> I also think it may not be stopper, but it is used in J1 demo. Mariane, what do
> think?

Marking occurrences is a part of J1 demo script, so I think it should really work.

Honza, do you think you will be able to fix it soon ?
Comment 6 Jan Lahoda 2012-09-21 11:17:55 UTC
Workaround:
http://hg.netbeans.org/jet-main/rev/d598ba9a8efb

It eliminates the extra Scheduler, and so the events should not be overwritten anymore. It introduces a bug into breadcrumbs: when the breadcrumbs bar is enabled, it is not refreshed automatically (caret location must be changed, or a reparse must be performed to refresh it).
Comment 7 Vladimir Riha 2012-09-21 11:21:29 UTC
Thanks for quick fix, I'll  verify it asap so it could be backported to beta.
Comment 8 Vladimir Riha 2012-09-21 13:01:53 UTC
So should this be closed as fix?


Anyway, seems to be fine, I tried HTML and JS files and all was fine. Please backport it to beta


Product Version: NetBeans IDE Dev (Build 20120921-b879527c1535) - manually applied fix from jet-main
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)
Comment 9 Jan Lahoda 2012-09-21 14:22:54 UTC
(In reply to comment #8)
> So should this be closed as fix?

I am not sure - this patch is only a workaround, it causes other problems.

> 
> 
> Anyway, seems to be fine, I tried HTML and JS files and all was fine. Please
> backport it to beta

http://hg.netbeans.org/releases/rev/008adf85c503

> 
> 
> Product Version: NetBeans IDE Dev (Build 20120921-b879527c1535) - manually
> applied fix from jet-main
> Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
> System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)
Comment 10 Quality Engineering 2012-09-23 02:12:17 UTC
Integrated into 'main-golden', will be available in build *201209230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d598ba9a8efb
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #218095 (workaround): disabling the breadcrumbs' Scheduler to prevent clashes with CursorSensitiveScheduler.
Comment 11 Jan Lahoda 2012-09-24 10:09:44 UTC
I filled bug #218893 for the correct solution.
Comment 12 Vladimir Riha 2012-09-24 11:26:12 UTC
Thanks Honzo, verified in Beta

Product Version: NetBeans IDE 7.3 Beta (Build 201209232010)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)