}
-void MathNestInset::getCursorPos(CursorSlice const & sl,
+void MathNestInset::cursorPos(CursorSlice const & sl, bool boundary,
int & x, int & y) const
{
// FIXME: This is a hack. Ideally, the coord cache should not store
break;
case LFUN_FINISHED_DOWN:
+ ++cur.pos();
cur.bv().cursor() = cur;
break;
} else if (cur.posRight() || idxRight(cur)
|| cur.popRight() || cur.selection())
;
- else
+ else {
cmd = FuncRequest(LFUN_FINISHED_RIGHT);
+ cur.undispatched();
+ }
break;
case LFUN_LEFTSEL:
} else if (cur.posLeft() || idxLeft(cur)
|| cur.popLeft() || cur.selection())
;
- else
+ else {
cmd = FuncRequest(LFUN_FINISHED_LEFT);
+ cur.undispatched();
+ }
break;
case LFUN_UPSEL:
break;
}
cur.selHandle(cmd.action == LFUN_UPSEL);
- if (!cur.up())
+ if (!cur.up()) {
cmd = FuncRequest(LFUN_FINISHED_UP);
+ cur.undispatched();
+ }
// fixes bug 1598. Please check!
cur.normalize();
break;
break;
}
cur.selHandle(cmd.action == LFUN_DOWNSEL);
- if (!cur.down())
+ if (!cur.down()) {
cmd = FuncRequest(LFUN_FINISHED_DOWN);
+ cur.undispatched();
+ }
// fixes bug 1598. Please check!
cur.normalize();
break;
cur.insert(cmd.argument);
break;
}
- if (!interpret(cur, cmd.argument[0]))
+ if (!interpret(cur, cmd.argument[0])) {
cmd = FuncRequest(LFUN_FINISHED_RIGHT);
+ cur.undispatched();
+ }
break;
//case LFUN_GETXY:
handleFont(cur, cmd.argument, "mathrm");
break;
case LFUN_CODE:
+ if (currentMode() == TEXT_MODE)
handleFont(cur, cmd.argument, "texttt");
+ else
+ handleFont(cur, cmd.argument, "mathtt");
break;
case LFUN_FRAK:
handleFont(cur, cmd.argument, "mathfrak");
}
flag.setOnOff(cmd.argument[0] == align);
break;
+#endif
+ /// We have to handle them since 1.4 blocks all unhandled actions
+ case LFUN_ITAL:
case LFUN_BOLD:
- flag.setOnOff(tc == "mathbf");
- break;
case LFUN_SANS:
- flag.setOnOff(tc == "mathsf");
- break;
case LFUN_EMPH:
- flag.setOnOff(tc == "mathcal");
- break;
- case LFUN_ROMAN:
- flag.setOnOff(tc == "mathrm");
- break;
case LFUN_CODE:
- flag.setOnOff(tc == "mathtt");
- break;
case LFUN_NOUN:
- flag.setOnOff(tc == "mathbb");
- break;
+ case LFUN_ROMAN:
case LFUN_DEFAULT:
- flag.setOnOff(tc == "mathnormal");
+ flag.enabled(true);
break;
-#endif
case LFUN_MATH_MUTATE:
//flag.setOnOff(mathcursor::formula()->hullType() == cmd.argument);
flag.setOnOff(false);