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 217809 - Wrong position of folding line
Summary: Wrong position of folding line
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-04 12:39 UTC by Vladimir Riha
Modified: 2012-11-08 08:16 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample file (5.15 KB, text/html)
2012-09-04 12:39 UTC, Vladimir Riha
Details
screenshot (163.95 KB, image/png)
2012-09-04 12:39 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-04 12:39:18 UTC
Created attachment 123878 [details]
sample file

Please check the screenshot, the first folding line does not match neither <head> or <html> tags. It's reproducible.


Product Version: NetBeans IDE Dev (Build 201209040947)
Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09
System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2012-09-04 12:39:41 UTC
Created attachment 123879 [details]
screenshot
Comment 2 Svata Dedic 2012-09-04 16:31:40 UTC
Note that the blue line outlines the surrounding "brace" rather than code fold - although many times brace (e.g. curly brace in java, or tag in HTML) introduces a fold.

The fold (black line) is probably wrong on the supplied picture; comments which begin on line 6 end on the same line; the comment ending at line 16 actually stars on line 15. So the fold should span line 15-16. 

The brace outline seems to cover correctly the area between head and its matching end tag (assuming caret was on the start or end head tag).

If you agree with the above, pls. reassign to HTML for evaluation of the folding defect.
Comment 3 Vladimir Riha 2012-09-05 05:45:53 UTC
thanks, yes, the black line is what I meant. The code fold should also be for <head> tags (lines 7-29). Reassigning to HTML
Comment 4 Marek Fukala 2012-09-17 13:08:10 UTC
Neither css nor html StructureScanner is the provider of the weird first fold. I've tried to debug and html provides correct folds, css provides no folds for the file.

Svato, can you please find out who is the culprit and possibly reassign? Thanks.
Comment 5 Svata Dedic 2012-09-17 13:13:38 UTC
OK
Comment 6 Svata Dedic 2012-09-17 14:57:43 UTC
Apologies, Marek, the defective fold is provided by the Javascript support (from offset 216 to offset 516), bcs. the JS support does not translate Snapshot offsets from embedding-relative positions to absolute ones for comments. 

Petre, could you please review/correct the supplied fix ? It may be also worth to review other places with new OffsetRange().
Comment 7 Svata Dedic 2012-09-17 14:58:59 UTC
Changeset: 8d8c4a12dfed
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2012-09-17 16:58
Message:   Issue #217809 - Wrong position of folding line: fixed
Translated comment folds to global offsets
Comment 8 Quality Engineering 2012-09-19 03:06:58 UTC
Integrated into 'main-golden', will be available in build *201209190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/8d8c4a12dfed
User: Svata Dedic <sdedic@netbeans.org>
Log: Issue #217809 - Wrong position of folding line: fixed
Translated comment folds to global offsets
Comment 9 Vladimir Riha 2012-09-19 07:09:29 UTC
seems to be fine, thanks

Product Version: NetBeans IDE Dev (Build 201209190001)
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 Svata Dedic 2012-11-08 08:16:09 UTC
*** Bug 216573 has been marked as a duplicate of this bug. ***