Commit 90bfbc2
committed
Fix faulty selection update when bringing project explorer to top
When link-with-editor is enabled, the IPartListener in LinkEditorAction
scheduled updateSelectionJob from both partActivated and
partBroughtToTop. This introduces two issues:
1. Selection updates are triggered just because the part is
(programmatically) brought to top, even if it is not activated, which is
unintended.
2. Both events fire for the same editor activation, so under normal
timing the second schedule() call merely resets the job timer and the
job runs once. However, on slow machines (CI on Linux/GTK) the two
events can fire more than LINK_HELPER_DELAY (120 ms) apart, causing the
job to complete from the first event and then be rescheduled and run
again from the second. This results in findSelection() being called
twice, which is not the intended behavior as indicated by breaking the
assertion assertEquals(1, findSelectionCount) in
testLinkHelperEditorActivation.
Fix: remove the job scheduling from partBroughtToTop. The partActivated
event is the correct signal for "an editor became active", which is
exactly what the link-with-editor feature needs to track.
Fixes #13381 parent 0b9521c commit 90bfbc2
1 file changed
Lines changed: 6 additions & 3 deletions
File tree
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
154 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
0 commit comments