- if (cur.paragraph().layout().isEnvironment()
- && cur.buffer()->params().documentClass().hasLayout(from_ascii("Separator"))) {
+ if (!cur.buffer()->params().documentClass().hasLayout(from_ascii("Separator"))) {
+ enable = false;
+ break;
+ }
+ if (cmd.argument() == "outer") {
+ // check if we have an environment in our nesting hierarchy
+ bool res = false;
+ depth_type const current_depth = cur.paragraph().params().depth();
+ pit_type pit = cur.pit();
+ Paragraph cpar = pars_[pit];
+ while (true) {
+ if (pit == 0 || cpar.params().depth() == 0)
+ break;
+ --pit;
+ cpar = pars_[pit];
+ if (cpar.params().depth() < current_depth)
+ res = cpar.layout().isEnvironment();
+ }
+ enable = res;
+ break;
+ }
+ else if (cur.paragraph().layout().isEnvironment()) {