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 245309 - Code blocks cause the line wrap algorithm to surpass the right margin
Summary: Code blocks cause the line wrap algorithm to surpass the right margin
Status: REOPENED
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-30 05:38 UTC by _ gtzabari
Modified: 2016-01-03 04:19 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Testcase (3.93 KB, application/octet-stream)
2014-07-13 16:30 UTC, _ gtzabari
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gtzabari 2014-06-30 05:38:12 UTC
Product Version: NetBeans IDE Dev (Build 201406050001)
Java: 1.8.0_05; Java HotSpot(TM) 64-Bit Server VM 25.5-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_05-b13
System: Windows 7 version 6.1 running on amd64; Cp1252; en_CA (nb)
User directory: C:\Users\Gili\AppData\Roaming\NetBeans\dev
Cache directory: C:\Users\Gili\AppData\Local\NetBeans\Cache\dev

Following up on bug #244983, the code-format algorithm treats tabs as one character, causing the line wrap algorithm to surpass the right margin.

This issue was fixed for the Javascript editor and now I'm requesting it be fixed for the Java editor.

On a more general note, is there a way to isolate this common behavior across all languages so we can fix it in one place?
Comment 1 Dusan Balek 2014-07-11 13:35:08 UTC
Unfortunately, I cannot reproduce the problem in Java Editor using the current dev build. Could you please create a reproducible test case and attach it to the issue? Thanks.
Comment 2 _ gtzabari 2014-07-13 16:29:40 UTC
I was wrong. Something else (a comma or dot) is triggering this issue. Try invoking code-format in the attached testcase and notice that line 20 surpasses the right margin by 2 characters.
Comment 3 _ gtzabari 2014-07-13 16:30:14 UTC
Created attachment 148015 [details]
Testcase
Comment 4 Dusan Balek 2014-07-14 10:42:14 UTC
The behavior is as designed. According to the current wrapping rules, there is no point to wrap your line (as the last method call argument ends before the right margin).
Comment 5 _ gtzabari 2014-07-14 16:05:03 UTC
I am expecting line wrapping to ensure that not a single character surpasses the right margin.

If this isn't your definition of "too long", can we convert this issue into a feature request asking for a change of definition?
Comment 6 _ gtzabari 2016-01-03 04:19:38 UTC
I've converted this issue to an ENHANCEMENT. Please update the Target Milestone accordingly.