]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
LFUN_UNICODE_INSERT - unicode-insert
[lyx.git] / src / lyxfunc.C
index ae6109d09402c573dc3bc841e661679fe0bfd23e..58a8fa635f220db8e56b9bfad090f4e70c174a90 100644 (file)
@@ -223,11 +223,10 @@ void LyXFunc::setLyXView(LyXView * lv)
 
 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());
@@ -730,9 +729,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
        // 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()) {
@@ -820,12 +817,12 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                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: {
@@ -1426,7 +1423,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        }
                        // ideally, the update flag should be set by the insets,
                        // but this is not possible currently
-                       updateforce = true;
+                       updateFlags = Update::Force | Update::FitCursor;
                        break;
                }
 
@@ -1450,7 +1447,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                        it->dispatch(tmpcur, fr);
                                }
                        }
-                       updateforce = true;
+                       updateFlags = Update::Force | Update::FitCursor;
                        break;
                }
 
@@ -1559,7 +1556,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                        buffer->errors("Class Switch");
                        updateLabels(*buffer);
-                       updateforce = true;
+                       updateFlags = Update::Force | Update::FitCursor;
                        break;
                }
 
@@ -1590,10 +1587,10 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
 
                default: {
                        view()->cursor().dispatch(cmd);
-                       update = false;
-                       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;
                }
                }
@@ -1602,12 +1599,16 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        // 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()