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 196281 - Code folding line painted over the folding node
Summary: Code folding line painted over the folding node
Status: VERIFIED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 7.0
Hardware: All All
: P2 normal with 1 vote (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
: 196651 197415 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-03-04 09:51 UTC by Jaromir Uhrik
Modified: 2011-11-18 07:59 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot attached... (44.70 KB, image/png)
2011-03-04 09:51 UTC, Jaromir Uhrik
Details
same problem in php file (18.39 KB, image/png)
2011-03-14 08:53 UTC, Vladimir Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jaromir Uhrik 2011-03-04 09:51:55 UTC
Created attachment 106699 [details]
Screenshot attached...

Product Version: NetBeans IDE Dev (Build 201103040000)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)

Steps to reproduce:
-Create new j2se project
-create new JFrame form
-switch the created frame from Design mode to the Source mode
-expand the fold with Generated Code
-go to the line with the initComponents method and collapse the fold by this line
-->> the line between two folds is painted over the one which is below the first one - see attached screenshot
Comment 1 Vladimir Riha 2011-03-14 08:53:06 UTC
Created attachment 106967 [details]
same problem in php file

The same happens on php web page if I click on the folding mark several times, resizing netbeans window or reopening the file fixes it.

Product Version: NetBeans IDE Dev (Build 201103130400)
Java: 1.6.0_24; Java HotSpot(TM) Client VM 19.1-b02
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Comment 2 Vladimir Riha 2011-03-15 11:51:10 UTC
It is happening quite random and only if I use the folding mark, keyboard shortcut and command View|Cold Folds|... works always fine. I gues it should be more like a P3
Comment 3 mklaehn 2011-04-11 07:16:56 UTC
(In reply to comment #2)
> It is happening quite random and only if I use the folding mark, keyboard
> shortcut and command View|Cold Folds|... works always fine. I gues it should be
> more like a P3

"quite random" i cannot support. everytime the codefold is expanded or collapsed and the editor is not forced to reset the carets position this happens to me. completely unrelated on what ui action (mouseclick, keyboard or (context) menu entry) caused the codefold to expand/collaps

as you pointed out this happens in java files. PHP i have to take your word for it. C++ files have this phenomenon as well.
Comment 4 Vladimir Riha 2011-04-11 07:31:00 UTC
Weird, I have just tried it in java file and it's not happening always and using context menu was fine, keyboard gave me 2 errors from 10 attempts and mouseclick was the worst. I have already asked in issue #196651 if it is a duplicate of this.

Product Version: NetBeans IDE Dev (Build 201104030400)
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Comment 5 mklaehn 2011-04-11 07:43:19 UTC
(In reply to comment #4)
> mouseclick was the worst. I have already asked in issue #196651 if it is a
> duplicate of this.

Going by the screenshot alone. They do seem to have a connection. i.e. not always being repainted properly after expanding/collapsing them.
issue #197586 seems to have the same connection.
Comment 6 Marian Mirilovic 2011-04-13 09:01:19 UTC
*** Bug 197415 has been marked as a duplicate of this bug. ***
Comment 7 Marian Mirilovic 2011-04-13 09:02:28 UTC
*** Bug 196651 has been marked as a duplicate of this bug. ***
Comment 8 Marian Mirilovic 2011-04-13 09:02:56 UTC
fix-in-nb701 - marked during Acceptance Survey as a stopper, too late for NB 7.0 so we need to deliver fix into NB 7.0.1
Comment 9 alied 2011-05-05 01:30:48 UTC
Not seen in:
Product Version: NetBeans IDE 7.0 (Build 201104211303)
Java: 1.6.0_25; Java HotSpot(TM) 64-Bit Server VM 20.0-b11
System: versión Linux 2.6.38.5 ejecutándose en amd64; UTF-8; es_AR (nb)
Comment 10 Miloslav Metelka 2011-05-24 14:05:19 UTC
I'm working on a new implementation of the code folding side bar which should resolve this problem.
Comment 11 Miloslav Metelka 2011-07-07 15:49:50 UTC
BTW the problem can also be reproduced with the following class:

public class FoldMarkProblem {
    
    void m() {
	new Runnable() {
	    public void run() { }
	};    }
    
}


I've made a fix for existing CodeFoldingSideBar implementation:

http://hg.netbeans.org/jet-main/rev/923f48d56e62

Unfortunately one more fix is needed that I'm working on right now.
Comment 12 Miloslav Metelka 2011-07-08 11:09:42 UTC
It should now be fixed completely:
http://hg.netbeans.org/jet-main/rev/195e058f48e6
Comment 13 Quality Engineering 2011-07-08 13:54:13 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/923f48d56e62
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #196281 - Code folding line painted over the folding node - two nested folds ending at single line.
Comment 14 Quality Engineering 2011-07-09 13:53:47 UTC
Integrated into 'main-golden', will be available in build *201107090600* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/195e058f48e6
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #196281 - Code folding line painted over the folding node - additional fix.
Comment 15 Vladimir Riha 2011-09-23 09:31:17 UTC
verified

Product Version: NetBeans IDE 7.1 Beta (Build 201109222201)
Java: 1.7.0; Java HotSpot(TM) Client VM 21.0-b17
System: Linux version 2.6.38-11-generic running on i386; UTF-8; en_US (nb)
Comment 16 emi 2011-11-18 07:59:20 UTC
Might I just add that I find this fix a bit counter-intuitive and perhaps wrong?

The code folding painter code was quite straight forward, while with the current fix it seems to go back and revert a pixel it drew itself.

I'm taking about the code marked with the comment:

>>  //Need to explicitly clear the previously drawn line under the mark

in the changeset http://hg.netbeans.org/main-golden/rev/195e058f48e6

Perhaps the code should actually 'look ahead' via some "nextInfo PaintInfo" in order to prevent that bad line being drawn?

I'm writing this here because the new code breaks my alternative code folding UI (posted here: http://netbeans.org/bugzilla/show_bug.cgi?id=145920 ).

I'll look some more later on -- perhaps there is some other way to fix this without going back.