]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
"Inter-word Space"
[lyx.git] / src / lyxfunc.C
index 7cc5f9424c989ecf62bac80749bd27d90d87fe95..5a3fffc15803bc7651acaf0246c91049220c58a3 100644 (file)
@@ -15,6 +15,7 @@
 #include "kbmap.h"
 #include "lyxrow.h"
 #include "bufferlist.h"
+#include "buffer.h"
 #include "BufferView.h"
 #include "lyxserver.h"
 #include "intl.h"
@@ -490,7 +491,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        case LFUN_INSET_SETTINGS: {
                disable = true;
                UpdatableInset * inset = view()->theLockingInset();
-               
+
                if (!inset)
                        break;
 
@@ -663,10 +664,10 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & ev) const
        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;
@@ -836,6 +837,19 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                            && 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();
@@ -1126,14 +1140,6 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
                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();
@@ -1353,24 +1359,24 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
 
                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();