X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathNest.cpp;h=8c835a0f7f06d25f8754b62944888a191e0b1f12;hb=b9765984c0e2d38b251b765cabfc9d23bf957a7a;hp=fbeeac175214bbcca29354936cbda1c3996542bd;hpb=32871c1284f15265f652ff01c438e539a7c8181f;p=lyx.git diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index fbeeac1752..8c835a0f7f 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -18,33 +18,33 @@ #include "InsetMathBrace.h" #include "InsetMathColor.h" #include "InsetMathComment.h" -#include "MathData.h" #include "InsetMathDelim.h" -#include "MathFactory.h" #include "InsetMathHull.h" -#include "MathStream.h" -#include "MathMacroArgument.h" //#include "InsetMathMBox.h" -#include "MathParser.h" +#include "InsetMathRef.h" #include "InsetMathScript.h" #include "InsetMathSpace.h" #include "InsetMathSymbol.h" -#include "MathSupport.h" #include "InsetMathUnknown.h" -#include "InsetMathRef.h" +#include "MathData.h" +#include "MathFactory.h" +#include "MathMacroArgument.h" +#include "MathParser.h" +#include "MathStream.h" +#include "MathSupport.h" +#include "bufferview_funcs.h" #include "BufferView.h" -#include "CutAndPaste.h" -#include "FuncStatus.h" #include "Color.h" -#include "bufferview_funcs.h" #include "CoordCache.h" #include "Cursor.h" +#include "CutAndPaste.h" #include "debug.h" #include "DispatchResult.h" #include "FuncRequest.h" +#include "FuncStatus.h" #include "gettext.h" -#include "LyXText.h" +#include "Text.h" #include "OutputParams.h" #include "Undo.h" @@ -56,8 +56,6 @@ #include "frontends/Selection.h" #include "FuncRequest.h" -#include "LyXServer.h" -#include "LyXServerSocket.h" #include @@ -406,7 +404,7 @@ void InsetMathNest::handleFont void InsetMathNest::handleFont2(Cursor & cur, docstring const & arg) { recordUndo(cur, Undo::ATOMIC); - LyXFont font; + Font font; bool b; bv_funcs::string2font(to_utf8(arg), font, b); if (font.color() != Color::inherit) { @@ -494,6 +492,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) cur.autocorrect() = false; cur.clearTargetX(); cur.macroModeClose(); + if (cur.isRTL() ) + goto goto_char_backwards; + +goto_char_forwards: if (cur.pos() != cur.lastpos() && cur.openable(cur.nextAtom())) { cur.pushLeft(*cur.nextAtom().nucleus()); cur.inset().idxFirst(cur); @@ -513,6 +515,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) cur.autocorrect() = false; cur.clearTargetX(); cur.macroModeClose(); + if (cur.isRTL()) + goto goto_char_forwards; + +goto_char_backwards: if (cur.pos() != 0 && cur.openable(cur.prevAtom())) { cur.posLeft(); cur.push(*cur.nextAtom().nucleus()); @@ -917,7 +923,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) rdelim))); } // Don't call cur.undispatched() if we did nothing, this would - // lead to infinite recursion via LyXText::dispatch(). + // lead to infinite recursion via Text::dispatch(). break; } @@ -985,7 +991,7 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) } default: - InsetMathDim::doDispatch(cur, cmd); + InsetMath::doDispatch(cur, cmd); break; } } @@ -1146,7 +1152,7 @@ void InsetMathNest::lfunMousePress(Cursor & cur, FuncRequest & cmd) } else if (cmd.button() == mouse_button::button2) { MathData ar; if (cap::selection()) { - // See comment in LyXText::dispatch why we do this + // See comment in Text::dispatch why we do this cap::copySelectionToStack(); cmd = FuncRequest(LFUN_PASTE, "0"); doDispatch(cur, cmd);