-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On lines listed, also diff line contents
When buffer is cleared using `/buffer clear` and more lines are added, line pointers may be reused. Before, if the app was disconnected during these events, after reconnection it was possible for the lines to appear out of order. This happened because normally we calculate diff using pointers only, and if we had an older line with the same pointer as the newer one, the adapter would reuse the old view holder, which might've been displaying the wrong line. This fixes the issue by also looking at line contents while diffing. This solution is not ideal: * While we can reliably tell whether the contents of two lines are the same, during the diffing we also want to know whether two lines represent the same thing, even if the contents have changed. As the pointer can be reused, sometimes `areItemsTheSame` will return a false positive. However, with this change the negative effect of this shouldn't go beyond wrong animation being applied. * Read marker may appear in a wrong place. We save the pointer to the last read line locally, and if the pointer is reused, there's no way for us to tell that the line is wrong. Fixes #577
- Loading branch information
Showing
2 changed files
with
32 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters