Fix a crash in :inspect when switching from page 2 to a different item

Switching to a different item cleared the data, but didn't clear the
cache of where the page breaks are located. The subsequent call to
`get_data_paged(int which_page)` has a bounds check for the page number,
so it's sufficient to just clear the page breaks, which is already ok
as it resets the object to the same state as a newly-created instance.
This commit is contained in:
Steve Cotton 2023-08-16 12:40:40 +02:00 committed by Steve Cotton
parent 136e651d69
commit 7cb5f09bcf
2 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1,2 @@
### Miscellaneous and Bug Fixes
* Fix a crash in the `:inspect` window when pagination is used (issue #7851).

View file

@ -91,6 +91,7 @@ public:
void clear_data()
{
data.clear();
pages.clear();
}
void set_data(const std::string& new_data)