mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
BugFix: reload list of recent sessions after any change to history
This commit is contained in:
@@ -84,12 +84,14 @@ struct History
|
||||
bool front_is_valid;
|
||||
bool load_at_start;
|
||||
bool save_on_exit;
|
||||
bool changed;
|
||||
|
||||
History() {
|
||||
path = IMGUI_LABEL_RECENT_FILES;
|
||||
front_is_valid = false;
|
||||
load_at_start = false;
|
||||
save_on_exit = false;
|
||||
changed = false;
|
||||
}
|
||||
void push(const std::string &filename) {
|
||||
if (filename.empty()) {
|
||||
@@ -101,6 +103,7 @@ struct History
|
||||
if (filenames.size() > MAX_RECENT_HISTORY)
|
||||
filenames.pop_back();
|
||||
front_is_valid = true;
|
||||
changed = true;
|
||||
}
|
||||
void remove(const std::string &filename) {
|
||||
if (filename.empty())
|
||||
@@ -108,6 +111,7 @@ struct History
|
||||
if (filenames.front() == filename)
|
||||
front_is_valid = false;
|
||||
filenames.remove(filename);
|
||||
changed = true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2771,12 +2771,13 @@ void Navigator::RenderMainPannel()
|
||||
// fill the session list depending on the mode
|
||||
static std::list<std::string> sessions_list;
|
||||
// change session list if changed
|
||||
if (selection_session_mode_changed) {
|
||||
if (selection_session_mode_changed || Settings::application.recentSessions.changed) {
|
||||
|
||||
// selection MODE 0 ; RECENT sessions
|
||||
if ( selection_session_mode == 0) {
|
||||
// show list of recent sessions
|
||||
sessions_list = Settings::application.recentSessions.filenames;
|
||||
Settings::application.recentSessions.changed = false;
|
||||
}
|
||||
// selection MODE 1 : LIST FOLDER
|
||||
else if ( selection_session_mode == 1) {
|
||||
|
||||
Reference in New Issue
Block a user