]> git.lyx.org Git - features.git/commitdiff
Simplify a bit.
authorRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 27 Apr 2019 01:51:48 +0000 (21:51 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Sat, 27 Apr 2019 02:05:42 +0000 (22:05 -0400)
Also, I always worry that "file" will conflict with something....

src/insets/InsetInclude.cpp

index 9e70cd7cdd8d9cf0ac44d0de08c4bf6f5fd4f9f9..78da0cb6c2286e3c171f1ac8490cb4f36d77dc4b 100755 (executable)
@@ -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");
 }