]> git.lyx.org Git - lyx.git/blobdiff - src/LyXFunc.cpp
EmbeddedObjects.lyx, Math.lyx, UserGuide.lyx: Spanish translation updates by Ignacio
[lyx.git] / src / LyXFunc.cpp
index b577b65a7624757ca1b479e2f7b5f70fcb036519..3a29fecedc14d46997b14a0ebbf9faa1a9e7a945 100644 (file)
@@ -1031,7 +1031,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                theApp()->dispatch(FuncRequest(LFUN_WINDOW_NEW));
                        string const arg = argument;
                        if (arg.empty()) {
-                               setErrorMessage(from_ascii(N_("Missing argument")));
+                               setErrorMessage(from_utf8(N_("Missing argument")));
                                break;
                        }
                        FileName const fname = i18nLibFileSearch("doc", arg, "lyx");
@@ -1349,6 +1349,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                case LFUN_COMMAND_SEQUENCE: {
                        // argument contains ';'-terminated commands
                        string arg = argument;
+                       if (theBufferList().isLoaded(buffer))
+                               buffer->undo().beginUndoGroup();
                        while (!arg.empty()) {
                                string first;
                                arg = split(arg, first, ';');
@@ -1356,6 +1358,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                                func.origin = cmd.origin;
                                dispatch(func);
                        }
+                       if (theBufferList().isLoaded(buffer))
+                               buffer->undo().endUndoGroup();
                        break;
                }
 
@@ -1731,6 +1735,9 @@ void LyXFunc::reloadBuffer()
        // The user has already confirmed that the changes, if any, should
        // be discarded. So we just release the Buffer and don't call closeBuffer();
        theBufferList().release(lyx_view_->buffer());
+       // if the lyx_view_ has been destroyed, create a new one
+       if (!lyx_view_)
+               theApp()->dispatch(FuncRequest(LFUN_WINDOW_NEW));
        Buffer * buf = lyx_view_->loadDocument(filename);
        docstring const disp_fn = makeDisplayPath(filename.absFilename());
        docstring str;