]> git.lyx.org Git - features.git/commitdiff
Fixup e1261817: place cursor correctly in RtL
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 2 May 2023 13:59:36 +0000 (15:59 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 2 May 2023 14:44:40 +0000 (16:44 +0200)
In an RtL paragraph, the cursor should be placed to the right of the
end-of-paragraph indicator.

src/Row.cpp

index 7de4b61d9c31fb921fb1af592656da57923e9daa..769d3e3c746759bef96c1b61d13b74c6721923fa 100644 (file)
@@ -728,10 +728,9 @@ Row::findElement(pos_type const pos, bool const boundary, double & x) const
                 * to accept virtual elements, in which case the position
                 * will be before the virtual element.
                 */
-               if (cit->isVirtual() && pos + boundary_corr == cit->pos)
-                       break;
-               else if (pos + boundary_corr >= cit->pos
-                        && pos + boundary_corr < cit->endpos) {
+               if ((pos + boundary_corr >= cit->pos && pos + boundary_corr < cit->endpos)
+                   || (cit->isVirtual() && pos + boundary_corr == cit->pos)) {
+                       // FIXME: shall we use `pos + boundary_corr' here?
                        x += cit->pos2x(pos);
                        break;
                }