#include "kbmap.h"
#include "lyxrow.h"
#include "bufferlist.h"
+#include "buffer.h"
#include "BufferView.h"
#include "lyxserver.h"
#include "intl.h"
case LFUN_INSET_SETTINGS: {
disable = true;
UpdatableInset * inset = view()->theLockingInset();
-
+
if (!inset)
break;
case LFUN_END_OF_SENTENCE:
code = Inset::SPECIALCHAR_CODE;
break;
- case LFUN_PROTECTEDSPACE:
+ case LFUN_SPACE_INSERT:
// slight hack: we know this is allowed in math mode
if (!mathcursor)
- code = Inset::SPECIALCHAR_CODE;
+ code = Inset::SPACE_CODE;
break;
default:
break;
&& argument.empty()) {
argument = encoded_last_key;
}
+
+ // the insets can't try to handle this,
+ // a table cell in the dummy position will
+ // lock its insettext, the insettext will
+ // pass it the bufferview, and succeed,
+ // so it will stay not locked. Not good
+ // if we've just done LFUN_ESCAPE (which
+ // injects an LFUN_PARAGRAPH_UPDATE)
+ if (action == LFUN_PARAGRAPH_UPDATE) {
+ view()->dispatch(ev);
+ goto exit_with_message;
+ }
+
// Undo/Redo is a bit tricky for insets.
if (action == LFUN_UNDO) {
view()->undo();
owner->getDialogs().showSearch();
break;
- case LFUN_REMOVEERRORS:
- if (view()->removeAutoInsets()) {
-#warning repaint() or update() or nothing ?
- view()->repaint();
- view()->fitCursor();
- }
- break;
-
case LFUN_DEPTH_MIN:
changeDepth(view(), TEXT(false), DEC_DEPTH, false);
owner->view_state_changed();
int id;
istr >> id;
- Paragraph * par = &*owner->buffer()->getParFromID(id);
- if (par == 0) {
+ ParIterator par = owner->buffer()->getParFromID(id);
+ if (par == owner->buffer()->par_iterator_end()) {
lyxerr[Debug::INFO] << "No matching paragraph found! ["
<< id << ']' << endl;
break;
} else {
- lyxerr[Debug::INFO] << "Paragraph " << par->id()
+ lyxerr[Debug::INFO] << "Paragraph " << (*par)->id()
<< " found." << endl;
}
if (view()->theLockingInset())
view()->unlockInset(view()->theLockingInset());
- if (par->inInset()) {
+ if ((*par)->inInset()) {
FuncRequest cmd(view(), LFUN_INSET_EDIT, "left");
- par->inInset()->localDispatch(cmd);
+ (*par)->inInset()->localDispatch(cmd);
}
// Set the cursor
- view()->getLyXText()->setCursor(par, 0);
+ view()->getLyXText()->setCursor(*par, 0);
view()->switchKeyMap();
owner->view_state_changed();