[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug swing/26842] JTextArea with lineWrap=true - wrong caret behavior in
From: |
thebohemian at gmx dot net |
Subject: |
[Bug swing/26842] JTextArea with lineWrap=true - wrong caret behavior in 2nd line |
Date: |
30 Mar 2006 21:18:57 -0000 |
------- Comment #1 from thebohemian at gmx dot net 2006-03-30 21:18 -------
Debugging things is pretty slow but here is what I found out already:
If one types: abc<enter>
This will leave the WrappedPlainDocument with two LeafElements. The dump will
look like:
<paragraph>
<content>
[0,4][abc
]
<content>
[4,5][
]
Now while investigating the View instances I found out that the WrappedLine
instance for the first line has the offsets 0 - 4 and for the second line it is
4 - 5. This is ok.
After typing another char things will look like this:
text: "abc\nd" (Cursor will stay before the 'd')
document dump:
<paragraph>
<content>
[0,4][abc
]
<content>
[4,6][a
]
start and end offset of WrappedLine
#0: 0 - 5
#1: 5 - 6
These numbers are obviously wrong. Since the first line has not changed the end
offset for the first WrappedLine should be 4. The start offset for the second
WrappedLine should be 4, too.
As the WrappedLine instances are child view I suspect that they are not
properly updated as a consequence of insertUpdate() calls.
--
thebohemian at gmx dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-03-30 21:18:57
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26842