- Review screen update flags

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15445 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Asger Ottar Alstrup 2006-10-21 12:01:14 +00:00
parent 5d6963b0ca
commit 8a424f8382
4 changed files with 26 additions and 24 deletions

View File

@ -261,11 +261,11 @@ void LyXAction::init()
{ LFUN_REDO, "redo", Noop }, { LFUN_REDO, "redo", Noop },
{ LFUN_LABEL_GOTO, "label-goto", ReadOnly }, { LFUN_LABEL_GOTO, "label-goto", ReadOnly },
{ LFUN_REFERENCE_NEXT, "reference-next", 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_DOWN_SELECT, "screen-down-select", ReadOnly },
{ LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer }, { LFUN_SCREEN_FONT_UPDATE, "screen-font-update", NoBuffer },
{ LFUN_SCREEN_RECENTER, "screen-recenter", ReadOnly }, { 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_SCREEN_UP_SELECT, "screen-up-select", ReadOnly },
{ LFUN_SELF_INSERT, "self-insert", SingleParUpdate }, { LFUN_SELF_INSERT, "self-insert", SingleParUpdate },
{ LFUN_SPACE_INSERT, "space-insert", Noop }, { LFUN_SPACE_INSERT, "space-insert", Noop },

View File

@ -721,7 +721,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
string const argument = to_utf8(cmd.argument()); string const argument = to_utf8(cmd.argument());
kb_action const action = cmd.action; 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; //lyxerr << "LyXFunc::dispatch: cmd: " << cmd << endl;
// we have not done anything wrong yet. // we have not done anything wrong yet.
@ -1590,6 +1590,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
default: { default: {
view()->cursor().dispatch(cmd); view()->cursor().dispatch(cmd);
update = false;
updateforce |= view()->cursor().result().update(); updateforce |= view()->cursor().result().update();
if (!view()->cursor().result().dispatched()) if (!view()->cursor().result().dispatched())
updateforce |= view()->dispatch(cmd); updateforce |= view()->dispatch(cmd);

View File

@ -959,6 +959,7 @@ Row const & LyXText::getRowNearY(int y, pit_type pit) const
InsetBase * LyXText::editXY(LCursor & cur, int x, int y) InsetBase * LyXText::editXY(LCursor & cur, int x, int y)
{ {
if (lyxerr.debugging(Debug::WORKAREA)) { if (lyxerr.debugging(Debug::WORKAREA)) {
lyxerr << "LyXText::editXY(cur, " << x << ", " << y << ")" << std::endl;
bv()->coordCache().dump(); bv()->coordCache().dump();
} }
pit_type pit = getPitNearY(y); pit_type pit = getPitNearY(y);

View File

@ -406,7 +406,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_BUFFER_BEGIN_SELECT: case LFUN_BUFFER_BEGIN_SELECT:
cur.selHandle(cmd.action == LFUN_BUFFER_BEGIN_SELECT); cur.selHandle(cmd.action == LFUN_BUFFER_BEGIN_SELECT);
if (cur.depth() == 1) { if (cur.depth() == 1) {
needsUpdate = cursorTop(cur); needsUpdate |= cursorTop(cur);
} else { } else {
cur.undispatched(); cur.undispatched();
} }
@ -416,7 +416,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_BUFFER_END_SELECT: case LFUN_BUFFER_END_SELECT:
cur.selHandle(cmd.action == LFUN_BUFFER_END_SELECT); cur.selHandle(cmd.action == LFUN_BUFFER_END_SELECT);
if (cur.depth() == 1) { if (cur.depth() == 1) {
needsUpdate = cursorBottom(cur); needsUpdate |= cursorBottom(cur);
} else { } else {
cur.undispatched(); cur.undispatched();
} }
@ -428,9 +428,9 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
// << " LFUN_CHAR_FORWARD[SEL]:\n" << cur << endl; // << " LFUN_CHAR_FORWARD[SEL]:\n" << cur << endl;
cur.selHandle(cmd.action == LFUN_CHAR_FORWARD_SELECT); cur.selHandle(cmd.action == LFUN_CHAR_FORWARD_SELECT);
if (isRTL(cur.paragraph())) if (isRTL(cur.paragraph()))
needsUpdate = cursorLeft(cur); needsUpdate |= cursorLeft(cur);
else else
needsUpdate = cursorRight(cur); needsUpdate |= cursorRight(cur);
if (!needsUpdate && oldTopSlice == cur.top() if (!needsUpdate && oldTopSlice == cur.top()
&& cur.boundary() == oldBoundary) { && cur.boundary() == oldBoundary) {
@ -444,9 +444,9 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
//lyxerr << "handle LFUN_CHAR_BACKWARD[_SELECT]:\n" << cur << endl; //lyxerr << "handle LFUN_CHAR_BACKWARD[_SELECT]:\n" << cur << endl;
cur.selHandle(cmd.action == LFUN_CHAR_BACKWARD_SELECT); cur.selHandle(cmd.action == LFUN_CHAR_BACKWARD_SELECT);
if (isRTL(cur.paragraph())) if (isRTL(cur.paragraph()))
needsUpdate = cursorRight(cur); needsUpdate |= cursorRight(cur);
else else
needsUpdate = cursorLeft(cur); needsUpdate |= cursorLeft(cur);
if (!needsUpdate && oldTopSlice == cur.top() if (!needsUpdate && oldTopSlice == cur.top()
&& cur.boundary() == oldBoundary) { && cur.boundary() == oldBoundary) {
@ -461,7 +461,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
//lyxerr << "handle LFUN_UP[SEL]:\n" << cur << endl; //lyxerr << "handle LFUN_UP[SEL]:\n" << cur << endl;
cur.selHandle(cmd.action == LFUN_UP_SELECT); cur.selHandle(cmd.action == LFUN_UP_SELECT);
needsUpdate = cursorUp(cur); needsUpdate |= cursorUp(cur);
if (!needsUpdate && oldTopSlice == cur.top() if (!needsUpdate && oldTopSlice == cur.top()
&& cur.boundary() == oldBoundary) { && cur.boundary() == oldBoundary) {
cur.undispatched(); cur.undispatched();
@ -474,7 +474,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
update(cur); update(cur);
//lyxerr << "handle LFUN_DOWN[SEL]:\n" << cur << endl; //lyxerr << "handle LFUN_DOWN[SEL]:\n" << cur << endl;
cur.selHandle(cmd.action == LFUN_DOWN_SELECT); cur.selHandle(cmd.action == LFUN_DOWN_SELECT);
needsUpdate = cursorDown(cur); needsUpdate |= cursorDown(cur);
if (!needsUpdate && oldTopSlice == cur.top() && if (!needsUpdate && oldTopSlice == cur.top() &&
cur.boundary() == oldBoundary) cur.boundary() == oldBoundary)
{ {
@ -486,13 +486,13 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_PARAGRAPH_UP: case LFUN_PARAGRAPH_UP:
case LFUN_PARAGRAPH_UP_SELECT: case LFUN_PARAGRAPH_UP_SELECT:
cur.selHandle(cmd.action == LFUN_PARAGRAPH_UP_SELECT); cur.selHandle(cmd.action == LFUN_PARAGRAPH_UP_SELECT);
needsUpdate = cursorUpParagraph(cur); needsUpdate |= cursorUpParagraph(cur);
break; break;
case LFUN_PARAGRAPH_DOWN: case LFUN_PARAGRAPH_DOWN:
case LFUN_PARAGRAPH_DOWN_SELECT: case LFUN_PARAGRAPH_DOWN_SELECT:
cur.selHandle(cmd.action == LFUN_PARAGRAPH_DOWN_SELECT); cur.selHandle(cmd.action == LFUN_PARAGRAPH_DOWN_SELECT);
needsUpdate = cursorDownParagraph(cur); needsUpdate |= cursorDownParagraph(cur);
break; break;
case LFUN_SCREEN_UP: case LFUN_SCREEN_UP:
@ -503,7 +503,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
cur.undispatched(); cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_UP); cmd = FuncRequest(LFUN_FINISHED_UP);
} else { } else {
needsUpdate = cursorPrevious(cur); needsUpdate |= cursorPrevious(cur);
} }
break; break;
@ -516,7 +516,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
cur.undispatched(); cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_DOWN); cmd = FuncRequest(LFUN_FINISHED_DOWN);
} else { } else {
needsUpdate = cursorNext(cur); needsUpdate |= cursorNext(cur);
} }
break; break;
@ -524,32 +524,32 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
case LFUN_LINE_BEGIN_SELECT: case LFUN_LINE_BEGIN_SELECT:
update(cur); update(cur);
cur.selHandle(cmd.action == LFUN_LINE_BEGIN_SELECT); cur.selHandle(cmd.action == LFUN_LINE_BEGIN_SELECT);
needsUpdate = cursorHome(cur); needsUpdate |= cursorHome(cur);
break; break;
case LFUN_LINE_END: case LFUN_LINE_END:
case LFUN_LINE_END_SELECT: case LFUN_LINE_END_SELECT:
update(cur); update(cur);
cur.selHandle(cmd.action == LFUN_LINE_END_SELECT); cur.selHandle(cmd.action == LFUN_LINE_END_SELECT);
needsUpdate = cursorEnd(cur); needsUpdate |= cursorEnd(cur);
break; break;
case LFUN_WORD_FORWARD: case LFUN_WORD_FORWARD:
case LFUN_WORD_FORWARD_SELECT: case LFUN_WORD_FORWARD_SELECT:
cur.selHandle(cmd.action == LFUN_WORD_FORWARD_SELECT); cur.selHandle(cmd.action == LFUN_WORD_FORWARD_SELECT);
if (isRTL(cur.paragraph())) if (isRTL(cur.paragraph()))
needsUpdate = cursorLeftOneWord(cur); needsUpdate |= cursorLeftOneWord(cur);
else else
needsUpdate = cursorRightOneWord(cur); needsUpdate |= cursorRightOneWord(cur);
break; break;
case LFUN_WORD_BACKWARD: case LFUN_WORD_BACKWARD:
case LFUN_WORD_BACKWARD_SELECT: case LFUN_WORD_BACKWARD_SELECT:
cur.selHandle(cmd.action == LFUN_WORD_BACKWARD_SELECT); cur.selHandle(cmd.action == LFUN_WORD_BACKWARD_SELECT);
if (isRTL(cur.paragraph())) if (isRTL(cur.paragraph()))
needsUpdate = cursorRightOneWord(cur); needsUpdate |= cursorRightOneWord(cur);
else else
needsUpdate = cursorLeftOneWord(cur); needsUpdate |= cursorLeftOneWord(cur);
break; break;
case LFUN_WORD_SELECT: { case LFUN_WORD_SELECT: {
@ -574,7 +574,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
if (cur.pos() == cur.paragraph().size()) if (cur.pos() == cur.paragraph().size())
// Par boundary, force full-screen update // Par boundary, force full-screen update
singleParUpdate = false; singleParUpdate = false;
needsUpdate = erase(cur); needsUpdate |= erase(cur);
cur.resetAnchor(); cur.resetAnchor();
// It is possible to make it a lot faster still // It is possible to make it a lot faster still
// just comment out the line below... // just comment out the line below...
@ -606,7 +606,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
// Par boundary, full-screen update // Par boundary, full-screen update
if (cur.pos() == 0) if (cur.pos() == 0)
singleParUpdate = false; singleParUpdate = false;
needsUpdate = backspace(cur); needsUpdate |= backspace(cur);
cur.resetAnchor(); cur.resetAnchor();
// It is possible to make it a lot faster still // It is possible to make it a lot faster still
// just comment out the line below... // just comment out the line below...
@ -709,7 +709,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
} }
case LFUN_INSET_DISSOLVE: case LFUN_INSET_DISSOLVE:
needsUpdate = dissolveInset(cur); needsUpdate |= dissolveInset(cur);
break; break;
case LFUN_INSET_SETTINGS: case LFUN_INSET_SETTINGS: