+2004-09-15 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * ControlInclude.C (load): open nonlyx files via formats.edit()
+
2004-08-15 Lars Gullik Bjonnes <larsbj@gullik.net>
* pch.h: new file
#include "Kernel.h"
#include "buffer.h"
+#include "format.h"
#include "funcrequest.h"
#include "gettext.h"
#include "lyxrc.h"
void ControlInclude::load(string const & file)
{
- kernel().dispatch(FuncRequest(LFUN_CHILDOPEN, file));
+ string const ext = support::getExtFromContents(file);
+ if (ext == "lyx")
+ kernel().dispatch(FuncRequest(LFUN_CHILDOPEN, file));
+ else
+ // tex file or other text file in verbatim mode
+ formats.edit(kernel().buffer(), file, "text");
}