}
// Now that we know exactly what we want to do, let's do it!
cur.selHandle(select);
- cur.autocorrect() = false;
cur.clearTargetX();
cur.macroModeClose();
// try moving forward or backwards as necessary...
break;
//case LFUN_SERVER_GET_XY:
- // sprintf(dispatch_buffer, "%d %d",);
// break;
case LFUN_SERVER_SET_XY: {
case LFUN_SPACE_INSERT:
cur.recordUndoSelection();
- cur.insert(MathAtom(new InsetMathSpace(from_ascii(","))));
+ cur.insert(MathAtom(new InsetMathSpace));
break;
case LFUN_MATH_SPACE:
cur.recordUndoSelection();
if (cmd.argument().empty())
- cur.insert(MathAtom(new InsetMathSpace(from_ascii(","))));
- else
- cur.insert(MathAtom(new InsetMathSpace(cmd.argument())));
+ cur.insert(MathAtom(new InsetMathSpace));
+ else {
+ string const name = cmd.getArg(0);
+ string const len = cmd.getArg(1);
+ cur.insert(MathAtom(new InsetMathSpace(name, len)));
+ }
break;
case LFUN_ERT_INSERT:
if (name == "ref") {
InsetMathRef tmp(name);
data = tmp.createDialogStr(to_utf8(name));
+ } else if (name == "mathspace") {
+ InsetMathSpace tmp;
+ data = tmp.createDialogStr();
}
cur.bv().showDialog(to_utf8(name), data);
break;
// getStatus is not called with a valid reference and the
// dialog would not be applyable.
string const name = cmd.getArg(0);
- flag.setEnabled(name == "ref");
+ flag.setEnabled(name == "ref" || name == "mathspace");
break;
}
#ifdef AUTOCORRECT
// leave autocorrect mode if necessary
- if (cur.autocorrect() && c == ' ') {
+ if (c == ' ' && cur.autocorrect()) {
cur.autocorrect() = false;
+ cur.message(_("Autocorrect Off ('!' to enter)"));
+ return true;
+ }
+ if (c == '!' && !cur.autocorrect()) {
+ cur.autocorrect() = true;
+ cur.message(_("Autocorrect On (<space> to exit)"));
return true;
}
#endif
// no special circumstances, so insert the character without any fuss
cur.insert(c);
- cur.autocorrect() = true;
+#ifdef AUTOCORRECT
+ if (!cur.autocorrect())
+ cur.message(_("Autocorrect Off ('!' to enter)"));
+ else
+ cur.message(_("Autocorrect On (<space> to exit)"));
+#endif
return true;
}