On Wed, May 09, 2007 at 12:58:12AM +0300, Dov Feldstern wrote: > [...] > So how do we move ahead with this? > > 1. Since the current implementation is of logical movement, I strongly > urge that we stick with that. And in order to fix the problem with that > (of the cursor getting stuck within insets), I suggest applying Elazar's > patch for math insets (attached math_insets.diff), and my patch for > other insets and for movement around insets (also attached > rtl_insets.diff; modified from my previous version, in accordance with > JMarc's comments; also, I consolidated a bit, so that policy changes --- > e.g., inner or outer paragraph --- need only touch one place, and not > five or six). > > If you have any technical comments about these patches, let's work them > out. Otherwise, let's please commit them?
Fine with me. Even the gotos. > > 2. It would be great if we could also add support for visual mode (see > bug http://bugzilla.lyx.org/show_bug.cgi?id=3577), as a preference. > Elazar has sent a patch which starts moving in that direction, and I > have responded to it (see thread > http://thread.gmane.org/gmane.editors.lyx.devel/82838). We need help > with it, though, so please do help us if you can. > > Just in order to clarify future discussions of this, let's try to be > clear about whether any given discussion is about "logical mode" or > "visual mode" --- both of which we would like to support. > > Thanks! > Dov > Index: src/mathed/InsetMathNest.cpp > =================================================================== > --- src/mathed/InsetMathNest.cpp (revision 18237) > +++ src/mathed/InsetMathNest.cpp (working copy) > @@ -492,6 +492,10 @@ > 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); > @@ -511,6 +515,10 @@ > 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()); > Index: src/Text.h > =================================================================== > --- src/Text.h (revision 18237) > +++ src/Text.h (working copy) > @@ -328,6 +328,8 @@ > docstring getPossibleLabel(Cursor & cur) const; > /// is this paragraph right-to-left? > bool isRTL(Buffer const &, Paragraph const & par) const; > + /// should cursor movements be reversed (for bidi)? > + bool reverseDirections(Cursor const & cur) const; Spacing Andre'