Simplify a bit.

Also, I always worry that "file" will conflict with something....
This commit is contained in:
Richard Kimberly Heck 2019-04-26 21:51:48 -04:00
parent e84f6dff77
commit 276ffc262c

View File

@ -326,16 +326,15 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
} }
void InsetInclude::editIncluded(string const & file) void InsetInclude::editIncluded(string const & f)
{ {
string const ext = support::getExtension(file); if (isLyXFileName(f)) {
if (ext == "lyx") { FuncRequest fr(LFUN_BUFFER_CHILD_OPEN, f);
FuncRequest fr(LFUN_BUFFER_CHILD_OPEN, file);
lyx::dispatch(fr); lyx::dispatch(fr);
} else } else
// tex file or other text file in verbatim mode // tex file or other text file in verbatim mode
theFormats().edit(buffer(), theFormats().edit(buffer(),
support::makeAbsPath(file, support::onlyPath(buffer().absFileName())), support::makeAbsPath(f, support::onlyPath(buffer().absFileName())),
"text"); "text");
} }