On Mon, Nov 12, 2007 at 10:12:40PM -0000, [EMAIL PROTECTED] wrote: > - > - // fix cursor if right of p > - if (thisPos >= int(p)) > - cur[thisSlice].pos() -= p - (macroPos + 1); > - > - // was the macro inset just inserted and was now folded? > - if (cur[thisSlice].pos() == int(macroPos + 1) > - && fromInitToNormalMode > - && macroInset->arity() > 0 > - && thisSlice + 1 == int(cur.depth())) { > - // then enter it if the cursor was just behind > - cur[thisSlice].pos() = macroPos; > - cur.push_back(CursorSlice(*macroInset)); > - macroInset->idxFirst(cur); > + > + // fix up cursor > + if (thisSlice != -1) { > + // fix cursor if right of p > + if (thisPos >= int(p)) > + cur[thisSlice].pos() -= p - (macroPos + 1); > + > + // was the macro inset just inserted and was now folded? > + if (cur[thisSlice].pos() == int(macroPos + 1) > + && fromInitToNormalMode > + && macroInset->arity() > 0 > + && thisSlice + 1 == int(cur.depth())) { > + // then enter it if the cursor was just behind > + cur[thisSlice].pos() = macroPos; > + cur.push_back(CursorSlice(*macroInset)); > + macroInset->idxFirst(cur); > + } > } > }
Could we return early? I.e. 'if (thisSlice == -1)\n\t\treturn;' ? Andre'