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");
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, ';');
func.origin = cmd.origin;
dispatch(func);
}
+ if (theBufferList().isLoaded(buffer))
+ buffer->undo().endUndoGroup();
break;
}
// 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;