+ //this dog bites his tail
+ if (empty()) {
+ push_back(CursorSlice(*inset_));
+ top().idx() = lastidx();
+ top().pit() = lastpit();
+ top().pos() = lastpos();
+ return;
+ }
+
+ CursorSlice & tip = top();
+
+ if (tip.pos() != 0) {
+ --tip.pos();
+ } else if (tip.pit() != 0) {
+ --tip.pit();
+ tip.pos() = lastpos();
+ return;
+ } else if (tip.idx() != 0) {
+ --tip.idx();
+ tip.pit() = lastpit();
+ tip.pos() = lastpos();
+ return;
+ } else {
+ pop_back();
+ return;
+ }
+
+ // move into an inset to the left if possible
+ InsetBase * n = 0;
+
+ if (inMathed()) {
+ n = (tip.cell().begin() + tip.pos())->nucleus();
+ } else {
+ if (paragraph().isInset(tip.pos()))
+ n = paragraph().getInset(tip.pos());
+ }
+
+ if (n && n->isActive()) {
+ push_back(CursorSlice(*n));
+ top().idx() = lastidx();
+ top().pit() = lastpit();
+ top().pos() = lastpos();
+ }