void LyXFunc::handleKeyFunc(kb_action action)
{
- char c = encoded_last_key;
+ char_type c = encoded_last_key;
- if (keyseq->length()) {
+ if (keyseq->length())
c = 0;
- }
lyx_view_->view()->getIntl().getTransManager()
.deadkey(c, get_accent(action).accent, view()->getLyXText());
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.
// redraw the screen at the end (first of the two drawing steps).
//This is done unless explicitely requested otherwise
- bool update = true;
- // also do the second redrawing step. Only done if requested.
- bool updateforce = false;
+ Update::flags updateFlags = Update::FitCursor;
FuncStatus const flag = getStatus(cmd);
if (!flag.enabled()) {
lyx_view_->message(str + _(" done."));
} else
writeAs(lyx_view_->buffer());
- update = false;
+ updateFlags = Update::None;
break;
case LFUN_BUFFER_WRITE_AS:
writeAs(lyx_view_->buffer(), argument);
- update = false;
+ updateFlags = Update::None;
break;
case LFUN_BUFFER_RELOAD: {
}
// ideally, the update flag should be set by the insets,
// but this is not possible currently
- updateforce = true;
+ updateFlags = Update::Force | Update::FitCursor;
break;
}
it->dispatch(tmpcur, fr);
}
}
- updateforce = true;
+ updateFlags = Update::Force | Update::FitCursor;
break;
}
buffer->errors("Class Switch");
updateLabels(*buffer);
- updateforce = true;
+ updateFlags = Update::Force | Update::FitCursor;
break;
}
default: {
view()->cursor().dispatch(cmd);
- updateforce |= view()->cursor().result().update();
+ updateFlags = view()->cursor().result().update();
if (!view()->cursor().result().dispatched())
- updateforce |= view()->dispatch(cmd);
+ if (view()->dispatch(cmd))
+ updateFlags = Update::Force | Update::FitCursor;
break;
}
}
// Redraw screen unless explicitly told otherwise.
// This also initializes the position cache for all insets
// in (at least partially) visible top-level paragraphs.
- if (updateforce)
- view()->update(Update::FitCursor | Update::Force);
- else if (update)
- view()->update(Update::FitCursor);
+ bool needSecondUpdate = false;
+ if (updateFlags != Update::None)
+ view()->update(updateFlags);
+ else
+ needSecondUpdate = view()->fitCursor();
- lyx_view_->redrawWorkArea();
+ if (needSecondUpdate || updateFlags != Update::None) {
+ view()->buffer()->changed();
+ }
+ lyx_view_->updateStatusBar();
// if we executed a mutating lfun, mark the buffer as dirty
if (flag.enabled()