chiark / gitweb /
Rework FilePosition to cache the last known width.
authorSimon Tatham <anakin@pobox.com>
Thu, 4 Jan 2024 11:38:40 +0000 (11:38 +0000)
committerSimon Tatham <anakin@pobox.com>
Thu, 4 Jan 2024 12:14:44 +0000 (12:14 +0000)
commit7764b5f2674c77eb63261748f586036670f39cc5
treecf6b8fb1f3077e79f29b22461188c2b741da849f
parent1ce1b877fd137ee53a1fba16ead1ca52fb3ad660
Rework FilePosition to cache the last known width.

This way, it doesn't have to eagerly throw away its 'fine' position:
it can keep it until it's next called on, and then reuse it if the
new render width happens to match.

I think it's also simpler than the previous approach!
src/file.rs