Fix assertion in editing math (bug #8946)

This commit is contained in:
Juergen Spitzmueller 2014-02-06 11:08:33 +01:00
parent 1ec10ad964
commit b13f5dee53

View File

@ -1666,13 +1666,13 @@ void MenuDefinition::expandEnvironmentSeparators(BufferView const * bv)
if (!bv) if (!bv)
return; return;
Paragraph const par = bv->cursor().paragraph(); pit_type pit = bv->cursor().pit();
Paragraph const & par = bv->buffer().text().getPar(pit);
docstring const curlayout = par.layout().name(); docstring const curlayout = par.layout().name();
docstring outerlayout; docstring outerlayout;
depth_type current_depth = par.params().depth(); depth_type current_depth = par.params().depth();
// check if we have an environment in our nesting hierarchy // check if we have an environment in our nesting hierarchy
pit_type pit = bv->cursor().pit(); Paragraph cpar = par;
Paragraph cpar = bv->buffer().text().getPar(pit);
while (true) { while (true) {
if (pit == 0 || cpar.params().depth() == 0) if (pit == 0 || cpar.params().depth() == 0)
break; break;