X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText2.cpp;h=0c96a81a2166bd68caf4d45147764f8b3b851b05;hb=84d4d45daa9e0b1a18ab0133c6caa5f34e7f8616;hp=8dfcd4a2300e491f646117417f88d713a5f536de;hpb=b383d04e078f23553cefcd82851b037f54a7d1c8;p=lyx.git diff --git a/src/Text2.cpp b/src/Text2.cpp index 8dfcd4a230..0c96a81a21 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -539,7 +539,7 @@ void Text::insertInset(Cursor & cur, Inset * inset) LBUFERR(this == cur.text()); LBUFERR(inset); cur.paragraph().insertInset(cur.pos(), inset, cur.current_font, - Change(cur.buffer()->params().trackChanges + Change(cur.buffer()->params().track_changes ? Change::INSERTED : Change::UNCHANGED)); } @@ -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; @@ -852,7 +855,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur, && oldpar.isLineSeparator(old.pos() - 1) && !oldpar.isDeleted(old.pos() - 1) && !oldpar.isDeleted(old.pos())) { - oldpar.eraseChar(old.pos() - 1, cur.buffer()->params().trackChanges); + oldpar.eraseChar(old.pos() - 1, cur.buffer()->params().track_changes); // FIXME: This will not work anymore when we have multiple views of the same buffer // In this case, we will have to correct also the cursors held by // other bufferviews. It will probably be easier to do that in a more @@ -907,7 +910,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur, return true; } - if (oldpar.stripLeadingSpaces(cur.buffer()->params().trackChanges)) { + if (oldpar.stripLeadingSpaces(cur.buffer()->params().track_changes)) { need_anchor_change = true; // We return true here because the Paragraph contents changed and // we need a redraw before further action is processed.