LASSERT(cur.inMathed(), return);
cur.pos() = 0;
cur.resetAnchor();
- cur.setSelection(true);
+ cur.selection(true);
cur.pos() = cur.lastpos();
if (cmd.action() != LFUN_MATH_MODE)
// LFUN_MATH_MODE has a different meaning in math mode
case LFUN_CHAR_DELETE_FORWARD:
if (!cur.selection()) {
- bool was_separator = cur.paragraph().isEnvSeparator(cur.pos());
if (cur.pos() == cur.paragraph().size())
// Par boundary, force full-screen update
singleParUpdate = false;
needsUpdate |= erase(cur);
cur.resetAnchor();
- if (was_separator && cur.pos() == cur.paragraph().size()
- && (!cur.paragraph().layout().isEnvironment()
- || cur.paragraph().size() > 0)) {
- // Force full-screen update
- singleParUpdate = false;
- needsUpdate |= erase(cur);
- cur.resetAnchor();
- }
- // It is possible to make it a lot faster still
- // just comment out the line below...
} else {
cutSelection(cur, true, false);
singleParUpdate = false;
docstring const layout = par.layout().name();
DocumentClass const & tc = bv->buffer().params().documentClass();
lyx::dispatch(FuncRequest(LFUN_LAYOUT, tc.plainLayout().name()));
- lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "parbreak"));
+ lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "plain"));
lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_BREAK, "inverse"));
lyx::dispatch(FuncRequest(LFUN_LAYOUT, layout));
} else {
- lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "parbreak"));
+ lyx::dispatch(FuncRequest(LFUN_SEPARATOR_INSERT, "plain"));
breakParagraph(cur);
}
Font const f(inherit_font, cur.current_font.language());
tm->setCursorFromCoordinates(cur, cmd.x(), y);
cur.setTargetX(cmd.x());
+ // Don't allow selecting a separator inset
+ if (cur.pos() && cur.paragraph().isEnvSeparator(cur.pos() - 1))
+ cur.posBackward();
if (cmd.y() >= wh)
lyx::dispatch(FuncRequest(LFUN_DOWN_SELECT));
else if (cmd.y() < 0)
// We continue with our existing selection or start a new one, so don't
// reset the anchor.
bvcur.setCursor(cur);
- bvcur.setSelection(true);
+ bvcur.selection(true);
if (cur.top() == old) {
// We didn't move one iota, so no need to update the screen.
cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor);
cur.push(*inset);
cur.top().pos() = cur.top().lastpos();
cur.resetAnchor();
- cur.setSelection(true);
+ cur.selection(true);
cur.top().pos() = 0;
}
break;
case LFUN_ESCAPE:
if (cur.selection()) {
- cur.setSelection(false);
+ cur.selection(false);
} else {
cur.undispatched();
// This used to be LFUN_FINISHED_RIGHT, I think FORWARD is more
case LFUN_CAPTION_INSERT: {
code = CAPTION_CODE;
string arg = cmd.getArg(0);
- bool varia = arg != "LongTableNoNumber"
+ bool varia = arg != "Unnumbered"
&& cur.inset().allowsCaptionVariation(arg);
// not allowed in description items,
// and in specific insets
docstring layout = cmd.argument();
if (layout.empty())
layout = tclass.defaultLayoutName();
- enable = !cur.inset().forcePlainLayout() && tclass.hasLayout(layout);
+ enable = !owner_->forcePlainLayout() && tclass.hasLayout(layout);
flag.setOnOff(layout == cur.paragraph().layout().name());
break;
case LFUN_PARAGRAPH_PARAMS:
case LFUN_PARAGRAPH_PARAMS_APPLY:
case LFUN_PARAGRAPH_UPDATE:
- enable = cur.inset().allowParagraphCustomization();
+ enable = owner_->allowParagraphCustomization();
break;
// FIXME: why are accent lfuns forbidden with pass_thru layouts?