]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.C
fix the <...> delimiters
[lyx.git] / src / lyxfunc.C
index 4408f4725ef2dacbf68a49283b1020d8b1c60ec0..13ec8c88e7fe3a5d293309d9373cf5a13a4fbe31 100644 (file)
@@ -34,7 +34,7 @@
 #include "trans_mgr.h"
 #include "layout.h"
 #include "bufferview_funcs.h"
-#include "minibuffer.h"
+#include "frontends/MiniBuffer.h"
 #include "vspace.h"
 #include "frontends/LyXView.h"
 #include "FloatList.h"
@@ -521,6 +521,12 @@ FuncStatus LyXFunc::getStatus(kb_action action,
                                flag.setOnOff(type == LM_OT_EQNARRAY);
                        } else if (argument == "align") {
                                flag.setOnOff(type == LM_OT_ALIGN);
+                       } else if (argument == "alignat") {
+                               flag.setOnOff(type == LM_OT_ALIGNAT);
+                       } else if (argument == "xalignat") {
+                               flag.setOnOff(type == LM_OT_XALIGNAT);
+                       } else if (argument == "xxalignat") {
+                               flag.setOnOff(type == LM_OT_XXALIGNAT);
                        } else if (argument == "none") {
                                flag.setOnOff(type == LM_OT_NONE);
                        } else {
@@ -613,8 +619,6 @@ FuncStatus LyXFunc::getStatus(kb_action action,
                code = Inset::BIBTEX_CODE;
                break;
        case LFUN_INDEX_INSERT:
-       case LFUN_INDEX_INSERT_LAST:
-       case LFUN_INDEX_CREATE:
                code = Inset::INDEX_CODE;
                break;
        case LFUN_INDEX_PRINT:
@@ -787,42 +791,40 @@ void LyXFunc::verboseDispatch(kb_action action,
 
        commandshortcut.erase();
 
-       if (lyxrc.display_shortcuts && show_sc) {
-               if (action != LFUN_SELFINSERT) {
-                       // Put name of command and list of shortcuts
-                       // for it in minibuffer
-                       string comname = lyxaction.getActionName(action);
+       if (show_sc && action != LFUN_SELFINSERT) {
+               // Put name of command and list of shortcuts
+               // for it in minibuffer
+               string comname = lyxaction.getActionName(action);
 
-                       int pseudoaction = action;
-                       bool argsadded = false;
+               int pseudoaction = action;
+               bool argsadded = false;
 
-                       if (!argument.empty()) {
-                               // the pseudoaction is useful for the bindings
-                               pseudoaction =
-                                       lyxaction.searchActionArg(action,
-                                                                 argument);
+               if (!argument.empty()) {
+                       // the pseudoaction is useful for the bindings
+                       pseudoaction =
+                               lyxaction.searchActionArg(action,
+                                                         argument);
 
-                               if (pseudoaction == LFUN_UNKNOWN_ACTION) {
-                                       pseudoaction = action;
-                               } else {
-                                       comname += " " + argument;
-                                       argsadded = true;
-                               }
+                       if (pseudoaction == LFUN_UNKNOWN_ACTION) {
+                               pseudoaction = action;
+                       } else {
+                               comname += " " + argument;
+                               argsadded = true;
                        }
+               }
 
-                       string const shortcuts =
-                               toplevel_keymap->findbinding(pseudoaction);
+               string const shortcuts =
+                       toplevel_keymap->findbinding(pseudoaction);
 
-                       if (!shortcuts.empty()) {
-                               comname += ": " + shortcuts;
-                       } else if (!argsadded && !argument.empty()) {
-                               comname += " " + argument;
-                       }
+               if (!shortcuts.empty()) {
+                       comname += ": " + shortcuts;
+               } else if (!argsadded && !argument.empty()) {
+                       comname += " " + argument;
+               }
 
-                       if (!comname.empty()) {
-                               comname = strip(comname);
-                               commandshortcut = "(" + comname + ')';
-                       }
+               if (!comname.empty()) {
+                       comname = strip(comname);
+                       commandshortcut = "(" + comname + ')';
                }
        }
 
@@ -1051,8 +1053,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                transform(lyxaction.func_begin(), lyxaction.func_end(),
                          back_inserter(allCmds), lyx::firster());
                static vector<string> hist;
-               owner->getMiniBuffer()->getString(MiniBuffer::spaces,
-                                                 allCmds, hist);
+               owner->getMiniBuffer()->prepareForInput(allCmds, hist);
        }
        break;
 
@@ -1199,7 +1200,8 @@ string const LyXFunc::dispatch(kb_action action, string argument)
 
        case LFUN_REMOVEERRORS:
                if (owner->view()->removeAutoInsets()) {
-                       owner->view()->redraw();
+#warning repaint() or update() or nothing ?
+                       owner->view()->repaint();
                        owner->view()->fitCursor();
                }
                break;
@@ -1636,7 +1638,7 @@ string const LyXFunc::dispatch(kb_action action, string argument)
                        gc.changeDisplay(true);
                }
 
-               owner->view()->redraw();
+               owner->view()->repaint();
                break;
        }
 
@@ -1774,7 +1776,6 @@ void LyXFunc::menuNew(bool fromTemplate)
                            << disp_fn << "...";
 
                        owner->message(str.str().c_str());
-                       //XFlush(fl_get_display());
                        owner->view()->buffer(bufferlist.loadLyXFile(s));
                        ostringstream str2;
                        str2 << _("Document") << ' '
@@ -1904,7 +1905,7 @@ void LyXFunc::doImport(string const & argument)
 
        lyxerr[Debug::INFO] << "LyXFunc::doImport: " << format
                            << " file: " << filename << endl;
+
        // need user interaction
        if (filename.empty()) {
                string initpath = lyxrc.document_path;
@@ -1972,7 +1973,7 @@ void LyXFunc::doImport(string const & argument)
                        }
        }
 
-       // if the file exists already, and we didn't do 
+       // if the file exists already, and we didn't do
        // -i lyx thefile.lyx, warn
        if (FileInfo(lyxfile, true).exist() && filename != lyxfile) {
                if (!Alert::askQuestion(_("A document by the name"),