def set_geometry(self, size: _YX) -> None:
super().set_geometry(size)
+ self._unbookmark()
if self._drawable:
self._y_pgscroll = self._size.y // 2
self._wrapped.clear()
= max(self._lowest_read_history_idx_pos,
visible_lines[-1].history_idx_pos)
- def bookmark(self) -> None:
- 'Store next idx to what most recent line we have (been) scrolled.'
+ def _unbookmark(self) -> None:
if self._bookmark_idx_neg != self._UNSET_IDX_NEG\
and len(self._wrapped) > -self._bookmark_idx_neg:
del self._wrapped[self._bookmark_idx_neg]
if self._bookmark_idx_neg > self._wrapped_idx_neg:
self._wrapped_idx_neg += 1
self._bookmark_idx_neg = self._UNSET_IDX_NEG
+
+ def bookmark(self) -> None:
+ 'Store next idx to what most recent line we have (been) scrolled.'
+ self._unbookmark()
if self._lowest_read_history_idx_pos < self._history_n_lines_cut:
return
if not self._wrapped: