Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 47280

Summary: [misc] Current line highlight is incorrect for wrapped lines
Product: [Eclipse Project] Platform Reporter: Davor Cubranic <davor.cubranic>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: abuehler, ahti, francois, gunnar, heath.borders, matthew, pcorlatan, pombredanne, sune, yolian
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Davor Cubranic CLA 2003-11-22 02:14:38 EST
Build 200311211210, Windows XP Home Edition

The line highlight of logical lines extending over several lines of a StyledText
with word wrap on covers only the very first line unless it's the last line in
the editor.

1. Create a subclass of TextEditor that sets the source viewer's StyledText's
word wrap to true.
2. Start typing a very long line in the empty editor. As the line wraps into the
second line on the screen, the highlight extends to show it.
3. Press enter. Go back to the "multi-line" line. The highlight extends only
over the first "screen" line.
4. Erase the empty line at the end of the editor. The highlight now again
extends over all "screen" lines of the logical line, as it should.
Comment 1 Davor Cubranic CLA 2003-11-22 03:21:02 EST
BTW, I can only replicate this bug when running the runtime workbench without
stopping it while it's painting. When I put a breakpoint at, for example, line
235 of CursorLinePainter.paint, the wrapped lines are highlighted correctly,
even if I immediately press F8.

Furthermore, if I get the wrapped lines to be correctly highlighted as described
above, and then disable the breakpoints and move the cursor to the bottom
(empty) line, the highlight will still be two visual lines high. That is, it
will highlight the second visual line of the first logical line in addition to
the line where the cursor is. This behaviour goes away and the original buggy
behaviour reappears if I cause the full redraw of the window (say by alt-tabbing
away and then back to it), rather than just move the cursor around.
Comment 2 Dani Megert CLA 2003-11-24 06:13:22 EST
SWT.WRAP is currently not supported.
See also bug 36587
Comment 3 Davor Cubranic CLA 2003-11-24 13:55:33 EST
I tried tracking this down and put println's in various places to check what
colour is being used for the highlight. I think I went all the way to the bottom
before the OS call, and the colours were what they were supposed to be. If you
can give me a hint what might be causing this, I don't mind exploring it further
on my own.
Comment 4 Dani Megert CLA 2003-11-25 03:29:35 EST
As stated before the current editor infrastructure does not support wrapping. It
is line based and hence the (document) model knows nothing about lines being
wrapped by the widget. Current line highlighting is just one place where you see
the problem: others are line numbers or vertical and overview ruler markers.

If you want to fix this you will need another layer which does the mapping
between the line oriented document model and the lines wrapped by the widget itself.
Comment 5 Eclipse Webmaster CLA 2019-09-06 15:33:04 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 6 Eclipse Genie CLA 2021-12-26 15:19:08 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.