Commit 9b317c4
rcartwright
This revision fixes a bug in the updating of document highlights and
improves the implementation of the "jump to line" function in
MainFrame.java. My recent string of commits focused on making DrJava
more responsive contained a troublesome bug that is proving
time-consuming to track down. FindAll result highlights are not
updated properly when a document is edited; the highlights do not move
with the document. When I backed out the refactoring to minimize the
creation of WrappedPositions and the refactoring to defer
reconstructing document positions when a kicked out document is remade
(waiting until the document becomes active), the highlighting bug went
away but when I only backed either of these two refactorings alone,
the bug persisted. This revision backs out both of these
refactorings. In the long term, I would like to see the
reconstruction of wrapped positions deferred until a document becomes
active. This optimization should work! I don't understand it can
affect the highlight updating process since non-active documents are
never edited. On the other hand, the minimization of WrappedPositions
may be an inherently flawed idea. If (and I do not yet know the
answer) the Swing library internally creates Positions that are
critical to updating highlights as a document is edited, then failing
to wrap these Positions could sabotage highlight updating. My
minimization strategy assumes that no Position internally created by
Swing needs to be wrapped.
The good news is that this revsion still appears to improve
responsiveness despite backing out these two refactorings. The key is
a minor change to _jumpToLine in MainFrame.java, which performs the
guts of the "go to line" action (CNTL-G). It makes jumping to a line
near the end of a large document MUCH faster than it has been in
recent builds. The following files were modified or added:
M src/edu/rice/cs/drjava/model/cache/DocumentCache.java
M src/edu/rice/cs/drjava/model/cache/DocumentCacheTest.java
M src/edu/rice/cs/drjava/model/DummyOpenDefDoc.java
M src/edu/rice/cs/drjava/model/AbstractGlobalModel.java
M src/edu/rice/cs/drjava/model/OpenDefinitionsDocument.java
M src/edu/rice/cs/drjava/ui/MainFrame.java
M src/edu/rice/cs/drjava/ui/JUnitPanel.java
M src/edu/rice/cs/util/FileOps.java
M src/edu/rice/cs/util/text/AbstractDocumentInterface.java
M src/edu/rice/cs/util/text/SwingDocument.java
A src/edu/rice/cs/util/text/SwingDocumentInterface.java
A src/edu/rice/cs/util/NullFile.java
git-svn-id: file:///tmp/test-svn/trunk@4038 fe72c1cf-3628-48e9-8b72-1c46755d3cff1 parent fb266d9 commit 9b317c4
File tree
12 files changed
+274
-199
lines changed- drjava/src/edu/rice/cs
- drjava
- model
- cache
- ui
- util
- text
12 files changed
+274
-199
lines changedLines changed: 169 additions & 142 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
| 231 | + | |
| 232 | + | |
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
| 344 | + | |
| 345 | + | |
349 | 346 | | |
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
177 | | - | |
178 | | - | |
| 176 | + | |
179 | 177 | | |
180 | 178 | | |
181 | | - | |
| 179 | + | |
182 | 180 | | |
183 | 181 | | |
184 | 182 | | |
| |||
190 | 188 | | |
191 | 189 | | |
192 | 190 | | |
193 | | - | |
194 | | - | |
195 | 191 | | |
196 | 192 | | |
197 | 193 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | 392 | | |
394 | 393 | | |
395 | 394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2110 | 2110 | | |
2111 | 2111 | | |
2112 | 2112 | | |
2113 | | - | |
2114 | | - | |
| 2113 | + | |
| 2114 | + | |
2115 | 2115 | | |
2116 | 2116 | | |
2117 | 2117 | | |
| |||
4763 | 4763 | | |
4764 | 4764 | | |
4765 | 4765 | | |
4766 | | - | |
| 4766 | + | |
4767 | 4767 | | |
4768 | | - | |
4769 | | - | |
4770 | | - | |
4771 | | - | |
| 4768 | + | |
| 4769 | + | |
| 4770 | + | |
| 4771 | + | |
4772 | 4772 | | |
4773 | 4773 | | |
4774 | 4774 | | |
| |||
6447 | 6447 | | |
6448 | 6448 | | |
6449 | 6449 | | |
6450 | | - | |
| 6450 | + | |
6451 | 6451 | | |
6452 | 6452 | | |
6453 | 6453 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
65 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
Lines changed: 8 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | 61 | | |
67 | 62 | | |
68 | 63 | | |
69 | | - | |
70 | | - | |
| 64 | + | |
| 65 | + | |
71 | 66 | | |
72 | 67 | | |
73 | 68 | | |
| |||
0 commit comments