summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2970585)
We currently cannot restore multiple views of the same buffer properly.
On the mac, we even crash.
So do not try it, record each file only once in the last opened list.
Fixes: #9483.
void LastOpenedSection::add(FileName const & file, bool active)
{
LastOpenedFile lof(file, active);
void LastOpenedSection::add(FileName const & file, bool active)
{
LastOpenedFile lof(file, active);
+ // check if file is already recorded (this can happen
+ // with multiple buffer views). We do only record each
+ // file once, since we cannot restore multiple views
+ // currently, we even crash in some cases (see #9483).
+ // FIXME: Add session support for multiple views of
+ // the same buffer (split-view etc.).
+ for (size_t i = 0; i < lastopened.size(); ++i) {
+ if (lastopened[i].file_name == file)
+ return;
+ }
lastopened.push_back(lof);
}
lastopened.push_back(lof);
}