Skip to content

Commit

Permalink
Fix inconsistent behaviour and crashes with LaTeX input cells in spli…
Browse files Browse the repository at this point in the history
…t views.
  • Loading branch information
Kasper Peeters committed Oct 25, 2024
1 parent 5591c8d commit 8d83b4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/gtkmm/NotebookWindow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ void NotebookWindow::add_cell(const DTree& tr, DTree::iterator it, bool visible)
#ifdef DEBUG
std::cerr << "found a visualcell for cell " << &(*it) << " in canvas " << i << std::endl;
#endif
if(i==0 && it->cell_type==DataCell::CellType::python) {
if(i==0 && (it->cell_type==DataCell::CellType::python || it->cell_type==DataCell::CellType::latex)) {
global_buffer = canvasses[i]->visualcells[&(*it)].inbox->buffer;
}
continue;
Expand Down Expand Up @@ -1699,8 +1699,10 @@ bool NotebookWindow::cell_toggle_visibility(DTree::iterator it, int )
if(parent->cell_type==DataCell::CellType::latex) {
// FIXME: we are not allowed to do this directly, all should go through
// actions.
std::cerr << "toggling visibility" << std::endl;
parent->hidden = !parent->hidden;
for(unsigned int i=0; i<canvasses.size(); ++i) {
std::cerr << "canvas " << i << std::endl;
auto vis = canvasses[i]->visualcells.find(&(*parent));
if(vis==canvasses[i]->visualcells.end()) {
throw std::logic_error("Cannot find visual cell.");
Expand Down

0 comments on commit 8d83b4f

Please sign in to comment.