* stay in front of insets/segment on RTL/LTR boundary

(fixes bug 3754: Cursor movement at RTL-LTR boundary)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18666 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Stefan Schimanski 2007-06-04 18:35:03 +00:00
parent d2b9ba811e
commit 6d67f77467

View File

@ -1030,14 +1030,16 @@ bool Text::cursorRight(Cursor & cur)
// not at paragraph end?
if (cur.pos() != cur.lastpos()) {
// if left of boundary -> just jump to right side
if (cur.boundary())
return setCursor(cur, cur.pit(), cur.pos(), true, false);
// in front of editable inset, i.e. jump into it?
if (checkAndActivateInset(cur, true))
return false;
// if left of boundary -> just jump to right side
// but for RTL boundaries don't, because: abc|DDEEFFghi -> abcDDEEF|Fghi
if (cur.boundary() &&
!bidi.isBoundary(cur.buffer(), cur.paragraph(), cur.pos()))
return setCursor(cur, cur.pit(), cur.pos(), true, false);
// next position is left of boundary,
// but go to next line for special cases like space, newline, linesep
#if 0
@ -1062,6 +1064,11 @@ bool Text::cursorRight(Cursor & cur)
return setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
}
// in front of RTL boundary? Stay on this side of the boundary because:
// ab|cDDEEFFghi -> abc|DDEEFFghi
if (bidi.isBoundary(cur.buffer(), cur.paragraph(), cur.pos() + 1))
return setCursor(cur, cur.pit(), cur.pos() + 1, true, true);
// move right
return setCursor(cur, cur.pit(), cur.pos() + 1, true, false);
}