Bugs item #539435, was opened at 2002-04-04 14:44
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=438935&aid=539435&group_id=44253
Category: Definitions (source editor)
Group: Annoying
Status: Open
Resolution: None
Priority: 8
Submitted By: Eric E. Allen (eallen)
Assigned to: Jim Van Fleet (bigfleet)
Summary: Inaccurate reporting of line and column
Initial Comment:
This bug applies only to the (thus far) unreleased
drjava20020404-* and up.
I spent some time looking at, and playing with, the
new line number code. It's pretty clear that the
problem is what I call a Liar View: the model seems
to be correct, but the view isn't displaying it
properly. In particular, when moving the caret with
the arrow keys, the line reporting is consistently
reporting the position_before_ the last line change.
Also, the current column is reported as 1 at every
key movement after the first (yet test cases on the
model side show that the current column is computed
properly).
Here is my hypothesis:
The listener for updating the position display is
registered with the DefinitionsPane. Perhaps the
DefinitionsPane is notifying the listener of a
mouse/key movement before the model is updated? This
would at least explain the lag in the update of line
positions. The other problems are potentially due to
race conditions between the model and the listener.
I think that what we really want is for the listener
to be notified by the GlobalModel directly. But,
currently, there is no method for notifying
GlobalModelListeners of position changes (and I'm not
sure that we really want to notify all listeners of
every position change).
Unfortunately, I don't have any more time to help
with this right now. But I suggest commenting out the
line that sets the text in MainFrame.PositionField
until this problem is fixed.
BTW, even if the listener is notified by
DefinitionsPane, shouldn't it be a CaretListener
instead of a Key- and MouseListener? However, I made
that change on my copy and it had no effect on the
problem.
-- Eric
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=438935&aid=539435&group_id=44253
|