Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 36587 - [misc] line numbers incorrect when StyledText widget word wrap is on
Summary: [misc] line numbers incorrect when StyledText widget word wrap is on
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-16 14:10 EDT by Kit Lo CLA
Modified: 2021-11-21 17:24 EST (History)
9 users (show)

See Also:


Attachments
Drawing problems using SWT.WRAP (151.48 KB, image/jpeg)
2007-11-22 08:11 EST, Philip Corlatan CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kit Lo CLA 2003-04-16 14:10:46 EDT
Testcase:
- turn StyledText widget's word wrap on in a simple editor
- open a file with 30 lines (for example), where two of the line are very long
- line number ruler shows 1 - 30, but text widget has 32 lines
Comment 1 Dani Megert CLA 2003-11-24 06:13:31 EST
SWT.WRAP is currently not supported.
See also bug 47280
Comment 2 Igor Russkih CLA 2007-03-11 18:42:10 EDT
Even SWT.WRAP is not going to be supported, could be fixed with:

--- LineNumberRulerColumn.java	Fri Oct 20 07:25:18 2006
+++ LineNumberRulerColumn_Fixed.java	Tue Feb 27 21:25:30 2007

@@ -659,7 +657,9 @@
 			if (widgetLine == -1)
 				continue;
 
-			int lineHeight= fCachedTextWidget.getLineHeight(fCachedTextWidget.getOffsetAtLine(widgetLine));
+            // FIXED: For wrapped text widgets
+            int lineHeight= fCachedTextWidget.getLinePixel(widgetLine+1) - fCachedTextWidget.getLinePixel(widgetLine); 
Comment 3 Philip Corlatan CLA 2007-11-22 08:10:38 EST
In our case this issue causes scrolling problems in an editor using the StyledText widget with SWT.WRAP.
If the text is wrapped and you try to get to the next row by pressing "arrow down" (when the cursor is at the beginning of the line) this does not work.

There are also some drawing problems which seem to occur when rich text is wrapped and such wrapped lines are deleted.
To reproduce this issue, paste a text that exceeds the total height of
the widget and has long lines that are wrapped in the editor. If some lines are deleted then and you scroll down using the scroll bar you get some strange display errors like in the attached screenshot.
Comment 4 Philip Corlatan CLA 2007-11-22 08:11:52 EST
Created attachment 83528 [details]
Drawing problems using SWT.WRAP
Comment 5 Dani Megert CLA 2007-11-22 09:16:04 EST
Please report the drawing problems directly to SWT.
Comment 6 Eclipse Webmaster CLA 2019-09-06 16:19:20 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.
Comment 7 Eclipse Genie CLA 2021-11-21 17:24:24 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.