X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText2.cpp;h=7893b8ed71e3b98b34cf36dd94e44a6ce7db198d;hb=ca66e175c9705045793ba3cc2ba95909e5ef5a93;hp=05dad80ea26282fcaf804dae5311bf667ad46df6;hpb=d79225ae987164c59d92621f5f7de203d3179c4c;p=lyx.git diff --git a/src/Text2.cpp b/src/Text2.cpp index 05dad80ea2..7893b8ed71 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -318,7 +318,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall) newfi.setSeries(INHERIT_SERIES); FontShape newshp = newfi.shape(); - if (newshp != INHERIT_SHAPE && newshp != IGNORE_SHAPE && + if (newshp != INHERIT_SHAPE && newshp != IGNORE_SHAPE && newshp == oldfi.shape()) newfi.setShape(INHERIT_SHAPE); @@ -551,9 +551,6 @@ bool Text::setCursor(Cursor & cur, pit_type par, pos_type pos, bool const update_needed = !tm.contains(par); Cursor old = cur; setCursorIntern(cur, par, pos, setfont, boundary); - // FIXME There is a chance that we'll miss a screen update here. - // If so, then do DEPM and then check if cur wants an update and - // go ahead and do it, if so. return cur.bv().checkDepm(cur, old) || update_needed; } @@ -776,7 +773,13 @@ bool Text::cursorDownParagraph(Cursor & cur) { bool updated = false; if (cur.pit() != cur.lastpit()) - updated = setCursor(cur, cur.pit() + 1, 0); + if (lyxrc.mac_like_cursor_movement) + if (cur.pos() == cur.lastpos()) + updated = setCursor(cur, cur.pit() + 1, getPar(cur.pit() + 1).size()); + else + updated = setCursor(cur, cur.pit(), cur.lastpos()); + else + updated = setCursor(cur, cur.pit() + 1, 0); else updated = setCursor(cur, cur.pit(), cur.lastpos()); return updated;