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

Commit 71e6d86

Browse files
committed
update on open and close with x
1 parent ee6a084 commit 71e6d86

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/notebook.cc

+8-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ void Notebook::open(const boost::filesystem::path &file_path_, size_t notebook_i
314314
if(index!=static_cast<size_t>(-1))
315315
close(index);
316316
}));
317-
317+
318+
if(source_view->update_tab_label)
319+
source_view->update_tab_label(source_view);
320+
318321
//Add star on tab label when the page is not saved:
319322
source_view->get_buffer()->signal_modified_changed().connect([this, source_view]() {
320323
if(source_view->update_tab_label)
@@ -527,6 +530,10 @@ bool Notebook::close(size_t index) {
527530
hboxes.erase(hboxes.begin()+index);
528531
tab_labels.erase(tab_labels.begin()+index);
529532
}
533+
for(auto view: get_views()) { // Update all view tabs in case one clicks cross to close a buffer
534+
if(view->update_tab_label)
535+
view->update_tab_label(view);
536+
}
530537
return true;
531538
}
532539

0 commit comments

Comments
 (0)