From: Asger Ottar Alstrup Date: Sat, 21 Oct 2006 12:01:14 +0000 (+0000) Subject: - Review screen update flags X-Git-Tag: 1.6.10~12277 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8a424f8382d3c0b72077d0e5ab54d16d56897456;p=features.git - Review screen update flags git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15445 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/LyXAction.C b/src/LyXAction.C index aa07b19e68..8b5eca670e 100644 --- a/src/LyXAction.C +++ b/src/LyXAction.C @@ -261,11 +261,11 @@ void LyXAction::init() { LFUN_REDO, "redo", Noop }, { LFUN_LABEL_GOTO, "label-goto", ReadOnly }, { LFUN_REFERENCE_NEXT, "reference-next", ReadOnly }, - { LFUN_SCREEN_DOWN, "screen-down", ReadOnly | NoUpdate}, + { LFUN_SCREEN_DOWN, "screen-down", ReadOnly }, { LFUN_SCREEN_DOWN_SELECT, "screen-down-select", ReadOnly }, { LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer }, { LFUN_SCREEN_RECENTER, "screen-recenter", ReadOnly }, - { LFUN_SCREEN_UP, "screen-up", ReadOnly | NoUpdate}, + { LFUN_SCREEN_UP, "screen-up", ReadOnly }, { LFUN_SCREEN_UP_SELECT, "screen-up-select", ReadOnly }, { LFUN_SELF_INSERT, "self-insert", SingleParUpdate }, { LFUN_SPACE_INSERT, "space-insert", Noop }, diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 7fa89e0b67..ae6109d094 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -721,7 +721,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) string const argument = to_utf8(cmd.argument()); kb_action const action = cmd.action; - lyxerr[Debug::ACTION] << "LyXFunc::dispatch: cmd: " << cmd << endl; + lyxerr[Debug::ACTION] << endl << "LyXFunc::dispatch: cmd: " << cmd << endl; //lyxerr << "LyXFunc::dispatch: cmd: " << cmd << endl; // we have not done anything wrong yet. @@ -1590,6 +1590,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) default: { view()->cursor().dispatch(cmd); + update = false; updateforce |= view()->cursor().result().update(); if (!view()->cursor().result().dispatched()) updateforce |= view()->dispatch(cmd); diff --git a/src/text2.C b/src/text2.C index afc507d470..3ab916a9c1 100644 --- a/src/text2.C +++ b/src/text2.C @@ -959,6 +959,7 @@ Row const & LyXText::getRowNearY(int y, pit_type pit) const InsetBase * LyXText::editXY(LCursor & cur, int x, int y) { if (lyxerr.debugging(Debug::WORKAREA)) { + lyxerr << "LyXText::editXY(cur, " << x << ", " << y << ")" << std::endl; bv()->coordCache().dump(); } pit_type pit = getPitNearY(y); diff --git a/src/text3.C b/src/text3.C index b594faf69b..d0e57a3e38 100644 --- a/src/text3.C +++ b/src/text3.C @@ -406,7 +406,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_BUFFER_BEGIN_SELECT: cur.selHandle(cmd.action == LFUN_BUFFER_BEGIN_SELECT); if (cur.depth() == 1) { - needsUpdate = cursorTop(cur); + needsUpdate |= cursorTop(cur); } else { cur.undispatched(); } @@ -416,7 +416,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_BUFFER_END_SELECT: cur.selHandle(cmd.action == LFUN_BUFFER_END_SELECT); if (cur.depth() == 1) { - needsUpdate = cursorBottom(cur); + needsUpdate |= cursorBottom(cur); } else { cur.undispatched(); } @@ -428,9 +428,9 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) // << " LFUN_CHAR_FORWARD[SEL]:\n" << cur << endl; cur.selHandle(cmd.action == LFUN_CHAR_FORWARD_SELECT); if (isRTL(cur.paragraph())) - needsUpdate = cursorLeft(cur); + needsUpdate |= cursorLeft(cur); else - needsUpdate = cursorRight(cur); + needsUpdate |= cursorRight(cur); if (!needsUpdate && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) { @@ -444,9 +444,9 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) //lyxerr << "handle LFUN_CHAR_BACKWARD[_SELECT]:\n" << cur << endl; cur.selHandle(cmd.action == LFUN_CHAR_BACKWARD_SELECT); if (isRTL(cur.paragraph())) - needsUpdate = cursorRight(cur); + needsUpdate |= cursorRight(cur); else - needsUpdate = cursorLeft(cur); + needsUpdate |= cursorLeft(cur); if (!needsUpdate && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) { @@ -461,7 +461,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) //lyxerr << "handle LFUN_UP[SEL]:\n" << cur << endl; cur.selHandle(cmd.action == LFUN_UP_SELECT); - needsUpdate = cursorUp(cur); + needsUpdate |= cursorUp(cur); if (!needsUpdate && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) { cur.undispatched(); @@ -474,7 +474,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) update(cur); //lyxerr << "handle LFUN_DOWN[SEL]:\n" << cur << endl; cur.selHandle(cmd.action == LFUN_DOWN_SELECT); - needsUpdate = cursorDown(cur); + needsUpdate |= cursorDown(cur); if (!needsUpdate && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) { @@ -486,13 +486,13 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_PARAGRAPH_UP: case LFUN_PARAGRAPH_UP_SELECT: cur.selHandle(cmd.action == LFUN_PARAGRAPH_UP_SELECT); - needsUpdate = cursorUpParagraph(cur); + needsUpdate |= cursorUpParagraph(cur); break; case LFUN_PARAGRAPH_DOWN: case LFUN_PARAGRAPH_DOWN_SELECT: cur.selHandle(cmd.action == LFUN_PARAGRAPH_DOWN_SELECT); - needsUpdate = cursorDownParagraph(cur); + needsUpdate |= cursorDownParagraph(cur); break; case LFUN_SCREEN_UP: @@ -503,7 +503,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) cur.undispatched(); cmd = FuncRequest(LFUN_FINISHED_UP); } else { - needsUpdate = cursorPrevious(cur); + needsUpdate |= cursorPrevious(cur); } break; @@ -516,7 +516,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) cur.undispatched(); cmd = FuncRequest(LFUN_FINISHED_DOWN); } else { - needsUpdate = cursorNext(cur); + needsUpdate |= cursorNext(cur); } break; @@ -524,32 +524,32 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_LINE_BEGIN_SELECT: update(cur); cur.selHandle(cmd.action == LFUN_LINE_BEGIN_SELECT); - needsUpdate = cursorHome(cur); + needsUpdate |= cursorHome(cur); break; case LFUN_LINE_END: case LFUN_LINE_END_SELECT: update(cur); cur.selHandle(cmd.action == LFUN_LINE_END_SELECT); - needsUpdate = cursorEnd(cur); + needsUpdate |= cursorEnd(cur); break; case LFUN_WORD_FORWARD: case LFUN_WORD_FORWARD_SELECT: cur.selHandle(cmd.action == LFUN_WORD_FORWARD_SELECT); if (isRTL(cur.paragraph())) - needsUpdate = cursorLeftOneWord(cur); + needsUpdate |= cursorLeftOneWord(cur); else - needsUpdate = cursorRightOneWord(cur); + needsUpdate |= cursorRightOneWord(cur); break; case LFUN_WORD_BACKWARD: case LFUN_WORD_BACKWARD_SELECT: cur.selHandle(cmd.action == LFUN_WORD_BACKWARD_SELECT); if (isRTL(cur.paragraph())) - needsUpdate = cursorRightOneWord(cur); + needsUpdate |= cursorRightOneWord(cur); else - needsUpdate = cursorLeftOneWord(cur); + needsUpdate |= cursorLeftOneWord(cur); break; case LFUN_WORD_SELECT: { @@ -574,7 +574,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) if (cur.pos() == cur.paragraph().size()) // Par boundary, force full-screen update singleParUpdate = false; - needsUpdate = erase(cur); + needsUpdate |= erase(cur); cur.resetAnchor(); // It is possible to make it a lot faster still // just comment out the line below... @@ -606,7 +606,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) // Par boundary, full-screen update if (cur.pos() == 0) singleParUpdate = false; - needsUpdate = backspace(cur); + needsUpdate |= backspace(cur); cur.resetAnchor(); // It is possible to make it a lot faster still // just comment out the line below... @@ -709,7 +709,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) } case LFUN_INSET_DISSOLVE: - needsUpdate = dissolveInset(cur); + needsUpdate |= dissolveInset(cur); break; case LFUN_INSET_SETTINGS: