From: Richard Kimberly Heck Date: Sat, 27 Apr 2019 01:51:48 +0000 (-0400) Subject: Simplify a bit. X-Git-Tag: lyx-2.4.0dev-acb2ca7b~2093 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=276ffc262c62e7b3b739814fcdf00ca3fe4c8ef1;p=features.git Simplify a bit. Also, I always worry that "file" will conflict with something.... --- diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 9e70cd7cdd..78da0cb6c2 100755 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -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 (ext == "lyx") { - FuncRequest fr(LFUN_BUFFER_CHILD_OPEN, file); + if (isLyXFileName(f)) { + FuncRequest fr(LFUN_BUFFER_CHILD_OPEN, f); lyx::dispatch(fr); } else // tex file or other text file in verbatim mode theFormats().edit(buffer(), - support::makeAbsPath(file, support::onlyPath(buffer().absFileName())), + support::makeAbsPath(f, support::onlyPath(buffer().absFileName())), "text"); }