Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
update on open and close with x
Browse files Browse the repository at this point in the history
  • Loading branch information
zalox committed Feb 13, 2018
1 parent f258753 commit 7e962d4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/notebook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,10 @@ void Notebook::open(const boost::filesystem::path &file_path_, size_t notebook_i
if(index!=static_cast<size_t>(-1))
close(index);
}));


if(source_view->update_tab_label)
source_view->update_tab_label(source_view);

//Add star on tab label when the page is not saved:
source_view->get_buffer()->signal_modified_changed().connect([this, source_view]() {
if(source_view->update_tab_label)
Expand Down Expand Up @@ -527,6 +530,10 @@ bool Notebook::close(size_t index) {
hboxes.erase(hboxes.begin()+index);
tab_labels.erase(tab_labels.begin()+index);
}
for(auto view: get_views()) { // Update all view tabs in case one clicks cross to close a buffer
if(view->update_tab_label)
view->update_tab_label(view);
}
return true;
}

Expand Down

0 comments on commit 7e962d4

Please sign in to comment.