Skip to content

Commit

Permalink
Fix auto-close bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Peeters committed Nov 9, 2024
1 parent 005ad10 commit 3fdb0f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
20 changes: 16 additions & 4 deletions frontend/gtkmm/NotebookWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1252,10 +1252,6 @@ void NotebookWindow::add_cell(const DTree& tr, DTree::iterator it, bool visible)
newcell.outbox->show_hide_requested.connect(
sigc::bind( sigc::mem_fun(this, &NotebookWindow::cell_toggle_visibility), i ) );

if(prefs.auto_close_latex) {
cell_toggle_visibility(it, i);
}

#if GTKMM_MINOR_VERSION>=10
to_reveal.push_back(&newcell.outbox->rbox);
#endif
Expand Down Expand Up @@ -1858,6 +1854,22 @@ bool NotebookWindow::cell_content_execute(DTree::iterator it, int canvas_number,
// std::cerr << "Executing cell " << it->id().id << std::endl;
compute->execute_cell(it);

// If this is a LaTeX input cell, and auto-close is turned on, close
// the input cell.
if(it->cell_type==DataCell::CellType::latex) {
if(prefs.auto_close_latex) {
for(unsigned int i=0; i<canvasses.size(); ++i) {
auto vis = canvasses[i]->visualcells.find(&(*it));
if(vis==canvasses[i]->visualcells.end()) {
throw std::logic_error("Cannot find visual cell.");
}
else {
(*vis).second.inbox->edit.hide();
}
}
}
}

return true;
}

Expand Down
1 change: 1 addition & 0 deletions web2/cadabra2/source/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ <h3>github devel branch (2.5.9)</h3>
<li>Fix inconsistent behaviour and crashes with split-view mode.</li>
<li>Fix display of LaTeXForm properties.</li>
<li>Documentation updates.</li>
<li>Close LaTeX input cells on running them (configurable).</li>
</ul>

<a name="2.5.8"></a>
Expand Down

0 comments on commit 3fdb0f9

Please sign in to comment.