Commit d6b8d24
committed
filediff: Fix race condition on scrolling to first chunk (bgo#780625)
When we load a comparison, we scroll to the first difference. If the
first difference is on the first line of the file, we hit a race
condition (though reliably triggerable in some cases) where we set the
`next` attribute of our cursor and schedule a go_to_chunk on it, but
then our cursor changed callback kicks in and re-sets the `next`
attribute, causing us to go to the *second* difference.
There's no obvious reason why we need to set the cursor chunk here.
History vaguely suggests that it's because we weren't getting cursor
callbacks, so set up the necessary state manually. However, we can
just pass the actual chunk we have decided we want to go to, instead
of modifying the cursor itself, which seems a lot safer.1 parent f8d3814 commit d6b8d24
1 file changed
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1109 | 1109 | | |
1110 | 1110 | | |
1111 | 1111 | | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
1115 | | - | |
1116 | 1112 | | |
1117 | 1113 | | |
1118 | 1114 | | |
1119 | | - | |
1120 | | - | |
1121 | | - | |
1122 | | - | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1123 | 1119 | | |
1124 | 1120 | | |
1125 | 1121 | | |
| |||
0 commit comments