mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
fix math super/subscript
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8240 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
cd78cc2355
commit
1ef0ef4e2e
@ -66,11 +66,9 @@ private:
|
||||
|
||||
|
||||
///
|
||||
bool operator==(InsetCommandParams const &,
|
||||
InsetCommandParams const &);
|
||||
bool operator==(InsetCommandParams const &, InsetCommandParams const &);
|
||||
|
||||
///
|
||||
bool operator!=(InsetCommandParams const &,
|
||||
InsetCommandParams const &);
|
||||
bool operator!=(InsetCommandParams const &, InsetCommandParams const &);
|
||||
|
||||
#endif
|
||||
|
@ -424,10 +424,6 @@ void LyX::defaultKeyBindings(kb_keymap * kbmap)
|
||||
kbmap->bind("Delete", FuncRequest(LFUN_DELETE));
|
||||
kbmap->bind("BackSpace", FuncRequest(LFUN_BACKSPACE));
|
||||
|
||||
// sub- and superscript -MV
|
||||
kbmap->bind("~S-underscore", FuncRequest(LFUN_SUBSCRIPT));
|
||||
kbmap->bind("~S-asciicircum", FuncRequest(LFUN_SUPERSCRIPT));
|
||||
|
||||
// kbmap->bindings to enable the use of the numeric keypad
|
||||
// e.g. Num Lock set
|
||||
//kbmap->bind("KP_0", FuncRequest(LFUN_SELFINSERT));
|
||||
|
@ -1193,15 +1193,6 @@ void LyXFunc::dispatch(FuncRequest const & func, bool verbose)
|
||||
setErrorMessage(N_("This is only allowed in math mode!"));
|
||||
break;
|
||||
|
||||
// passthrough hat and underscore outside mathed:
|
||||
case LFUN_SUBSCRIPT:
|
||||
dispatch(FuncRequest(view(), LFUN_SELFINSERT, "_"));
|
||||
break;
|
||||
|
||||
case LFUN_SUPERSCRIPT:
|
||||
dispatch(FuncRequest(view(), LFUN_SELFINSERT, "^"));
|
||||
break;
|
||||
|
||||
case LFUN_DIALOG_SHOW: {
|
||||
string const name = func.getArg(0);
|
||||
string data = trim(func.argument.substr(name.size()));
|
||||
|
@ -604,16 +604,7 @@ InsetFormulaBase::priv_dispatch(FuncRequest const & cmd,
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_SUPERSCRIPT:
|
||||
case LFUN_SUBSCRIPT:
|
||||
{
|
||||
recordUndo(bv, Undo::ATOMIC);
|
||||
mathcursor->script(cmd.action == LFUN_SUPERSCRIPT);
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_MATH_DELIM:
|
||||
{
|
||||
case LFUN_MATH_DELIM: {
|
||||
//lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'" << endl;
|
||||
string ls;
|
||||
string rs = split(cmd.argument, ls, ' ');
|
||||
|
@ -1254,6 +1254,16 @@ bool MathCursor::interpret(char c)
|
||||
return pos() != size();
|
||||
}
|
||||
|
||||
if (c == '_') {
|
||||
script(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (c == '^') {
|
||||
script(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (c == '{' || c == '}' || c == '#' || c == '&' || c == '$') {
|
||||
niceInsert(createMathInset(string(1, c)));
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user