]> git.lyx.org Git - features.git/blobdiff - src/lyxfunc.C
The command-sequence patch from Andre'; also remove the comment in first
[features.git] / src / lyxfunc.C
index 4a9debb27939ad9339e91f267ab67e7eb340c49d..a5b8cfa3e68cfcc9b0479e50705e50474db8b2ac 100644 (file)
@@ -311,10 +311,13 @@ int LyXFunc::processKeyEvent(XEvent *ev)
 } 
 
 
-string LyXFunc::Dispatch(string const &cmd, string const &arg)
+string LyXFunc::Dispatch(string const& s) 
 {
-       return Dispatch(lyxaction.LookupFunc(cmd.c_str()),
-                       arg.c_str());
+  // Split command string into command and argument
+       string cmd, line = frontStrip(s);
+       string arg = strip(frontStrip(split(line, cmd, ' ')));
+
+       return Dispatch(lyxaction.LookupFunc(cmd.c_str()), arg.c_str());
 }
 
 
@@ -2364,6 +2367,17 @@ string LyXFunc::Dispatch(int ac,
        }
        break;
 
+       case LFUN_SEQUENCE: 
+       {
+               // argument contains ';'-terminated commands
+               while (argument.find(';') != string::npos) {
+                       string first;
+                       argument = split(argument, first, ';');
+                       Dispatch(first);
+               }
+       }
+       break;
+
        case LFUN_UNKNOWN_ACTION:
        {
                if (owner->buffer()->isReadonly()) {