Symptom:

inset a child document in type include, select a .tex file with
relative path, load. Lyx crashes.

Problem:

In formats.edit(... Filename(file), "text"), file needs to be a full path name.

Patch:

The attached simple patch fixes this. It may also have fixed bug 4107.
 Note that this filename is relative to buffer path.

Problem:

I think "Load" should be renamed to "Edit". .lyx file is edited in
lyx, and others are edited by 'formats.edit(....)'.

Cheers,
Bo

Index: src/frontends/controllers/ControlInclude.cpp
===================================================================
--- src/frontends/controllers/ControlInclude.cpp        (revision 19343)
+++ src/frontends/controllers/ControlInclude.cpp        (working copy)
@@ -107,7 +107,7 @@
                kernel().dispatch(FuncRequest(LFUN_BUFFER_CHILD_OPEN, file));
        else
                // tex file or other text file in verbatim mode
-               formats.edit(kernel().buffer(), FileName(file), "text");
+               formats.edit(kernel().buffer(), FileName(makeAbsPath(file,
onlyPath(kernel().buffer().fileName()))), "text");
 }

Reply via email to